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 icon smile Nginx Autoinstaller   So its nice to see that he baked 2 options which my modified installer had since day one.

trans Nginx Autoinstaller

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 icon smile Nginx Autoinstaller Just answer for the questions when you run ./vhost.sh

new lnmp Nginx Autoinstaller

Here are another guides for full LNMP 0.8 setup!

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! icon smile Nginx Autoinstaller
 Nginx Autoinstaller

Enter your email address:
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
 Nginx Autoinstaller
Ruchira
View all posts by Ruchira

{ 378 comments… read them below or add one }

spam December 17, 2010 at 1:30 AM

if i have 2 or more domains and IPs, how to assign each domain to each IP, for example:
domain1.com => 1.1.1.1
domain2.com => 2.2..2.2
domain3.com => 3.3.3.3

thanks

Reply

Ruchira December 17, 2010 at 6:25 AM

thats little bit complicated! You need to configure your Linux OS for this. Please search google!

Reply

Marl December 17, 2010 at 10:39 PM

Hey mate, how do i remove an added domain? also the directory created, just an rm -rf?

Reply

Ruchira December 18, 2010 at 7:33 AM

yes just remove the directory if you want! There are more steps do completely delete the domain from nginx. But directory remove will be fine! :)

Reply

bayoewebid December 19, 2010 at 9:09 PM

hi there,
i’m succsesfully install your script, and having a wordpress site on my domain (vhost).

how i can have a folder without effect of wordpress rewrite permalink ?

i create a rules like this :
location /twitter/ {
rewrite “^/([^\.]*)$” /index.php?q=$1 last;
}

but it doesnt effect, always redirect to /index.php

Reply

Ruchira December 20, 2010 at 7:07 AM

you dont need to add any redirects if you add wordpress rewrites correctly? What are the lines that you added to nginx.conf to create rewrites?

Reply

john December 20, 2010 at 11:38 PM

I have no idea about this, i try to restart but in the end of report, error on line..

Reload LNMP…
Reload Nginx configure…
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
Nginx program is reloding!
Shutting down MySQL. SUCCESS!
Starting MySQL. SUCCESS!
/root/lnmp: line 70: /usr/local/php/sbin/php-fpm: No such file or directory

is it okay?

Reply

Ruchira December 21, 2010 at 12:27 AM

its not ok :( It means that php isnt installed successfully! Whats your OS?

Reply

Marl December 21, 2010 at 2:06 PM

I am getting this on Wordpress site when selecting an option inside the admin interface : “No input file specified. “, why? Actually, I had this site working (w/ no probs) but I transferred it to another server.

Reply

Ruchira December 21, 2010 at 8:55 PM

did you added permalink rewrites to nginx.conf?

Reply

Marl December 21, 2010 at 9:14 PM

Manually? No. But chosed wordpress rw on ./vhost.sh installer. Do have to do it manually?

Reply

Ruchira December 22, 2010 at 12:54 AM

can you access to your blog? and are you using permalinks?

Reply

Marl December 22, 2010 at 5:21 PM

Yes I can, and permalinks works fine. However the wp admin panel options gives that error whenever I access them.

Reply

Ruchira December 22, 2010 at 9:04 PM

actually that error happens when there is no such file! How many virtual hosts are there in your installation?

Reply

Marl December 22, 2010 at 11:55 PM

I think there are two, 1 using dabr and 1 wp. Do you think this happened because of I am using two vh? I also check on nginx/conf/vhost dir and the domain is there w/ a correct rewrite.

Reply

Ruchira December 23, 2010 at 12:17 AM

can please post here the /usr/local/nginx/conf/nginx.conf file here? open it via nano and copy the files paste to text upload the file somewhere and link it here! :)

Reply

bagus January 13, 2011 at 9:30 PM

have you solved this? I get the same error on my dashboard

john December 21, 2010 at 10:13 PM

working fine on Debian lenny..
but still have problem starting the pureftpd >.<

Reply

Ruchira December 22, 2010 at 12:55 AM

whats the problem? I personally dont recommend installing FTP deamon on your server because its very old protocol and you can always use SFTP tp transfer files without FTP.

Reply

Fahim Murshed December 22, 2010 at 8:13 AM

How to install mail server, Webmail and how to configure Google Apps (Google mail) from your script / Nginx Auto Installer? Please help me. I want to install Roundcube / Settings my domain on Google Apps mail.

Thank you for your Script.

