How to use OneinStack to deploy LEMP/LNMP/LAMP on VPS

LEMP stack is another most setup of a server or a virtual private server (VPS) besides LAMP. LEMP (or LNMP) stands for Linux, Nginx, MySQL and PHP.It’s a web server that can server millions of visitors a day with no single blip.

In today’s post I’ll show you how to build a working CentOS/Redhat Debian and Ubuntu VPS to host websites using Nginx Or Apach including steps how to install  full LNMP stack.This guide will make use of OneinStack, a LEMP (Linux, Nginx, MariaDB MySQL & PHP-FPM) web stack installer.

How to use OneinStack to deploy LEMP/LNMP/LAMP on VPS

Prerequisite

1.A server (VPS / Dedi) :

  1. Linode VPS Review-How to Create a Linode Server
  2. RamNode VPS Review-Cheap KVM and SSD VPS Starts at $3.50/mo

2.A knowledge on:

  1. How To Install LEMP on Debian & Ubuntu (Linux, nginx, MySQL, PHP,PHPMyAdmin)
  2. How to test VPS Speed and Performance? Install and Run UnixBench & sysbench

What is OneinStack?

This script is written using the shell, in order to quickly deploy LEMP/LAMP/LNMP/LNMPA(Linux, Nginx/Tengine/OpenResty, MySQL in a production environment/MariaDB/Percona, PHP), applicable to CentOS 5~7(including redhat), Debian 6~8, Ubuntu 12~16 of 32 and 64.

Github:https://github.com/lj2007331/lnmp

What is OneinStack?

OneinStack Features

Many Shared Hosting users worry about complexity of setting up and managing a VPS.What OneinStack does is automating most common configuration of server for web hosting. It helps newbies to setup a working server to host their website, blog or forum easily and quickly .

1
2
3
4
5
6
7
8
9
Database versions (MySQL-5.7, MySQL-5.6, MySQL-5.5, MariaDB-10.1, MariaDB-10.0, MariaDB-5.5,Percona-5.7, Percona-5.6, Percona-5.5)
PHP versions (php-7, php-5.6, php-5.5, php-5.4, php-5.3)
Provide Nginx, Tengine, OpenResty
Providing a plurality of Apache version (Apache-2.4, Apache-2.2)
PHP Cache Accelerator: ZendOPcache, xcache, apcu, eAccelerator. 
PHP encryption and decryption tool: ionCube, ZendGuardLoader.
Installation Pureftpd, phpMyAdmin.Install memcached, redis .
Providing add a virtual host script, include Let's Encrypt SSL certificate
Provided under HHVM install CentOS 6,7

How to install Oneinstack ?

For CentOS/Redhat:

1
2
3
4
5
6
yum -y install wget screen   // For CentOS / Redhat
wget http://mirrors.linuxeye.com/lnmp-full.tar.gz   // Contains the source code
tar xzf lnmp-full.tar.gz
cd lnmp    
screen -S lnmp    // if network interruption, you can execute the command `screen -r lnmp` reconnect install window
./install.sh

For Debian/Ubuntu:

1
2
3
4
5
6
apt-get -y install wget screen    
wget http://mirrors.linuxeye.com/lnmp-full.tar.gz   // Contains the source code
tar xzf lnmp-full.tar.gz
cd lnmp    
screen -S lnmp    // if network interruption, you can execute the command `screen -r lnmp` reconnect install window
./install.sh

How to install Oneinstack ?

Select Nginx or Apache to install :

1
2
3
4
5
6
7
8
9
10
11
Do you want to install Web server? [y/n]: y.Please select Nginx server:
        1. Install Nginx
        2. Install Tengine
        3. Install OpenResty
        4. Do not install
 
Please select Apache server:
        1. Install Apache-2.4
        2. Install Apache-2.2
        3. Do not install
Please input a number:(Default 3 press Enter)

Select Nginx or Apache to install

Select which Databases and PHP versions to  use :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Do you want to install Database? [y/n]: y
 
Please select a version of the Database:
        1. Install MySQL-5.7
        2. Install MySQL-5.6
        3. Install MySQL-5.5
        4. Install MariaDB-10.1
        5. Install MariaDB-10.0
        6. Install MariaDB-5.5
        7. Install Percona-5.7
        8. Install Percona-5.6
        9. Install Percona-5.5
Please input a number:(Default 2 press Enter) 
Please input the root password of database: fydx19871227
 
Do you want to install PHP? [y/n]: y
 
Please select a version of the PHP:
        1. Install php-5.3
        2. Install php-5.4
        3. Install php-5.5
        4. Install php-5.6
        5. Install php-7
Please input a number:(Default 3 press Enter)

Select which Databases and PHP versions to use

Opcode cache\ImageMagick or GraphicsMagick\phpMyAdmin\redis\memcached\HHVM:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Do you want to install opcode cache of the PHP? [y/n]: y
Please select a opcode cache of the PHP:
        1. Install Zend OPcache
Please input a number:(Default 1 press Enter) 
 
Do you want to install ImageMagick or GraphicsMagick? [y/n]: n
 
Do you want to install Pure-FTPd? [y/n]: n
 
Do you want to install phpMyAdmin? [y/n]: y
 
Do you want to install redis? [y/n]: y
 
Do you want to install memcached? [y/n]: y
 
Do you want to use jemalloc or tcmalloc optimize Database and Web server? [y/n]: y
Please select jemalloc or tcmalloc:
        1. jemalloc
        2. tcmalloc
Please input a number:(Default 1 press Enter) 
 
Do you want to install HHVM? [y/n]: n

Opcode cache\ImageMagick or GraphicsMagick\phpMyAdmin\redis\memcached\HHVM

Once you’ve followed all those steps above including the last step, you can see it .

Once you’ve followed all those steps above including the last step

So fire up your browser and point it to the servers’ IP address.OneinStack default welcome page should be seen there:

OneinStack default welcome page should be seen there

Now you can manage your MySQL databases from phpMyAdmin web interface.

manage your MySQL databases from phpMyAdmin web interface

Navigate to  http://server-ip-address/phpinfo.php. It will display all the details about php such as version, build date and commands etc.

the details about php

How to use OneinStack?

Add a virtual host:

1
2
cd ~/lnmp    // Must enter the directory execution under lnmp
./vhost.sh    // Do not sh vhost.sh or bash vhost.sh such execution

Add a virtual host

Delete a virtual host:

1
2
cd ~/lnmp
./vhost.sh del

Backup:

1
2
3
4
5
cd ~/lnmp
./backup_setup.sh    // Backup parameters 
./backup.sh    // Perform the backup immediately 
crontab -l    // Can be added to scheduled tasks, such as automatic backups every day 1:00 
  0 1 * * * cd ~/lnmp;./backup.sh  > /dev/null 2>&1 &

How to manage service

Nginx/Tengine/OpenResty: service nginx {start|stop|status|restart|reload|configtest}

MySQL/MariaDB/Percona: service mysqld {start|stop|restart|reload|status}

PHP: service php-fpm {start|stop|restart|reload|status}

HHVM: service supervisord {start|stop|status|restart|reload}

Apache:service httpd {start|restart|stop}

Pure-Ftpd: service pureftpd {start|stop|restart|status}

Redis: service redis-server {start|stop|status|restart|reload}

Memcached: service memcached {start|stop|status|restart|reload}

How to manage service

Conclusion

Finally, at this point you have installed and configured full LEMP stack properly. All you have to do is just adding some more additional Virtual Host / Server Block for each domain you want to host to that server.

 
<

1 Comment

  • YY Reply

    July 7, 2016 at pm11:51

    A LEMP software stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps.

     

Leave a Comment

Login

Welcome! Login in to your account

Remember me Lost your password?

Lost Password