Migrated my blog to a VPS

It was last week when my virtual host service ended. Instead of continue with the virtual host, I decided to upgrade and migrate my blog to a VPS. Here are the major steps you need to do to start a VPS hosting.

——————————————————–
LNMP
——————————————————–

1. Installing LNMP to your VPS server.
————————–
wget http://soft.vpser.net/lnmp/lnmp1.0.tar.gz
tar -xvf lnmp1.0.tar.gz
cd lnmp1.0
./ubuntu.sh 2>&1 | tee lnmp.log

You need to input your password for mysql root user right after started the installation.
Then you can have a drink, or watch a TV, while waiting for the installation to be finished, because it would be a long long time.

2. Configurating tht LNMP

1) Virtual host management
a) Add a new virtual host
./vhost.sh
Follow the prompt hint.
Add the domain name you want to bind. If you want to bind multiple domains, you can redo it, or just simply add them together with a BLANK seperated the domains.
Input the host directory for the domain(s).

b) Remove a virtual host
rm /usr/local/nginx/conf/vhost/YOUR-DOMAIN-NAME.conf

3) Install PureFTPd and FTP management console panel.
./pureftpd.sh
You need to input:
    Your MySQL's root user password.
    FTP management console password.
    MySQL ftp database password(Just press Enter, the system will generate a password for you automaticly).
After installed PureFTPd, navigate to http://YOUR-DOMAIN-NAME-OR-IP/ftp to start to manage your FTP server

If you ran into an error like this:
    Error: Table 'admin' from database 'ftpusers' doesn't exist.
    MySql error : Table 'ftpusers.admin' doesn't exist

You can go to phpmyadmin (http://198.211.33.14/phpmyadmin), run these scripts

    DROP USER 'ftp'@'localhost';
    DROP database ftpusers;

Then

wget http://rg4.net/p/vps/lnmp/ext/fix_pureftpd_mysql55.sh
./fix_pureftpd_mysql55.sh

If this still can not work for you, you can choose to not integrate pureftpd with mysql, and manage your ftp accounts with commands like these:
/usr/local/pureftpd/bin/pure-pw useradd ftp -u ftp -d /home/wwwroot
/usr/local/pureftpd/bin/pure-pw mkdb
You can visit http://bbs.rosoo.net/blog-3-8984.html for more details about this configuration for pureftpd.

4) Install eAccelerator
./eaccelerator.sh

5) Install ionCube
./ionCube.sh

6) Install imageMagick
./imageMagick.sh

7) Install memcached
./memcached.sh


4. LNMP direcotries
————————–

nginx: /usr/local/nginx
mysql: /usr/local/mysql
php: /usr/local/php
www root: /home/wwwroot/
Nginx log: /home/wwwlogs/

5. LNMP configuration files
————————–

Nginx: /usr/local/nginx/conf/nginx.conf
MySQL: /etc/my.cnf
PHP: /usr/local/php/etc/php.ini
PureFtpd: /usr/local/pureftpd/pure-ftpd.conf
PureFtpd MySQL: /usr/local/pureftpd/pureftpd-mysql.conf

6. Server status
————————–

LNMP status: /root/lnmp {start|stop|reload|restart|kill|status}
Nginx status: /etc/init.d/nginx {start|stop|reload|restart}
PHP-FPM status: /etc/init.d/php-fpm {start|stop|quit|restart|reload|logrotate}
PureFTPd status: /etc/init.d/pureftpd {start|stop|restart|kill|status}
MySQL status: /etc/init.d/mysql {start|stop|restart|reload|force-reload|status}

7. GUI
————————–

phpinfo: http://YOUR-DOMAIN-NAME-OR-IP/phpinfo.php
phpMyAdmin: http://YOUR-DOMAIN-NAME-OR-IP/phpmyadmin/
sniffer: http://YOUR-DOMAIN-NAME-OR-IP/p.php
PureFTP management: http://YOUR-DOMAIN-NAME-OR-IP/ftp/