Thanks also LNMP developer.

Reply

Ruchira December 22, 2010 at 9:07 AM

if you want to enable google apps (im using this too on this blog) it need to be done with your DNS provider! Once you have added MX records your are ready to go! Its easy!

Reply

Fahim Murshed December 22, 2010 at 9:20 AM

Main problem, My Domain provider is Uk2 Group / ResellBiz.

Another thing is, How to upgrade Wordpress Plug-in without FTP account.

Reply

Ruchira December 22, 2010 at 9:06 PM

there might be supplying free DNS for you check that out!
You can login to SFTP and upload the plugins to wordpress. you can download new plugin and upload it rewriting the old plugin. thats little bit time consuming but 99% secure than having FTP account! :)

Reply

null December 22, 2010 at 10:19 PM

suhosin enable but not in phpinfo and i run ./ioncube and ./eaccelerator same again not in phpinfo

i try reboot my VPS , /root/lnmp restart still not in phpinfo

Reply

Ruchira December 23, 2010 at 12:18 AM

suhosion must be installed on default and will appear in your php info file! Please link me to your vps ip and phpinfo page!
Thanks

Reply

nima December 23, 2010 at 12:33 AM

how can we use it only for ftp ? i mean without any domain ,,,, ,the problem is how create ftp user

Reply

Ruchira December 23, 2010 at 12:36 AM

FTP user creation is done on FTP deamon you can follow the guide to install FTP deamon and on that you can create FTP users.

Reply

null December 23, 2010 at 1:31 AM
Ruchira December 23, 2010 at 2:44 AM

IT seems like your vps failed to grab the sohusin or some kind of other problem! Can you do a reinstall? And whats your OS?

Reply

null December 23, 2010 at 2:55 AM

yes I tried reinstall 3 times same result

where I can set suhosin
I see in php.ini does not exist

Reply

null December 23, 2010 at 2:56 AM

my os debian

Reply

Ruchira December 23, 2010 at 3:56 AM

you can try installing suhosin but its not a must. Search google there are many reviews!

Reply

Dovy December 23, 2010 at 12:19 PM

How do I get PHP-LDAP working? I need to be able to run ldap_connect(). I am on Debian 5 and did an apt-get install php5-ldap but to no avail.

Any suggestions?

Reply

Ruchira December 23, 2010 at 8:41 PM

apt-get install on php wont work because php is installed on custom directory without apt-get so you can install it manually by specifying php directory! To be honest Ive never had experience with LDAP but you may find articles on installing it on google :)

Reply

Dovy December 23, 2010 at 11:46 PM

Actually I figured it out. I did do an apt-get install php5-ldap. Knowing that it wasn’t in use, I found the other version of PHP now installed and found specifically the modules in /usr/lib/php5/ I moved those files into the /usr/local/php/lib/php/extensions/ directory your script made and simply added those moved modules into my php.ini file and restarted LNMP. All is well that ends well. Thanks!

Reply

nima December 25, 2010 at 9:55 AM


Ruchira:

FTP user creation is done on FTP deamon you can follow the guide to install FTP deamon and on that you can create FTP users.

how can i find that guide ? sTNX

Reply

Ruchira December 25, 2010 at 2:26 PM

Google is your friend! :) Its very easy if you are using debian or ubuntu!

Reply

Fahim Murshed December 26, 2010 at 4:39 AM

Bro,
I am using Joomla this site- Gournadi.com

Now Nginx / LNMP is works nice. But i can’t enable .htaccess / re write mood on Joomla. Its not working. Thats why i cant short my URL. Please help.

Reply

Ruchira December 28, 2010 at 9:45 AM

htaccess wont work on nginx. but there is a rewrite method in nginx. Im using wordpress rewrites here on my blog but its different than apache htaccess you can search google for nginx drupal rewrites its possible to run drupal rewrites on nginx. :)

Reply

Fahim Murshed January 17, 2011 at 9:43 AM

Its works nice and super sonic speed web server :p

I am adding few command on nginx.conf

Thanks for suggestion.

Reply

Rifat Wahid Alif December 26, 2010 at 11:17 AM

Hi bro,
How to change Time Zone after install LNMP? Its not possible re install LNMP again, because my site is running.

Thanks for nice Script. Its helps Us.

Reply

Ruchira December 28, 2010 at 9:42 AM

whats your LNMP version and OS? :) of course its possible to change time zone you can google about this!

Reply

