Nginx Autoinstaller
I have published article about my modified nginx auto installer about little over a year ago. Which can be found here. Which got somewhat famous and counted over 1000 installs. The framework which I was used was came from a chinese developer called licess and the framework now has been evolved a lot and now we can count it as fully fledged auto installer. It now includes latest nginx version ( Which lacked at the time which I modified the script to include the latest and greatest) . And also now it includes separately tweaked installers for debian, centos, and ubuntu, which I had on my modified installer since day one
So its nice to see that he baked 2 options which my modified installer had since day one.

This installer is extremely useful but its not popular in the international community since its written in Chines and no support provided on English. So with this post I just wanted to introduce that great tool to you guys and edit the original source code little bit to remove the time zone rewrites.
What I have removed
- Original installer rewrites the time zone to China. I have removed that so your original time zone will remain on the server.
All the credits must go to Licess at www.lnmp.org and you can donate him there. I take no credit for this and I’m just listing the installer here and I just wanted to provide some support for it in English, thats the moral of the post!
What does the installer include
- Nginx 1.0.10
- PHP 5.2.17
- Mysql 5.1.60
- PHPMyAdmin
- Eaccelerator (optional 1 click install)
- VsFTPd, PureFTPd (Optional 1 click install)
- PHP Suhousin Patch
- Memcached (optional)
- Zend Optimizer
install Instructions-
You can use debian/ubuntu/centos 32bit or 64bit. So login via SSH and issue these commands (you must be root user to install LNMP )-
1. Download the installer package-
wget -c http://www.ruchirablog.com/lnmp0.8-full.tar.gz
2. Decompress the install package-.
tar zxvf lnmp0.8-full.tar.gz
3. Go to install directory-
cd lnmp0.8-full /
4. Start installing-
For ubuntu – sh ubuntu.sh
For Centos – sh centos.sh
For Debian – sh debian.sh
It will ask some questions like your domain name , mysql root password ( Use your root password if you are newbie) just answer to them promptly.
It will take at least 30 minutes to fully install and then you will see a massage saying install completed. So then you can try navigating to your ip address to see it working.
After installation -
- PHPMyAdmin will be located on http://yourip/phpmyadmin
- Navigate to your url or ip and it will display a test page
1, install eAccelerator, execute the following command. / eaccelerator.sh , follow the prompts to select the version, press Enter, it will automatically install and restart the web service.
2, the installation of ionCube, execute the following command / ionCube.sh Enter to confirm, it will automatically install and restart the web service.
3, the installation imageMagick, execute the following command / imageMagick.sh Enter to confirm, it will automatically install and restart the web service.
4, install memcached, execute the following command / memcached.sh Enter to confirm, it will automatically install and restart the web service.
And a advantage of the new installer is you can upgrade nginx or php with just one shell command.
- To upgrade the nginx execute the following command:. / upgrade_nginx.sh It will prompt a thing which you need to enter the nginx version number. Its simply asking which version that you want to upgrade. So head over to http://nginx.org/en/download.html and find whats the newest nginx version and enter the number correctly on the shell prompt. For ex- 1.0.10 and press enter. its just easy!
- PHP upgrade, execute the following command:. / upgrade_php.sh prompted, enter your php version number, such as 5.3.6.
You can manage the LNMP by issuing these commands-
/root/lnmp {start | stop | reload | restart | kill | status}
- For example if you want to restart lnmp issue /root/lnmp restart
LNMP files will be located on
mysql: /usr/local/mysql
php: /usr/local/php
nginx: /usr/local/nginx
Site Directory: /home/wwwroot
How to add more domains (Virtual hosts) for this setup?
You can add more domains to your setup with easy steps. You just need to open your SSH client and type
./vhost.sh
And it will ask you which domain name to add also if you are setting up new domain for wordpress it can automatically add rewrite rules for your permalinks
Just answer for the questions when you run ./vhost.sh
Here are another guides for full LNMP 0.8 setup!
-
How to upload files to LNMP0.8 without SSH deamon
-
How to setup DNS to point your domain to LNMP0.8 server ip
So enjoy your server and please add a comment if you are happy with outcome!
PS- To keep in touch with updates (next releases) of this script you can subscribe to my email feed. No advertising or spam will be sent. You can unsubscribe at anytime! ![]()

