Upgrade from LNMP to LNMPA

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

Note: Installer includes updater script for Nginx and PHP; that means you can choose your own version of Nginx and PHP release.

Installation of LNMPA

  1. Install LNMP following this guide: How to Set Up LNMP (Change version 0.4 to 0.6);
  2. Download the LNMPA: wget http://www.rockia.com/dl/lnmp0.7.tar.gz
  3. Unarchive the downloaded file, for example, we will do so in CentOS:
    tar zxvf lnmp0.7.tar.gz
  4. Navigate into the folder and run:
    ./apache.sh
    This script will add Apache into your current LNMP build.
  5. Once Apache is installed, you can run upgrade_lnmpa_php.sh
    ./upgrade_lnmpa_php.sh
  6. 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

Tags:

RSSComments (23)

Leave a Reply | Trackback URL

  1. eliza says:

    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!

  2. eliza says:

    /usr/sbin/setenforce 0

    :)

  3. egi says:

    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??

    • Rockia says:

      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.

      • egi says:

        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

  4. Albi says:

    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.

    • Albi says:

      Nevermind the above comment. I reinstalled everything again and this time it works fine. I think some something was broken in the repository earlier.

  5. jambers says:

    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

    • Rockia says:

      Yes, jambers, this is a good call. I personally upgraded phpmyadmin as well.

      • jambers says:

        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?

  6. anil says:

    hi,

    is this works well in centos6 64bit?

    and i need only php 5.2.x not 5.3.

    is there any opensource controlpanel

    • Rockia says:

      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.

  7. Idglabs says:

    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!

  8. Idglabs says:

    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
    ==================================================

  9. egi says:

    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

  10. bayoewebid says:

    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.

  11. Albi says:

    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.

    • Rockia says:

      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.

  12. Tom says:

    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)

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.