r3z4prof December 28, 2010 at 9:53 AM


john:

I have no idea about this, i try to restart but in the end of report, error on line..
Reload LNMP…
Reload Nginx configure…
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
Nginx program is reloding!
Shutting down MySQL. SUCCESS!
Starting MySQL. SUCCESS!
/root/lnmp: line 70: /usr/local/php/sbin/php-fpm: No such file or directory
is it okay?

i got this too ruchira, how must i do?? im using Ubuntu 10.04 i386 minimal T_T

Reply

Ruchira December 28, 2010 at 9:57 AM

try default OS without minimal. there should be some libraries missing on minimal

Reply

ruvs December 30, 2010 at 4:26 PM

Hi,

I install the LNMP script successfully (on CentOS 5.3), but I am getting a 502 Bad Gateway error when I try to access PHPmyadmin or any php scripts. What would be the issue here?

Thanks!

Reply

Ruchira December 31, 2010 at 7:18 AM

can you try this on centos 5.5?

Reply

nima December 31, 2010 at 9:25 AM

same problem for me on centos final ver 32bit

Reply

Ruchira January 1, 2011 at 8:51 AM

:( Sorry for that! Best bet is trying LNMP original installer on http://www.lnmp.org or try this with debian or ubuntu which gives your latest nginx version unlike centos version!

Reply

nima January 1, 2011 at 1:49 PM

i am not friend with debian .
can you tell me how can i wget and run installation?
just run wget and then:
./ubuntu.sh

as same as centos ?

Reply

Ruchira January 1, 2011 at 11:12 PM

yes of course. Use ./debian.sh on my script for debian use ./ubuntu.sh for ubuntu OS.

Reply

nima January 2, 2011 at 2:43 AM

-bash: wget: command not found
root@dlshowti:~# yum install wget
-bash: yum: command not found

Fahim Murshed January 17, 2011 at 9:47 AM

Nima,
Ubuntu Suks. Ubuntu grandfather is Debian so its my suggestion, try Debian. Its very good.

one things, before you install Ruchira Scrirp you must : apt-get update > after > apt-get upgrade

then download and Install Ruchira Script.

My http://www.Gournadi.com is run by this script from Joomla. Its run super fast.

Reply

Ruchira January 18, 2011 at 9:43 AM

actually you are wrong with this expression. Im running this on ubuntu and note that ubuntu gets many updates and there is huge developers on it. Also keep note that Ubuntu gives latest software packages than any other linux flavor.

Im running this on 512MB XEN guest and my host node runs on ubuntu too.

r3z4prof January 3, 2011 at 8:46 PM

hi ruchira, why my sqld process and php-cgi eat too much resource CPU??
please see this
http://img140.imageshack.us/img140/9291/myblogprocess.jpg

Reply

Ruchira January 3, 2011 at 9:57 PM

Are you using LNMP? Or something else? I can see that there is also BIND and some other stuff running. This doesnt seems like you are using LNMP RB

Reply

Damir-ElggFactory January 4, 2011 at 1:24 AM

hi Ruchira,

another great post.
I just installed the script and in process of getting DNS set up.

In the meantime how do I do redirect all to http://www.mysite.com . I think now without www it won’t work.

Thanks.

Reply

Damir-ElggFactory January 4, 2011 at 1:44 AM

Also one of domains has just propagated but when I go to address it displays your default page, saying it is installed. I check via SFTP and domain name directory is on there home/wwwroot/
What could be wrong?

Thanks.

Reply

Ruchira January 4, 2011 at 4:03 AM

Why do you think something is wrong? If you are seeing my default page it means its successful! All you need to do is delete my default page and start uploading your website to /wwwroot/ :)

Reply

Ruchira January 4, 2011 at 4:05 AM

when script requested to add your domain dont you entered http://www.mysite.com ? If not its fine too search google for non www to www redirect with nginx. Its easy!

Reply

Damir-ElggFactory January 4, 2011 at 11:18 AM

Ok, but I can’t find nginx directory in etc/ I’m looking for sites-enabled folder with my domain. Where is is located?

or do I edit something else?

Thanks.

Reply

Ruchira January 4, 2011 at 10:40 PM

well looks like you didnt read the post! Adding virtual hosts is very simple in this! just run ./vhost.sh command!

Reply

Damir-ElggFactory January 5, 2011 at 12:07 AM

I understand that but which file I need to add rewrite rule for non-www ?

Thanks.

Reply

