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 www.lnmp.org 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
Mysql
PHPmyadmin
Zend Optimizer
E Accelerator
Pureftpd
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 www.ruchirablog.com/nginx/lnmp0.5.tar.gz

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

./centos.sh

If you are debian user run this command-

./debian.sh

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)

./eaccelerator.sh

And run this if you need ftp server-

./pureftpd.sh

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- http://www.ruchirablog.com/complete-nginx-setup-for-wordpress/

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
Ruchira
View all posts by Ruchira

Last 5 posts by Ruchira

  • Cathy

    I’m thrilled you took the time and wrote that :P

    -Regards
    Rodrigo

  • Todd Rowland

    Great writing, I have been looking for that :D

  • http://ovps.org Oliver

    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 vps.net

    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 vhost.sh – not sure if that on works yet, no index file added yet !

    After runnning the eaccelerator and pureftpd scripts, went to : http://ovps.org/ftp/install.php , 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/ (http://www.debiantutorials.com/pure-ftpd-with-mysql-backend/) 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…..
    Regards
    Oliver

    • http://www.ruchirablog.com Ruchira

      replied on email as you used contact form! :)

  • http://ovps.org Oliver

    Hi
    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/pure-config.pl: No such file or directory

    Thanks for yr comments

    • http://www.ruchirablog.com Ruchira

      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!

  • Matt

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

    • http://www.ruchirablog.com Ruchira

      thats simply not possible!

      • Matt

        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

        • http://www.ruchirablog.com Ruchira

          does it takes that much space right after install?

  • http://jawatankosongkini.com try

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

Previous post:

Next post: