Installing LEMP Stack on CentOS 7.x and Ubuntu 16.04

Installing LEMP Stack on CentOS 7.x & Ubuntu 16.04

Once you have your VPS or Server setup the next step will be installing something to server on this Server. Most likely than not you want to serve a static website with some content in it, some might go a little further and may require dynamic content to be served. In this tutorial we will accomodate all tastes and will install what is called a ‘LEMP Stack’. In definition a lemp stack is a combination of software that will work together to serve content on the web. (L)inux (E)Nginx (M)ysql (P)HP.

In a busy day one would like to make things as simple as possible, given that sometimes you will need to configure multiple servers at the same time and even if you didn’t still making things easier is a huge bonus. A simple BASH script or one liner to automate the installation of LEMP stack is available for download/clone at https://github.com/khaledalhashem/nginx_custom. Or simply copy and paste this command into a bash prompt.

Before you do so you can edit this file to better suite your needs, I will maintain an updated stable release of all the packages and modules.

For CentOS 7.x

Run the following command in bash prompt to start the one liner install.

[user@localhost ~]$ sudo -i
[root@localhost ~]# # yum -y update && curl -O https://raw.githubusercontent.com/khaledalhashem/lemp/master/lemptest_centos.sh && chmod 0700 lemptest_centos.sh && bash lemptest_centos.sh 2>&1 | tee lemp.log
For Ubuntu 16.04
[user@localhost ~]$ sudo -i
[root@localhost ~]# # curl -O https://raw.githubusercontent.com/khaledalhashem/lemp/master/lemp_ubuntu.sh && chmod 0700 lemp_ubuntu.sh && bash -x lemp_ubuntu.sh 2>&1 | tee lemp_custom.log

Congratulations!

Tagged with: , , , , , ,