Ruchira January 5, 2011 at 1:32 AM

No when adding the domain add it with www. then it will work fine!

Reply

Damir-ElggFactory January 5, 2011 at 11:23 AM

Where is nginx.conf located? it’s not in /etc/nginx/ like on lowendbox script.

and where do I put rewrite rules for individual domains?

Thanks.

r3z4prof January 4, 2011 at 7:05 AM


Ruchira:

Are you using LNMP? Or something else? I can see that there is also BIND and some other stuff running. This doesnt seems like you are using LNMP RB

yeah im using lnmp RB, but why too much eat resource?? can u help me ?:(
i also have been reinstalled that script, but still same

im using debian 32 bit

Reply

Ruchira January 4, 2011 at 7:26 AM

You arent using lnmp because I can see that there is BIND running and it doesnt even included with lnmp.

Reply

r3z4prof January 4, 2011 at 7:41 AM

okay, if you say im not using that script.
but look this again :(
http://img211.imageshack.us/img211/6488/weirdr.jpg

i dont know php-cgi instaleed or not, but that fact is like that. i just reload OS on my vps after that install your script(no install anything just (update and upgrade), and running my blog script again.

any chances to chat with you?? i want you to see my vps configuration.

just email your messenger to my email. thanks :)

Reply

Ruchira January 4, 2011 at 8:02 AM

Whats your OS and who is your VPS provider? Are you using centos install bundled with kloxo?

Reply

r3z4prof January 4, 2011 at 8:12 AM

im using debian 32bit, my vps provider are frantech.ca company. im not install anything, just OS reload, and then install your script

Reply

Ruchira January 4, 2011 at 11:53 PM

can you try ubuntu?

Reply

Armando January 5, 2011 at 6:39 AM

Hi Ruchira, i runed the script in my dedicated server, but there’s some issues. there’s a script for remove everything installed with nginx installer script?

Reply

Ruchira January 5, 2011 at 6:46 AM

uninstalling will be little bit hard if you are newbie for linux management! But you can stop the services without uninstalling everything by issuing the command /root/lnmp stop

Reply

Dovy January 5, 2011 at 3:18 PM

How about SSL? Do you configure it to work with that? I need the path to configure that. I have OPENSSL installed.

Also for some odd reason PHP mail wouldn’t work, but I used a SMTP library to send mail from the server instead. ;)

Reply

Ruchira January 5, 2011 at 8:43 PM

In default nginx is compiled with SSL module. Please search google about the detailed steps on SSL setup with nginx.
Yes for some reason original developer doesnt included php mail. In future versions Ill add it. But you can always trust SMTP and it will save you from blacklisting your ip :)

Reply

r3z4prof January 5, 2011 at 3:54 PM

i had been try using ubuntu/CentOS but still same.
for CentOS seems php-fpm not installed properly, i dont know what must i do.
i must talk to the provider about this??

Reply

Ruchira January 5, 2011 at 8:45 PM

Can you give me root access to your VPS and control panel so Ill check it out! If you want use my contact form to contact me with your vps login details!

Reply

egi January 6, 2011 at 9:19 AM

reza..
coba install paket yg dari lnmp langsung bukan yg dimodif sama ruchira..dulu saya bisa klo paket yg ini skarang saya jg gagal terus

Reply

Ruchira January 6, 2011 at 9:23 AM

English please! :)

Reply

egi January 6, 2011 at 9:16 AM

ruchira,
can you tell me how to set up a cron job on lnmp?
i need it to empty my lnmp logs automatically..
thanks

Reply

Ruchira January 6, 2011 at 9:21 AM

it depends on your os not on lnmp :P for example here is the guide to add cron jobs on ubuntu https://help.ubuntu.com/community/CronHowto like that you can find articles on centos :)

Reply

egi January 6, 2011 at 9:40 AM

Thanks Ruchira

Reply

Damir-ElggFactory January 7, 2011 at 9:07 AM

Ruchira,

Have you used eAccelerator with this?

If I install it and have problems, how would I disable or uninstall it?

Thanks.

Reply

Ruchira January 7, 2011 at 9:49 AM

Yes I have installed eaccelerator im 100% sure that you will never face any problems with it! Its very nice php caching plugin! Definitely install it! :)

Reply

Damir-ElggFactory January 7, 2011 at 11:25 AM

ok I’ll try it. It will be used with W3 total cache WP plugin. Thanks.

In case I do have issue how to disable/uninstall?

Thanks.

Reply

Damir-ElggFactory January 8, 2011 at 10:49 AM

Ruchira,

I installed eaccelerator that came with your script.
But it doesn’t seem to work.
According to http://eaccelerator.net/wiki/TroubleShooting , in tests it is not loading or working.

Is there anything else I need to do besides running ./Eaccelerator.sh command to get it working?

Thanks.

Reply

Ruchira January 8, 2011 at 9:55 PM

if you can see it on phpinfo file its working! You dont have to any additional things!

Reply

r3z4prof January 8, 2011 at 10:12 PM

@ruchira
when i click submit on your contact me form, seems error, and redirected to index page. i have been filled 2 times, but no changed, about my login details and request your messenger

thanks

Reply

Ruchira January 9, 2011 at 12:12 AM

I got your message! Looking in to it now!

Reply

Damir-ElggFactory January 8, 2011 at 11:14 PM

No it is not showing in phpinfo. Should I try installing full version via wget?
will that work with your script?

Or do you have any other suggestions.

Thank you.

Reply

Ruchira January 9, 2011 at 12:11 AM

actually its very strange that it didnt installed successfully! Can you give me the link to your phpinfo page? YEs you can try installing it manually its easy.

Reply

Damir-ElggFactory January 9, 2011 at 1:34 AM

here is the link
http://www.e-deal.info/phpinfo.php

It created eaccelerator-cache folder as well but nothing in it.

Thanks.

Reply

Ruchira January 9, 2011 at 1:49 AM

did you issued /root/lnmp restart
after installing it?

Reply

Damir-ElggFactory January 9, 2011 at 10:20 AM

yes I did.

Reply

Trazx January 12, 2011 at 3:32 PM

strange
I get the same error, where php doesn’t isntall.

I have ubuntu 10.04 on a zen operating system…

strange error…

Reply

Ruchira January 12, 2011 at 9:57 PM

Well, Install Ubuntu 9.04 and run the script! Then upgrade to ubuntu 10.04 by running apt-get upgrade :)

Reply

Trazx January 13, 2011 at 1:04 PM

managed to install it with new version (V0.5.1RB) the only thing is eacclerator was working but for some reason php.ini wasn’t being written to..so I had to manually add these lines to php.ini for eaccelerator to work.

[eaccelerator]
zend_extension=”/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so”
eaccelerator.shm_size=”1″
eaccelerator.cache_dir=”/usr/local/eaccelerator_cache”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”"
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”3600″
eaccelerator.shm_prune_period=”3600″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″
eaccelerator.keys = “disk_only”
eaccelerator.sessions = “disk_only”
eaccelerator.content = “disk_only”

Good luck to everyone and thanks ruchiara :)

Reply

bagus January 13, 2011 at 5:25 PM

Hi,
I’ve got problem when accessing wordpress dashboard pages..I always get “No input file specified.” error message…I’ve been looking for the solution using google but still no solution so far. Is it something to do with the permalink conf?
The blog was installed in vhost not as main web

Reply

Ruchira January 13, 2011 at 7:14 PM

yes it might be a problem with wrong permalinks!

Reply

atthila January 14, 2011 at 4:01 AM

can i translate your post in italian? i’ll give all credits to you!thanks

Reply

Ruchira January 14, 2011 at 5:02 AM

Im glad you asked this :) I can find many places that copied my posts without getting my permission! Yes feel free to translate it but kind enough to link my page! :)

Reply

atthila January 27, 2011 at 9:23 AM

hi ruchira, here the link to the article:
http://www.webnoob.it/2011/01/14/nginx-autoinstaller/

Reply

Ruchira January 27, 2011 at 7:40 PM

Thanks for keeping credits :) Guys like your type are hard to find these days! :)

Reply

egi January 15, 2011 at 12:09 PM

Ruchira, i think i need your help…
everything was normal for the last 2 months..but something happened today
i got 502 Bad Gateway and i found this in my nginx_error.log

2011/01/15 17:55:35 [emerg] 24393#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2011/01/15 17:55:35 [emerg] 24393#0: bind() to 0.0.0.0:8011 failed (98: Address already in use)
2011/01/15 17:55:35 [emerg] 24393#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2011/01/15 17:55:35 [emerg] 24393#0: bind() to 0.0.0.0:8011 failed (98: Address already in use)
2011/01/15 17:55:35 [emerg] 24393#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2011/01/15 17:55:35 [emerg] 24393#0: bind() to 0.0.0.0:8011 failed (98: Address already in use)
2011/01/15 17:55:35 [emerg] 24393#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2011/01/15 17:55:35 [emerg] 24393#0: bind() to 0.0.0.0:8011 failed (98: Address already in use)
2011/01/15 17:55:35 [emerg] 24393#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2011/01/15 17:55:35 [emerg] 24393#0: bind() to 0.0.0.0:8011 failed (98: Address already in use)
2011/01/15 17:55:35 [emerg] 24393#0: still could not bind()

hope you can help me to solve this

Reply

Ruchira January 15, 2011 at 8:50 PM

what are you running in port 8011? Did you modified ports on nignx.conf?

Reply

egi January 17, 2011 at 11:15 AM

no i haven’t made any changes in nginx.conf
when i check i got this …
PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 3402/mysqld
tcp 0 0 0.0.0.0:8011 0.0.0.0:* LISTEN 5121/nginx
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN 3156/memcached
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 5121/nginx

is that mean that nginx work on port 8011 and 80 ??
in my nginx.conf only only listen to port 80
server
{
listen 80;

Reply

egi January 17, 2011 at 12:20 PM

please remove my previous comment..has been fixed, it listen in my vhost.conf
another question is i always see this error in my log..

2011/01/17 18:22:35 [crit] 29977#0: *4962 connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory) while connecting to upstream, client: 38.107.163.161, server: http://www.xxxx.com, request: “GET /url/blablabla.html HTTP/1.1″, upstream: “fastcgi://unix:/tmp/php-cgi.sock:”, host: “www.xxxxxx.com”

but the php-cgi.sock file is exist..i’m using debian

Reply

bagus January 16, 2011 at 6:44 PM

hi Ruchira,

how to redirect our website (on vhost) permalink from www to non www
I tried using
if ($host = ‘domain.com’ ) {
rewrite ^/(.*)$ http://domain/$1 permanent;
}
in my domain (vhost) conf file but it keep redirecting to my main domain (different domain on wwwroot folder)

Reply

Ruchira January 17, 2011 at 5:50 AM

this problem is happening because wrong DNS setup! Check your second domain DNS config search google for more details about nginx multiple vhosts on same ip!

Reply

Damir-ElggFactory January 17, 2011 at 12:12 PM

Ruchira,

is there a way to configure this script to use TCP port instead of php.sock ?
What files need changing?

Thanks.

Reply

Ruchira January 18, 2011 at 9:46 AM

actually why do you want to change that? You wont see much difference on that on Linux systems.

Reply

Damir-ElggFactory January 18, 2011 at 11:12 AM

I need it to run social network script that uses it’s own page handlers. It requires special rewrites and I tried it with php.sock and get no file specified error on certain pages.

Thanks.

Reply

Ruchira January 18, 2011 at 10:27 PM

I dont think changing to TCP socket will work for you but im not 100% sure! How did you found that moving to TCP socket in nginx will fix your problem?

Reply

Damir-ElggFactory January 18, 2011 at 10:39 PM

I’m not sure it will fix it but the only rewrite example I found uses fcgi pass through TCP port.
I guess I could install stock Nginx and php, mysql but I was trying to save some time using your script.

Reply

Damir-ElggFactory January 17, 2011 at 2:50 PM

Ruchira,

just install fresh on 512MB vps and when I import database in phpMyAdmin I get “504 Gateway Time-out” error?

Any thoughts?

Reply

Ruchira January 18, 2011 at 9:41 AM

increase your keep-alive timeout limit if your upload takes too much time!

Reply

bilal January 20, 2011 at 11:21 AM

hello, Ive tried bith centos.sh and debian.sh
It installs fine, but when I access /phpmyadmin ,it says 502 bad gateway.
please help,im on centos 5.5

Reply

Ruchira January 20, 2011 at 9:26 PM

thats common problem happening because of library mismatch with new versions of centos! Can you use centos 5.4 to install and then upgrade to 5.5? Or use ubuntu 10.04 its much better!

Reply

frean January 20, 2011 at 2:02 PM

not working, php files not open

Reply

JaRo January 22, 2011 at 5:43 PM

Thanks man! It’s pretty awesome :) Full automatic installation – that’s what I love :D

Reply

Ruchira January 22, 2011 at 9:24 PM

kudos! :)

Reply

Oliver January 26, 2011 at 2:04 PM

