Posts in Category: centos linux tutorials and howtos

Setup WordPress on CentOS 7/Fedora 2x with MySQL 5.6 and PHP5.6

In this article we will setup WordPress from scratch in just a few easy steps. I will use a vps with centos 7.

Step 1) Install Apache web server

yum -y install httpd
systemctl start httpd.service
systemctl enable httpd.service

Step 2) Install PHP 5.6

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y install php56w php56w-opcache php56w-mysql php56w-xml
systemctl restart httpd.service

Step 3) Install Mysql 5.6

yum -y install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum -y install mysql-community-server
systemctl start mysqld.service
systemctl enable mysqld.service

Step 4) Install WordPress

1 – Download latest WordPress

cd /var/www/html
wget https://wordpress.org/latest.zip
unzip latest.zip
rm -rf latest.zip
cp -rf wordpress/* /var/www/html/
rm -rf wordpress/

2 – Setup permissions:

chown -R apache:apache /var/www/html/*
chown  apache:apache /var/www/html

3 – Create MySQL Database, we will call ours ‘wordpress’, you can replace the word ‘wordpress’ below with whatever you would like your database to be called

mysqladmin create wordpress

Step 5) Point your browser to http://Your-Server-IP and you will see the WordPress

Read More


Getting started with Ansible on CentOS 6

What is Ansible?

Long story short, Ansible is a tool which helps server administrators automate and execute tasks on multiple servers at the same time. Imagine having 20 Linux servers, each needing an installtion

of a web server. In the good old days, you would have to login to each server individually and perform the task, now though you can do it with a single command.

Why is Ansible preferred – other automation tools require you to install additional software on your remote servers, while Ansible does the job through SSH, which means no additional software on your target servers, less resources/low overhead, less things to troubleshoot then things go wrong.

Install Ansible

We will refer to the machine we install Ansible on as the command server. This could be your own laptop, stand alone

Read More


Setup remote and secure connections for MySQL on CentOS 7

In this tutorial we will show you how to login to your  mysql database system remotely and securely using SSL, username and password.

Install MySQL

The latest stable MySQL version is 5.7, so that’s the version we will install and configure in this tutorial.

The package is the first thing you’ll need to add, and it is available in the MySQL repository. Execute the following command to get started:

# yum localinstall -y https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

This command will add the MySQL repository which can then be used to install the database system:

# yum install -y mysql-community-server

At the end of the installation process, start MySQL using systemd tools:

# systemctl start mysqld

Check MySQL status:

mysqld.service - MySQL Server
 Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
 Active: active (running) ...

MySQL listens on port 3306, as you can see by executing

Read More


Install PHP 7, NGINX & MySQL 5.6 on CentOS/RHEL 7.1 & 6.7

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

Now start

Read More


Load Balancing with HAProxy on CentOS 7

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

Read More