Install Nginx + PHP-FPM + MySQL on Low-end CentOS server
There are many good low-end VPS provider over there with low cost, such as RamNode providing $2/month for their 128mb VPS, so the question is how can we do on a low-end CentOS server? Well, the answer is: you can run many websites on it with some tweak configurations. Let’s discover how to do this.
On CentOS 5
Run
wget http://freevps.us/downloads/nginx-centos.sh -O - |bashOR
wget http://www.comfortvps.com/script/shell/nginx/nginx-php-mysql.sh -O - |bashOn CentOS 6
Run
yum -y install wget --noplugins
wget freevps.us/downloads/nginx-centos-6.sh -O - |bashTroubleshooting
There might be some problems after the installing.
- If mysqld service cannot start due to the bug of no mysql user, run the post-installation scripts as follows:
groupadd -g 89 mysql &>/dev/null useradd -u 89 -g mysql -d /var/lib/mysql -s /bin/false mysql &>/dev/null /usr/bin/mysql_install_db --user=mysql --basedir=/usr chown -R mysql:mysql var/lib/mysql &>/dev/null - If you cannot access mysql due to root password, remember to reset mysql root password.
Well, finally, this is my server status after these installations
[root@backup ~]# free -m
total used free shared buffers cached
Mem: 256 82 173 0 0 47
-/+ buffers/cache: 34 221
Swap: 256 1 254