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

[bash]wget http://freevps.us/downloads/nginx-centos.sh -O – |bash[/bash]

OR

[bash]wget http://www.comfortvps.com/script/shell/nginx/nginx-php-mysql.sh -O – |bash[/bash]

On CentOS 6

Run

[bash]yum -y install wget –noplugins
wget freevps.us/downloads/nginx-centos-6.sh -O – |bash[/bash]

Troubleshooting

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: [bash]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[/bash]
  • 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

[bash][[email protected] ~]# free -m
total used free shared buffers cached
Mem: 256 82 173 0 0 47
-/+ buffers/cache: 34 221
Swap: 256 1 254
[/bash]


About NhocConan

A super lazy guy who tries to write tech blog entries in English. He is lazy, so he can only write when he is in a good mood or when he is tired of coding.

Leave a comment

Your email address will not be published. Required fields are marked *