In this tutorial we will show you how to install Nginx, PHP5 (fpm) with Zend OPCache, MySQL, PHPMyadmin, Postfix on an Ubuntu server in less than 20 minutes. We will use Easy Engine for this purpose.
You are probably wondering what is Easy Engine? It is a Linux shell-script to install, manage and host WordPress-Nginx websites on an Ubuntu/Debian server. It works only on a operating system based on Debian because unfortunately there is no support for RPM based systems like CentOS. This script will install Nginx, PHP5-fpm, MySQL, phpMyAdmin and all its dependencies in a single command, thus making it easy for every user that has little experience in working with a Linux VPS.
Nginx is an open source reverse proxy server and can be deployed to serve dynamic HTTP content on the network using FastCGI, SCGI handlers for scripts, WSGI application servers or Phusion Passenger module, and it can serve as a software load balancer. It is a better free alternative to Apache because it is lightweight and RAM-friendly. It also performs better and faster than Apache, particularly when the number of concurrent site visitors is on the rise.
To sum up, Easy Enginge (ee) is built to simplify the process of installing, configuring and managing Nginx (or full LEMP stack to be correct) to host websites on a Ubuntu server. It’s most notable features are:
- Automatically tweaks server configuration as per available hardware resources; - Supports automatic updates; - It will install w3-total-cache, wp-super-cache, NGINX’s fastcgi-cache, Zend Opcache, and Memcache; - Install Nginx, PHP, MySQL, phpMyAdmin and all its dependencies in a single command.
For this tutorial you will need:
- A VPS / Dedicated server with at least 512 MB of RAM; - Fresh install of Ubuntu (12.04, 12.10, 13.10, 14.04) or Debian 6/7 distribution; - Basic knowledge of the SSH command; - Basic knowledge of how to use Putty (Windows) or Terminal (Linux/Mac)
In this guide, we will use Ubuntu 14.04 VPS with 512MB of RAM.
First you need to login to your Ubuntu 14.04 VPS as user ‘root’ :
# ssh root@hostname
Let’s check if Apache and Postfix/Sendmail are already installed and running. If so, stop and remove them using:
# /etc/init.d/apache2 stop # /etc/init.d/postfix stop # /etc/init.d/sendmail stop # apt-get remove apache2 postfix sendmail
If you don’t know what your operating system is you can check using the following command:
# cat /etc/issue
Enter the following command to install Easy Engine on your VPS:
# curl -sL rt.cx/ee | sudo bash
curl command not found
# apt-get install curl
Now we can install Nginx, PHP5 (fpm), MySQL, Postfix and phpMyAdmin using this single command:
# ee system install
If you get the following error: ‘Unable to install PHP5, exit status = 100’ edit the default ee‘s configuration using your favorite editor:
# vim /etc/easyengine/ee.conf
Modify and set the ‘gpg-keys-fix= false’ line to ‘gpg-keys-fix= true’ so Easy Engine can try another mirror and fetch the key.
Once the installation is complete you will see something like this:
That’s it. We installed the complete LEMP stack (including the latest version of PHP5-fpm with ZendOPCache).
If you want to check the status of all running services use the following command:
# ee system status
You can know create a sample wordpress website. For example, to create a wordpress site called ‘rosehosting.example’ enter this command:
# ee site create rosehosting.example --wp
This will automatically install WordPress as well, in case you don’t have that already installed.
Of course you don’t have to do any of this if you use one of our Linux VPS hosting services, in which case you can simply ask our expert Linux admins to install this for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.