Hi Ruchira,
Thanks for autoinstaller and additional help, thanks to your script and kind assistance have my first two Wordpress sites up and running. I will be starting to port other sites to my new VPS in the comming weeks, after doing some more testing. The vhost script is going to come in very handy, as I have quite a few domains to manage and move. Should be a Doddle now ! :)
Thanks again !

Reply

Zarafolas January 30, 2011 at 8:09 AM

Do you know How could I replace a php-cgi installation (made with lowendbox.com/blog/wordpress-cheap-vps-lowendscript) with php-fpm using your script ? if yes, after doing it Could I normally install eAceccelerator using your script?

Reply

Ruchira January 31, 2011 at 7:20 AM

well its easier to use my script than modifying and mixing it together! If you want to run my script on lowendbox just lower the php max child value after installing! I have tested my script with 80MB XEN from quickweb and loadimpact doesnt even make a blip!

Reply

Jacqueline January 31, 2011 at 10:18 AM

This is exciting. I’m going to try this script right now on my test vps. NGINX configuration is the biggest hurdle I have from making the switch from a shared hosting provider to a real VPS. Thanks for posting.

Reply

bayoewebid February 7, 2011 at 4:03 AM

hi ruchira,
can we login as wwwroot instead of root ?

Reply

Ruchira February 7, 2011 at 8:09 AM

No it doesnt have proper privileges !

Reply

Nnyan February 15, 2011 at 7:56 AM

Just noticed that LNMP has been updated to 0.6, not sure the benefits to it though. I wanted to know if it was possible to have the script use the latest versions of Nginx and PHP (as an option).

Reply

Ruchira February 15, 2011 at 10:00 AM

Some options like Ubuntu specific installer package is already enabled in my modified version since i released it so its nothing new. Difference is he released nginx upgrade script which is little bit useless at this time because LNMP RB runs 0.8.53 but it will be very helpful for centos users and all users in future. So Ill test official LNMP 0.6 briefly and make any necessary changes to my modified release!
All the credits goes to Liccess at http://www.lnmp.org without him this kind of all in one nginx auto installer script wont be possible for now. :)

Reply

Nnyan February 21, 2011 at 10:50 AM

Ruchira,

Awesome! Iove how responsive you are to requests. I had another question, I was reading this article (http://serversreview.net/latest-stable-version-nginx-0-8-54-with-php-5-3-5) and was curious about the 50mb decrease in memory by using php-cli vs php-fpm. Is there also a performance advantage one way or another?+

Sorry for the double post below not sure what happened.

Reply

Ruchira February 21, 2011 at 5:15 PM

404 Not Found

The server can not find the requested page:

serversreview.net/latest-stable-version-nginx-0-8-54-with-php-5-3-5 (port 80)

Please forward this error screen to serversreview.net’s WebMaster.
Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at serversreview.net Port 80

;)

php-fpm is new method of managing php instances and it will be definitely fast than cli. But if you are using a low end box like 80MB RAM CLI is for you. Dont try to squeeze all in to small amound of memory because its useless. try to full use the available memory!

Reply

Nnyan February 22, 2011 at 11:47 AM

Thanks for the info! I sent an email to the webadmin and website is back up.

Reply

Nnyan February 15, 2011 at 11:40 AM

LNMP has been updated to 0.6 any improvements worth noting? Also can we manually upgrade php and nginx to the latest and will doing that mess anything up?

Reply

Bayu February 17, 2011 at 4:20 AM

Hello, i just curious whether there’s any problem with phpmyadmin and suhosin in this autoinstaller, because suhosin setting must be done carefully to make phpmyadmin works perfectly, thank you.

Reply

Ruchira February 17, 2011 at 5:01 AM

No nothing is problematic! Next time commenting be sure to use your name not urls! I found your comment on spam queue!

Reply

Nnyan February 21, 2011 at 10:55 AM

I was playing around with some tweaks after installing your script and I messed a minor detail up. afterwards it was easier to just run your script again. Unfortunately when I did I ran into a number of erros during the install. I ended up having to re-install the OS template and run the script again.

Also, any possibility of adding remote vps setup? I would love to run this script from a central VPS and have it reach out (in batch mode fashsion) to a number of other VPS’s and set them up.

Reply

Ruchira February 21, 2011 at 5:16 PM

well currently remote setup is impossible. but if you play around bash scripts you maybe able to create it ! :)

Reply

Leave a Comment