Nginx+Mysql+PHP-FPM Auto installer for centos 5 and debian

by Ruchira on October 2, 2010

Update- I have modified this script to use nginx latest version and the whole guide for complete web site including DNS setup can be found on here

Nginx lnmp

Nginx is become just easy for newbies. thanks for the Chinese developer Licess installing nginx+PHP-FPM+Eaccelarator+Mysql+Pureftpd is easy as 1 2 3. The developers site is its really glad to see that he is supplying this for free because these kind of developers really rare now a days.

So lets get started LNMP stands for Linux+Nginx+Mysql+PHP So if you have dedicated server or VPS just follow these instructions and setup your nginx server.

LNMP supports Centos 5.5 ( Will lnmp automatically update older centos by using “yum update” when installing) and Debian.

LNMP includes the following scripts

Nginx latest stable version 0.7.67
Zend Optimizer
E Accelerator
And provide support for single web site without manually modifying nginx.conf
Lets get started,

First you need to fireup your SSH client ( PUTTY)
2. Then lets download the source installation file from the developer site. Run this commands on your SSH client

wget -c

Its a tarball ( means compressed file) So wee need to uncompress that. So run this,

tar zxvf lnmp0.5.tar.gz

Then we need to move to the file directory

cd lnmp0.5

Downloading and preparing of the installation file completed. Then we need to run installation file based on your OS

If you are Centos user here is the command for you


If you are debian user run this command-


If run correct installer according to your OS now LNMP will begin to install the things I mentioned on top,

And it will ask you some questions like to enter your web site url. If you are running this for test just enter your server ip address. And it will ask for mysql root password. If you are newbie just provide your root password which you used to login to SSH and server!

The installer program will begin to install the programs now and it will take at least 20 minutes so be patient its working!

After installation it will provide you details about directory paths of nginx (You dont need to manually edit nginx.conf file if you provide the correct domain name which you need to use on the server when installing)

So its easy like that!

Wait you need to install eaccelerator and pureftpd after the installation finished. Just run this for eaccelerator if you need! ( I recommend installing it)


And run this if you need ftp server-


After installing you can access to installed modules by

phpinfo : http://your IP/phpinfo.php
phpMyAdmin : http://your IP/phpmyadmin/
Pointer : http://your IP/p.php

You can manage the server by issuing following commands

LNMP Server: /root/lnmp {start|stop|reload|restart|kill|status}
PureFTPd Server /root/pureftpd {start|stop|restart|kill|status}

If you want to check LNMP server status, just log into SSH, and then type in /root/lnmp status

Note that default commands to start,restart,stop modules will not work with lnmp ( “Service nginx restart” etc) but its not a problem! So go ahead and install nginx!

Update- here is how to setup lnmp for complete wordpress site-

I'm Ruchira Sahan and all posts on this blog are completely my thoughts and writings. I love DIY and Technology. So feel free to contact me for anything about this blog and don't forget to add a comment if this blog helped you! Thanks
View all posts by Ruchira

{ 11 comments… read them below or add one }

1 Cathy January 8, 2011 at 6:57 PM

I’m thrilled you took the time and wrote that 😛



2 Todd Rowland January 11, 2011 at 1:43 AM

Great writing, I have been looking for that 😀


3 Oliver January 25, 2011 at 7:33 AM

Hi Ruchira,
Thank you so much for scrpts and your response, here is an update, worked like a charm btw 🙂

Had Centos5.5 running initially, unfortunately the 5.4 version image comes with msql and some other preinstalled stuff, so went for a clean basic install of debian 5.0 (Lenny). This is at

Your install script, as said like a charm, so nginx, php and mysql up and running…GREAT ! thank you again.

Also added a domain wih – not sure if that on works yet, no index file added yet !

After runnning the eaccelerator and pureftpd scripts, went to : , all going very well, but stuck at step 6-7 because cant seem to locate the pure-ftpd.conf.sample and pureftpd-mysql.conf.sample files or their directory?

Looked in /usr/local/etc/ as sugested and in /etc/pure-ftpd/ ( but no such files/dir ?
Also did a : find / (for both the .conf and conf.sample files) but no such file or dir ?

Can you make suggestion as how to proceed please ?

Thanks in advance for your time and please let me know if I can do something in return for script and your assistance…..


4 Ruchira January 25, 2011 at 8:58 AM

replied on email as you used contact form! 🙂


5 Oliver January 25, 2011 at 8:56 AM

Found the conf files they where in /root/lnmp0.5/conf
Didnt realize needed to updatedb and use locate to find files……
so edited the files as instructed but when starting pureftpd :

Starting Pure-FTPd…
/root/pureftpd: line 25: /usr/local/pureftpd/sbin/ No such file or directory

Thanks for yr comments


6 Ruchira January 25, 2011 at 9:38 AM

Please dont use attached pureftpd as I said on email. Please use default vzftpd installation method that I mentioned in email to install ftpd if you really need ftp!


7 Matt April 6, 2011 at 11:25 AM

This is taking a lot of space of my VPS more than 1.85 GB!


8 Ruchira April 6, 2011 at 8:40 PM

thats simply not possible!


9 Matt April 7, 2011 at 2:56 AM

Yes I can prove that, I installed it on CentOS 5 32bit with 256 MB ram.I works perfectly but that was my only concern


10 Ruchira April 7, 2011 at 3:06 AM

does it takes that much space right after install?


11 try September 15, 2011 at 12:01 AM

Hi ruchi, Please give me how to installing LNMPA installer on centos?


Leave a Comment

Previous post:

Next post: