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 https://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!
{ 30 comments… read them below or add one }
Excellent work!
I installed it this after noon and it works just fine. I already updated ngix to 1.0.11 and installed imageMagick.
You may want to consider an upgrade stript for phpMyAdmin (or do a post on how to upgrade it?). I’m going to use some Google Fu to figure out how to upgrade from 3.4.8 to 3.4.9.
Other than that, anyone and everyone should use this, nice work!
I have 1 remark:
you use capitals in the for the .sh files that install memcached and the other plugins however these files do not have capitals when installed on the server; you should change this. Also, write down that these files are located in the original install folder that we extracted in step 2.
Furthermore; Could you help me out setting up permalinks on this setup? And how can I make the ftp work with wordpress?
To answer my own question:
1. cd /usr/local/nginx/conf
2. nano nginx.conf
3. Add the following code (@ server before other location):
location / {
root /home/wwwroot;
index index.php index.html index.htm;
# permalink wp
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
break;
}
}
4.save this file
5. /etc/init.d/nginx stop
6. /etc/init.d/nginx start
7. change permalink in wordpress
1. About the capital problem. Did you got any problems if you use capitals? ex- Memcached.sh ?
Yes, there is no file in the lnmp0.8-full / with the exact same capitals as you use instead one should use the following commands
1. cd lnmp0.8-full /
2. bash eaccelerator.sh
3. bash imageMagick.sh
4. bash ionCube.sh
5. memcached.sh
Should also be bash memcashed.sh @step 5
What about the ftp in wordpress problem btw?
well personally I dont use FTP as I use SFTP which is much secure! however if you prefer automatic updates on admin panel it will be painful. Actually original installer includes FTP deamon auto installer but I havent had luck with it so I didnt included it on the my guide. However I hope to test it very soon and then ill update my post!
meanwhile use this- https://www.ruchirablog.com/upload-files-without-ftp/
Seacure 🙂
fixed sorry 🙂
I have problems with getting access to my /home/wwwroot/ directory, i cant paste something in there, please help me!
Greetings Thomas
what do you mean?
I cant paste any files to my wwwroot directory, the access is denied, i cant understand it!
Hi I tried to install it but I got this error
p.php
Download new nginx init.d file……
–15:22:34– http://soft.vpser.net/lnmp/ext/init.d.nginx
Resolving soft.vpser.net… 96.44.153.111
Connecting to soft.vpser.net|96.44.153.111|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 1483 (1.4K) [application/octet-stream]
–15:22:36– (try: 2) http://soft.vpser.net/lnmp/ext/init.d.nginx
Reusing existing connection to soft.vpser.net:80.
HTTP request sent, awaiting response… 416 Requested Range Not Satisfiable
The file is already fully retrieved; nothing to do.
ubuntu.sh: line 464: update-rc.d: command not found
ubuntu.sh: line 465: update-rc.d: command not found
ubuntu.sh: line 466: update-rc.d: command not found
ubuntu.sh: line 473: /etc/init.d/mysql: No such file or directory
Starting php_fpm /etc/init.d/php-fpm: line 61: /usr/local/php/bin/php-cgi: No such file or directory
failed
===================================== Check install ===================================
Error: /usr/local/nginx not found!!!
/usr/local/php [found]
Error: /usr/local/mysql not found!!!
========================== Check install ================================
Sorry,Failed to install LNMP!
Please visit http://bbs.vpser.net/forum-25-1.html feedback errors and logs.
[root@server1 lnmp0.8-full]#
waiting for reply thanks
whats your os version?
Hi Ruchira,
I already have your older LNMP0.5 installed, is there a way to upgrade that to this new version?
How to go about that?
Thanks.
sorry upgrade isnt possible with 0.5 🙁 its possible but not simple! If something goes wrong your installation will end up not working!
Hello
Maybe you can add screen command in order when internet connection broken, installation still run on VPS.
that will be a separate guide 🙂
hi Ruchira,
how to upgrade php-fpm to php-fpm 5.3.9 on centos?
i got this error when i want upgrade to 5.3.9,
phpinfo show me using php 5.2.17.
when i want upgrade, it show;
Current PHP Version:5.3.9
You can get version number from http://www.php.net/
(Please input PHP Version you want):5.3.9
Error: The upgrade PHP Version is the same as the old Version!!
restart the services or the server and try again!
Can you make a more detailed tuto about installin vsftpd?
i allways get this:
500 OOPS: could not bind listening IPv4 socket
Hi I’m getting this error:
/root/lnmp: line 47: /usr/local/php/sbin/php-fpm: No such file or directory
/usr/local/php is there, but not the sbin folder.
Any clues?
I’m on Ubuntu server..
Any chance we will see an upgrade script for PHP 5.4 and MySQL 5.5? The performance boost of these two alone is worth the upgrade specially when memory is at premium.
htaccess need to run on nginx as I do?
Hey Ruchira.
I went into a problem when i tried to restart LNMP by using : /root/lnmp restart
After that it just hang at : Stoping LNMP…
if its a vps you can always restart it, or kill the processes from TOP
after wget -c https://www.ruchirablog.com/lnmp0.8-full.tar.gz
i see: error 404: file not found.
ubuntu on parallels. internet connection works fine and i enter wget -c https://www.ruchirablog.com/ it’s successfully download index.html
i found the problem. i just should use Inmp0.9 in the name! 🙂
I have finishied instal LNMP on my vps using centos 6 32bit, everything going on smoothly until installation finished.
but after that, i’m going to acces phpmyadmin at: http://myipaddres/phpmyadmin
it asked username and password, then i typed user as root and the pass which i already set during the installation process, but it said “#2002 Cannot log in to the MySQL server”
could you please help me what is the problem?
is it mean that phpmyadmin installation process not completed?
It looks like you have forgot the password 🙂