Upgrade from LNMP to LNMPA
By rockia on Apr 28, 2011 with Comments 23
I have been using LNMP (Linux Nginx MySQL and PHP) for a year and the way I set up using LNMP automatic shell compiler really allow me to spend more time on the actual blogging and not fighting with the server configuration.
If you happened to follow my blogging, you might have noticed that I didn’t really recommend you to do the update from version 0.5 to version 0.6 as nothing was really changed. However, this time, version 0.7 is out, I will strongly recommend you to make your server even better.
LNMPA (Linux, Nginx, MySQL, PHP and Apache), a.k.a LNMP 0.7, is an expansion base on LNMP, will handle most of the front-end jobs such as static pages, Javascript, pictures and etc., while Apache will handle most of the back-end dynamic pages. This will solve the “505 Page Error” problem while the server receive high traffic at the same moment and increase the server’s stability.
Default LNMP 0.7 software version:
Nginx 0.8.54
MySQL 5.1.54
PHP 5.2.17
PHPMyAdmin 3.3.7Note: Installer includes updater script for Nginx and PHP; that means you can choose your own version of Nginx and PHP release.
Installation of LNMPA
- Install LNMP following this guide: How to Set Up LNMP (Change version 0.4 to 0.6);
- Download the LNMPA: wget http://www.rockia.com/dl/lnmp0.7.tar.gz
- Unarchive the downloaded file, for example, we will do so in CentOS:
tar zxvf lnmp0.7.tar.gz - Navigate into the folder and run:
./apache.sh
This script will add Apache into your current LNMP build. - Once Apache is installed, you can run upgrade_lnmpa_php.sh
./upgrade_lnmpa_php.sh - The server upgrade should be done.
There is also upgrade_nginx.sh and upgrade_php.sh for you to upgrade the software version.
Just a note that the URL Rewrite is no longer base on Nginx, you should use Apache’s .htaccess to handle the URL rewrite.
Filed Under: Servers
hi,
/root/lnmp restart
Stoping LNMP…
Nginx program is stop
Shutting down php_fpm done
PHP-FPM program is stop
Shutting down MySQL. SUCCESS!
MySQL program is stop
Starting LNMP…
Nginx start successfully!
Starting php_fpm Failed loading /usr/local/zend/ZendOptimizer.so: /usr/local/zend/ZendOptimizer.so: cannot restore segment prot after reloc: Permission denied
. done
PHP-FPM start successfully!
Starting MySQL. SUCCESS!
MySQL start successfully!
/usr/sbin/setenforce 0
so i should instal lnmp 0.6 first then wget lnmp0.7.tar.gz then run ./apache.sh ?
or is it possible if i wget 0.7 then run ./apache.sh without instal 0.6 first??
No, you don’t need to install 0.6 first. 0.7 installer includes 0.6 already. Basically they are the same but version 0.7 includes a Nginx and PHP version updater with which you can install any version of Nginx and PHP you like.
Thanks for your reply Rockia,
one more question
if i’d like to add other domain,what command should i write? coz there is vhost_lnmpa.sh and vhost.sh
If you just install LNMP (Nginx only) then use vhost.sh. If you install apache as well, use the other one.
Hi and thanks for the script.
I’m getting a 502 Bad Gateway error after installing it.
My /root/lnmpa restart spits out the following:
httpd: Syntax error on line 343 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot open shared object file:
No such file or directory
/root/lnmpa: line 46: /etc/init.d/mysql: No such file or directory
MySQL start successfully!
What do I do?
The module isn’t there but I’m not sure how to fix it.
Thanks.
Nevermind the above comment. I reinstalled everything again and this time it works fine. I think some something was broken in the repository earlier.
This script is so awesome, thanks for improving lnmp installer
Btw its probably best to manually update phpmyadmin too after installing everything as there are several vulnerabilities in 3.3.7
Yes, jambers, this is a good call. I personally upgraded phpmyadmin as well.
Btw I just google translated this from the lnmp website and found out why it removes php-fpm for lnmpa:
“Using LNMPA better solution LNMP structure due to PHP-FPM 502 errors generated in the same time be able to provide a more secure multi-user multi-site environment.”
Do you know if upgrading to php 5.3.6 (w/ built in php-fpm) with lnmpa would be a good idea?
hi,
is this works well in centos6 64bit?
and i need only php 5.2.x not 5.3.
is there any opensource controlpanel
Sorry I haven’t test it on CentOS 6 yet, but should work.
In terms of the control panel, you can try Froxol but I personally just SSH to control the VPS.
I tested 0.7 on Centos 6 default-amd64
and I update php ,nginx but with error
./upgrade_lnmpa_php.sh: line 158: /usr/local/php/bin/phpize: No such file or directory
./upgrade_lnmpa_php.sh: line 159: ./configure: No such file or directory
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install’. Stop.
/etc/init.d/httpd: line 98: /usr/local/apache/bin/httpd: No such file or directory
=========================================================================
You have successfully upgrade PHP of LNMPA from to 5.3.6
=========================================================================
###########################################################################
./configure: error: C compiler gcc is not found
make: *** No rule to make target `build’, needed by `default’. Stop.
mv: cannot stat `/usr/local/nginx/sbin/nginx’: No such file or directory
cp: cannot stat `objs/nginx’: No such file or directory
./upgrade_nginx.sh: line 83: /usr/local/nginx/sbin/nginx: No such file or directory
make: *** No rule to make target `upgrade’. Stop.
Upgrade completed!
Program will display Nginx Version……
./upgrade_nginx.sh: line 87: /usr/local/nginx/sbin/nginx: No such file or directory
=========================================================================
You have successfully upgrade from ine 20: /usr/local/nginx/sbin/nginx: No such file or directory to 1.1.0
=========================================================================
LNMP is tool to auto-compile & install Nginx+MySQL+PHP on Linux
=========================================================================
###################################################################################
[root@vps ~]# /root/lnmpa start
=========================================================================
Manager for LNMPA V0.7 , Written by Licess
=========================================================================
LNMPA is a tool to auto-compile & install Nginx+MySQL+PHP+Apache on Linux
This script is a tool to Manage status of LNMPA
For more information please visit http://www.lnmp.org
Usage: /root/lnmpa {start|stop|reload|restart|kill|status}
=========================================================================
Starting LNMPA…
/root/lnmpa: line 37: /usr/local/nginx/sbin/nginx: No such file or directory
Nginx start successfully!
/etc/init.d/httpd: line 98: /usr/local/apache/bin/httpd: No such file or directory
/root/lnmpa: line 46: /etc/init.d/mysql: No such file or directory
MySQL start successfully!
error upgrade_php.sh: line 23
==============
./upgrade_php.sh: line 23: php: command not found
Current PHP Version:
You can get version number from http://www.php.net/
(Please input PHP Version you want):5.3.6
==================================================
You want to upgrade php version to 5.3.6
==================================================
Hi Rockia,
do you know how to run mysqltuner or tuning-primer on lnmpa??
i always failed and the password always wrong, even i log in as a root and can login to phpmyadmin with that password.
Thanks
I am sorry egi, I have never run mysqltuner or tuning-primer before.
Hi rockia,
i’m tryng to use https on my lnmpa box. how to configure that ?
notes on nginx i was succeed to install self sign certificate.
Hello, I have only tried signed certificate with LNMP setup, but not with lnmpa. Sorry I don’t think I can help you with this question.
Thanks for the script!
I’m using the lnmp 0.7 (no apache) with a wordpress installation and all works great, except I can’t get the vsFTPD to work nicely with wordpress updates or plugin installations. There always seem to be an error writing to or creating directories, that after trying all the possible user groups and permissions settings I’m still stuck with this.
Since you’re using wordpress on your site as well, did you experience the same problem? If so, how did you fix it?
Or what would you suggest is the best solution to get this working.
Thanks.
Hello Albi, if you are 100% sure about your permission is right. (In my case, I will need to run chown -R www:www /your/directory to fix it), then I suggest you check if you server is running at “safe_mode”. However, since you said your didn’t install apache, I guess that’s not really your problem. Let me know if you run the chown -R www:www to the directory can fix your problem first.
Thanks for sharing it worked!
But how do I remove (uninstall) everything when I don’t need it anymore in the future?
apt-get –purge remove lnmpa?
(I’m using the latest Debian)
When you unzip the downloaded package “lnmp0.7″, you can find the uninstall script located inside.