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:13] – [Moving web from hostgator to DigitalOcean] 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 ====== | ||
- | ===== create swap file for your linux server | + | |
+ | ===== 1. Install missing components on DigitalOcean ===== | ||
+ | ==== install basic packages ==== | ||
+ | <code bash> | ||
+ | yum install vim mc man telnet | ||
+ | </ | ||
+ | ==== 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 33: | Line 39: | ||
sudo sysctl -w vm.swappiness=10 | sudo sysctl -w vm.swappiness=10 | ||
echo vm.swappiness = 10 | sudo tee -a / | echo vm.swappiness = 10 | sudo tee -a / | ||
- | </ | ||
- | ===== 1. Install missing components on DigitalOcean ===== | ||
- | ==== install basic packages ==== | ||
- | <code bash> | ||
- | yum install vim mc man telnet | ||
</ | </ | ||
==== mysqld ==== | ==== mysqld ==== | ||
Line 59: | Line 60: | ||
</ | </ | ||
- | ===== 2. copy data from hostgator to Digitalocean ===== | + | ===== 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 71: | 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 131: | Line 133: | ||
</ | </ | ||
</ | </ | ||
- | === Create | + | === create |
Create helloworld.php in / | Create helloworld.php in / | ||
<code php> | <code php> | ||
Line 192: | 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.1419736394.txt.gz · Last modified: 2022/10/29 16:15 (external edit)