Let’s add the appropriate repos before we begin
CentOS / RHEL 7
# yum install epel-release # rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm # rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm # rpm -Uvh http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
CentOS / RHEL 6
# yum install epel-release # rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm # rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm # rpm -Uvh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
Step 2. Install PHP 7
Now install php 7 packages from webtatic rpm repository using following command.
# yum install php70w
Now install required php modules. Use following command to list available modules in yum repositories.
# yum search php70w
Now check all listed modules in above command and install required modules like below.
# yum install php70w-mysql php70w-xml php70w-soap php70w-xmlrpc # yum install php70w-mbstring php70w-json php70w-gd php70w-mcrypt
Step 3. Install NGINX
NGINX is the popular web server used on Linux systems. Let’s install Nginx web server using following command on your system.
# yum install nginx
Introduction to Load Balancing
Before we begin the tutorial, which will cover installing HAProxy for load balancing, let’s first talk about the concept of load balancing.
A lot of high-traffic sites are required to serve tons of simultaneous requests from clients, all in the fastest way possible.
Very often these connections could be in the millions,
and it is just not possible to satisfy every one of them using just a single server, regardless of how powerfull it is.
A load balancer distributes or spreads the network load across multiple servers, ensuring reliability by sending requests only to servers that are online and capable of serving those requests.
HAProxy is one of the most popular options for load balancing software, and this tutorial will demonstrate how to install and configure it on a server