Recommended VPS Complete list of best VPS hosting providers.

Quickest Easiest Way To Install LNMP Stack on CentOS and Ubuntu

Install Nginx, PHP, MySQL on CentOS and Ubuntu Easier with Auto Installer script – In this page I will tell you how to build Linux, Nginx, MySQL, and PHP on either CentOS or Ubuntu in much easier quicker way with the help of Nginx Auto Installer script by Ruchira. Previously I also posted how to the same thing using Tuxlite, an auto installer script for Ubuntu to get either Apache or Nginx installed easily. What’s the differences? Tuxlite is able to install Apache or Nginx (your choice) along with PHPMyAdmin, Varnish Cache, and WordPress while this new one is Nginx-only auto installer along with PHPMyAdmin, Eaccelerator, PureFTPd, VsFTPd, PHP Suhousin Patch, Memcached and Zend Optimizer. You can use it on debian/ubuntu/centos 32bit or 64bit.

How to Use Nginx Auto Installer?

Step 1 – Login to your server and follow my previous guide about Basic setup for CentOS or Ubuntu before you build a live web server. You may and may not follow that tutorial but if you followed, it will give you some basic security tweak to your server.

Before you proceed to the next steps, it is better to explain that all commands in this tutorial are written without the “sudo” prefix. However if you disabled root login and you logged in using another username with root privilege, you can add the “sudo” prefix all by your self. Alternatively you can simply type su, hit Enter and type in your password twice to switch login as root.

switch-root-login

You may also need to type this command to go to the root directory:

cd ~

Step 2 – Now download the NGINX Auto Installer package using the wget command:

wget -c http://www.ruchirablog.com/downloads/lnmp0.9-full.tar.gz

screenshot:

2

Step 3 – Now unpack that package with this command:

tar zxvf lnmp0.9-full.tar.gz

Step 4 – Then go to that  folder:

cd lnmp0.9-full

screenshot:

extract script

Step 5 – Finally, issue the magic command syntax to install the script:

For Ubuntu OS

sh ubuntu.sh

For CentOS:

sh centos.sh

For Debian:

sh debian.sh

In this guide I use CentOS 6.4 32-bit.

Step 6 – You’ll be asked some questions during install. Just answer them properly but make sure you know/remember with your answer (e.g: mysql root password, etc).

install

Upon hitting the last Enter key the installation process will begin. Just wait till it finishes.

install process

Step 7 – Once done you’ll see this:

done

You can test it on your browser by typing domain name or ip address and you’ll see its test page:

nginx test page

F.A.Qs

LNMP files will be located on:
– mysql: /usr/local/mysql
– php: /usr/local/php
– nginx: /usr/local/nginx
– Site Directory: /home/wwwroot
– PHPMyAdmin will be located on http://yourip/phpmyadmin

Post Install

1How to install eAccelerator:

/eaccelerator.sh

2How to install IonCube:

/ionCube.sh

3How to install imageMagick:

/imageMagick.sh

4How to install MemCached:

/memcached.sh

5How to upgrade Nginx to latest version:

/upgrade_nginx.sh

6How to upgrade PHP to latest version:

/upgrade_php.sh

7How to add more domains (virtual hosts):

./vhost.sh

Enjoy..

8 Comments

Add a Comment

Your email address will not be published. Required fields are marked *

Get more stuff like this
in your inbox

Subscribe and get interesting stuff plus faster updates to your email.