linux:digitalocean
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux:digitalocean [2014/12/28 03:06] – [php] admin | linux:digitalocean [2022/10/29 16:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Moving web from hostgator to DigitalOcean ====== | ====== Moving web from hostgator to DigitalOcean ====== | ||
+ | |||
===== 1. Install missing components on DigitalOcean ===== | ===== 1. Install missing components on DigitalOcean ===== | ||
==== install basic packages ==== | ==== install basic packages ==== | ||
Line 5: | Line 6: | ||
yum install vim mc man telnet | yum install vim mc man telnet | ||
</ | </ | ||
- | ==== mysqld ==== | ||
- | * setup:< | ||
- | yum install mysql-server.x86_64 | ||
- | </ | ||
- | * start:< | ||
- | / | ||
- | </ | ||
- | ==== httpd ==== | ||
- | * setup:< | ||
- | yum install httpd.x86_64 | ||
- | </ | ||
- | * start:< | ||
- | / | ||
- | </ | ||
- | ==== php ==== | ||
- | * setup:< | ||
- | yum install php.x86_64 | ||
- | yum install php-mysql.x86_64 | ||
- | </ | ||
==== create swap file for your linux server ==== | ==== create swap file for your linux server ==== | ||
Most **cloud virtual machine providers do not set up swapfiles** as part of their server provisioning. | Most **cloud virtual machine providers do not set up swapfiles** as part of their server provisioning. | ||
Line 58: | Line 40: | ||
echo vm.swappiness = 10 | sudo tee -a / | echo vm.swappiness = 10 | sudo tee -a / | ||
</ | </ | ||
- | ===== 2. copy data from hostgator to Digitalocean ===== | + | ==== mysqld ==== |
+ | * setup:< | ||
+ | yum install mysql-server.x86_64 | ||
+ | </ | ||
+ | * start:< | ||
+ | / | ||
+ | </ | ||
+ | ==== httpd ==== | ||
+ | * setup:< | ||
+ | yum install httpd.x86_64 | ||
+ | </ | ||
+ | * start:< | ||
+ | / | ||
+ | </ | ||
+ | ==== php ==== | ||
+ | * setup:< | ||
+ | yum install php.x86_64 | ||
+ | yum install php-mysql.x86_64 | ||
+ | </ | ||
+ | |||
+ | ===== 2. Copy data from hostgator to Digitalocean ===== | ||
==== create backup file for web and database on Hostgator ==== | ==== create backup file for web and database on Hostgator ==== | ||
=== backup web === | === backup web === | ||
Line 70: | Line 72: | ||
</ | </ | ||
==== copy data to Digitalocean with scp ==== | ==== copy data to Digitalocean with scp ==== | ||
+ | (To run scp, you must install openssh-clients both client and server) | ||
* check ssh connect: <code bash> | * check ssh connect: <code bash> | ||
ssh -p 2222 anhvc@192.232.218.215 | ssh -p 2222 anhvc@192.232.218.215 | ||
- | | + | </ |
* scp<code bash> | * scp<code bash> | ||
scp -P 2222 anhvc@192.232.218.215: | scp -P 2222 anhvc@192.232.218.215: | ||
scp -P 2222 anhvc@192.232.218.215: | scp -P 2222 anhvc@192.232.218.215: | ||
- | | + | </ |
===== 3.Import database and config to run web on DigitalOcean ===== | ===== 3.Import database and config to run web on DigitalOcean ===== | ||
==== Import database ==== | ==== Import database ==== | ||
* create database:< | * create database:< | ||
mysqladmin create babyshopvn; | mysqladmin create babyshopvn; | ||
- | | + | </ |
* Import database:< | * Import database:< | ||
mysql -f --default-character-set=utf8 -uroot babyshopvn < babyshopvn.sql | mysql -f --default-character-set=utf8 -uroot babyshopvn < babyshopvn.sql | ||
- | | + | </ |
==== config httpd ==== | ==== config httpd ==== | ||
=== check location of httpd config file === | === check location of httpd config file === | ||
Line 130: | Line 133: | ||
</ | </ | ||
</ | </ | ||
- | === Create | + | === create |
Create helloworld.php in / | Create helloworld.php in / | ||
<code php> | <code php> | ||
Line 191: | Line 194: | ||
* secure user:< | * secure user:< | ||
AllowUsers root anhvc | AllowUsers root anhvc | ||
+ | </ | ||
+ | * change usedns in sshd.conf< | ||
+ | UseDNS no | ||
</ | </ | ||
==== config php debug ==== | ==== config php debug ==== |
linux/digitalocean.1419735976.txt.gz · Last modified: 2022/10/29 16:15 (external edit)