{ 362 comments… read them below or add one }
← Previous Comments
Great installer
but
Need for margento!!
problem installing database connection error..
thats not a common error! Check your passwords! Database password is also the password that you supplied while installing. Also database administrator password is root on default!
its was innoDB mysql problem solve.
can you release with php 5.3.5
thank you
also APC + Memcache way better
LNMP 0.6 was out..but nothing new on that package..
for anyone who wants to upgrade the nginx version for lnmp, just try this:
wget soft.vpser.net/lnmp/upgrade_nginx.sh;sh upgrade_nginx.sh
./vhost.sh is not works properly.
Please write a tutorial ./vhost.sh and Domain panel, how to set that?
what is the problem that you getting?
needs lib-crypt and lib-mhash adding to the yum installs at the top of censos.sh
can you tell me what version of centos that you using?
5.5×86 64bit
its because the libmhash and libmcrypt links in your centos.sh script are 404′s
yum install libmhash-devel libmcrypt-devel
fixed it for me but you might want to fix those 404′s in the script
Thanks mate! Looks like someone removed those 2 files from my server because proper file permissions not set for those installation files. Now I have added permissions and 2 files.
Thanks again
this *should* fix all of the php not building comments.
for centos/rhel etc. not so sure about the other flavours
yes other using the same thing! Thanks again for pointing this problem!
sorry lib-crypt-devel and lib-mhash-devel
otherwise the build fails
Hello Kushira,
I have got the problem that many got here, the php not installing:
/usr/local/php/sbin/php-fpm: No such file or directory
How can i manually reinstall it
#more /etc/debian_version
6.0
Can i use apt-get install and which packages should i use ?
Thanks
Oops! I didnt had time to test this script with debian 6. Looks like it got problems. For now can you install debian 5 ( If you are using vps this will be easy) and after the installation update to debian 6? It will work for now. However Ill work on this to get it working with debian 6 but no ETA yet!
Thanks for mentioning this!
Thanks kushira for your fast response
But for example can you install nginx “manually” and then install php5 and with apt-get , whats the difference in installing with apt-get and the manually install ?
Greeting from france
Not much difference but with normal install you can have more custom with your choices while apt-get does predefined thing!
thank you for the auto installer
but when I go to mydomain.com/phpmyadmin and parsing .phpI got 502 Bad Gateway?
I’m using Debian 5 32bit
use debian 4 to install this and upgrade to debian 5 or 6 after installing. Or use ubuntu 10.04 which is same functioning as debian
hey, thanks for the great instructions. I have one small question. How do I get to the mysql console? I want to import a larger database that is to big for phpmyadmin.
when I try
mysql -u root -p mypass -h localhost databasename < sqlfile.sql
I get this error
bash: mysql: command not found
do you mind using bigdump? google it! very easy to use!
Hi Ruchira,
tis lnmp is running smooth on my wordpress with lowend traffic,
but when i tried to install in other box, wordpress with high traffic (400 online in the same time) it become slower and i get high load cpu from php-fpm.
can i see yout php-fpm setting for my example ruchira?
Thanks
give your server data before getting in to conclusion! I mean what are the specs of your server? And what are the mods you done to default php-fpm file?
it is xen vps with 512 memory..i only tried to incrase and decrase php max_children but still no change
Install memecached!
http://www.ruchirablog.com/memcached-wordpress/
http://www.ruchirablog.com/intergrating-memcached-to-wordpress/
There is no way 512MB handling 400 users at a time with wordpress fast like you expect if you not using memcached! Try memcached. if you have atleast 1000 posts you need to upgrade because your ram isnt much to handle memcached instance!
And if you are getting CPU loads less than 50% there is nothing to worry! Dont expect CPU loads to be like 0.1% when you have 400 users online at a time.
e1550 emi354638047593750
IMEI: 354638047593750
Entsperren / Unlock: 63729412
Flashen / Flash: 40798721
Upgrading to 10.10 breaks this, reloading lnmp I get “./lnmp: line 70: /usr/local/php/sbin/php-fpm: No such file or directory”. Also get a 502 on /phpmyadmin. Tried it 3 times.
actually I have tried upgrading to 10.10 months ago and nothing happened!
can you add xcache and memcached
Hello mate, great job with your script,
I have a question, I need to protect one of my folders with but can not find the
configuration sites-available , you can tell me where it is in debian or how to protect my folder htpassswd and file I have to change?
Cheers
hello sir,
i found this site through LEB discussion.
my question is, i have using LEB Nginx script. very easy to install wordpress.
my problem is, i can not install phpmyadmin.
i go to your script, i see phpmyadmin is support, but i dont see the command for installing wordpress.
how to install wordpress, do i need download wordpress installation?
thank you
you can download wordpress and use Filezilla to connect via SFTP and place wordpress files on the server! Its very very easy!
I keep on getting 502 Bad Gateway while trying to get into phpMyAdmin, clean Linode 512 VPS running Ubuntu 10.04.
Any ideas?
oops. Can you try using 9.04 and install LNMP then upgrade to 10.04? 10.04 isnt working because apt-get upgrade changed some files of old 10.04
Unfortunately Linode does not have Ubuntu 9.04. I might try Debian now.
just digged the linode manager and found that linode got 8.04
You can use it and then upgrade very easy to 10.04 LTS ! Im using Ubuntu 10.04 and I think its just small leap ahead of updates than Debian
502 Bad Gateway on Ubuntu 8.04…
thats really odd!
Hi, me again. I’ve tried With 8.04 again (after installing updates for it, but didn’t upgraded to 10.04) and the main domain I’ve used works (www.steamunpowered.com) but phpmyadmin still gives 502. The same goes for my other domain (www.stranded.eu).
What could be causing this? I’ve done everything according to the instructions…
this happens because some php libraries missing from the install! I need to investigate this problem and it takes time. Ill get in to it hopefully today and inform you!
My Web access to every number up to 200 people are often in very slow web online ask what I have to set parameters I had to install memcache
vps for my ram so I think 2GB chip I7 LNMP config somewhere by relatively low
hmmm I cant understand your comment!
I can increase my number to nginx to run faster when more people view site?
it will not do much difference if you dont have much CPU cores and RAM
ram 2Gb chip core I7 is enough?
whats your average simultaneous user amount? and do you getting any slow downs? Whats your web site?
whats your average simultaneous user amount? 100 – 200
and my site became very slow
502 Bad Gateway
please help me
i change fastcgi_pass unix:/tmp/php-cgi.sock to fastcgi_pass 127.0.0.1:9000;
is not work
why do you change that?
I think it will not lead to errors 502 Bad Gateway
Hello,
I’ve installed you’re Nginx Autoinstaller in a server 8 go of ram, double core of proc with debian 5 32 bits
It work fine, so thanks guy
I’ve tested it with debian 6 64 bits but the install was corrupted
I’ve just a little problem : the phpmyadmin isn’t installed How can I reinstall it properly please ?
If you got 8GB of ram why are you wasting your RAM? 8GB of ram doesnt supported by 32bit. PHPmyadmin got some problems. Please read other comments! you can try with ubuntu 9.04 or 10.04
The autoinstaller didn’t worked with the debian 6 64 bits. So I’ve tested with the debian 5 32 bits
I didn’t know that 32 bits don’t supported 8 go of ram : I’m confuse
how we can delete domain on nginx?
sorry for my bad english
its little bit complicated! But delete the files via SFTP and then delete the DNS entries on your domain! You wont get trouble!
hi ruchia
please Your email?
I want to ask you about Lnmp thanks
Hi, need to know how about installing php 5.2.17?
How can i update the PHPMyAdmin to latest version after setup of your script?
Also i need to update to latest Nginx as on Centos i got a very old version.
Thank you
error
./configure: line 30026: 6: Bad file descriptor
i installed it on debian 5
hi
how to update packages?
yum upgrade do not work!?
yum wont work on this as this install is a custom one! Yum will only work if we used yum to install files!
I installed on Centos 6 64bit is ok
but is possible to have the last version of all software
db mysql 5.5.
nginx 1.1.0
php 5.3.6
I use this to update nginx to 1.1.0
wget soft.vpser.net/lnmp/upgrade_nginx.sh;sh upgrade_nginx.sh
nginx: nginx version: nginx/1.1.0
=========================================================================
You have successfully upgrade from 0.7.67 to 1.1.0
=========================================================================
LNMP is tool to auto-compile & install Nginx+MySQL+PHP on Linux
But need to update mysql database
and php to last version
regards
did you do a good job.
@idglabs,
After nginx upgrade to 1.1 did you notice any improvements? have any issues?
Thanks.
The Debian/Ubuntu option is clearly broken. PHP is DoA.
CentOS works perfectly.
awesome work, but i am getting 404 errors on trying to download sqlite.bz2 file….. it has tried about 2 mirrors and not one seems to have that file
hmm did you tried lnmp.org mirror?
It seems broken now for Debian 5
Installed it several times last year with no issues but now it displays many errors like “./configure: line 17737 :5 :bad file descriptor ” and it hangs on “./configure: line 313 :5 :bad file descriptor”
anyone knows what’s up ?
Thanks.
yeah debian 5 latest updates might broke it! You can try http://www.lnmp.org auto installer. they have the newest one!
Thanks Ruchira, I really like your version tho
Are there any benefits or downfalls that you are aware of for running it on Centos insted of Debian?
Thanks.
absolutely no! There is no much difference. It depends on your flavor
I like Ubuntu most because its stable, easy to use, apt-get is really nice etc. http://www.ruchirablog.com/uptime.php
I’m running this blog on ubuntu 10.04 and you can see that im having nearly a year of uptime with it
Im having about 1500 visitors and 2000 page views a day and server load is not going beyond 2 on average! Which is really nice for XEN VPS with 512MB of ram.
But hey I have boxes running Centos too. and in my experience I found that centos cpu load is fluctuating than my ubuntu setups.
I guess I’ll try Centos since William reports that works still. I really would like to use Debian but have no choice unless it gets fixed or someone finds workaround.
hi ruchira, im trouble when i want to upload plugin, that need
Hostname
FTP Username
FTP Password
Connection Type
how to i configured this one??
thanks
you need to install FTP deamon to auto update and install plugins/themes/wordpress! You can search for guide to install FTP. Or you can go oldschool by manually upload updated plugins by overwriting old plugins! Thats what I do!
how do i configure the firewall?
# service iptables restart
give no result
#which iptables
/sbin/iptables
content of iptables seems not readable
how do i add rules if needed?
Once you’ve completed the steps in this post. Would you say that your server is secured enough for a Wordpress blog? I plan on switching to Linode and am considering using this as a tutorial to setting up my VPS. I was even thinking about dropping cPanel but I just fear for security.
The best example that you can see is this blog. If you need more security you can install more stuff additionally to this!
The script ran with no visible errors and phpmyadmin comes up properly. Was able to set up a database without any problems. This is our third attempt with setting up nginx on centos. This time we tried not to add a 2nd vhost, but rather place a magento install in the root to see if it would work. The enginx is installed page comes right up at http://96.45.117.141 but as soon as you visit http://96.45.117.141/index.php to load the install, it redirects to the install folder as it should, but then doesn’t show the index.php file, but a 404 instead. When you add the index.php to the url, the server returns “no input specified” http://96.45.117.157/index.php/install/index.php
I can not figure out what the problem is. This is directly following the auto-installer without modifying the conf file. Any insight would be greatly appreciated.
dude,
is it work on ns1. domain.com and ns2 ?
with godady we use dns manege and point ip to domain without host .
then this script will install dns with ns1 and ns2 of that domain ?
read my guide about dns! This will work fine on external dns setup!~
can we rename domain with ./vhost.sh ?i mean park doamin instead of add new domain
which works on /home/wwwroot NOT /home/wwwroot/domain.com
no you cant rename domains!
pureftp is in chinese language. How can I uninstall it?
arggg! Didnt saw that!
maybe there is a switch for language!
Hello,
i think a auto installer of nginx is a great thing. Thank you. I see after the installation your welcome screen, but I can not call phpmyadmin when i call 127.0.01/phpmyadmin oder locahost. I need your help (:
whats the error coming up?
liked this article Nginx Autoinstaller and i really don’t strive to be that individual… but i do believe maybe your blog could look a little bit better if you would have a litte red in it. Simply just my suggestion, truly appreciated the post otherwise
Thanks, Flyg Till Erbil
hahah nice dude
Ill consider this when I build next design
← Previous Comments