How to Install WordPress 4.7 with Apache on RHEL/CentOS 6/7 and Fedora
Awesome Tools Linux Programming Tutorials

How to Install WordPress 4.7 with Apache on RHEL/CentOS 6/7 and Fedora?

Introduction To WordPress

WordPress, one of the most in use CMS (Content Management System) system for website creation. It was developed using MySQL and PHP. It was introduced in the year 2003 and now it’s getting popular day by day because of its plugins available in a mass quantity. With the evolution of web servers, Apache and NGINX WordPress is also flourishing.

So, here we are for How to Install WordPress 4.7 with Apache on RHEL/CentOS 6/7 and Fedora? and By the end of this article, we will get aware of setting up WordPress with Apache/MySQL/MariaDB/PHP

If, looking for setting up WordPress with Nginx Read Full Article Here

Scenario:

  1. My Server IP is 168.1.188
  2. Up and Running MySQL – Read How to SetUP MySQL Server 5.5
  3. Up and Running Apache – Read How to SetUp Apache Server
  4. Up and Running PHP – Read How to Setup Custom PHP or PHP 5.4

Note: If you are a SUDO user then prefix every command with sudo, like #sudo ifconfig

In short, ALL we need is an up and running LAMP environment. Read what LAMP environment is and how to set up LMAP environment?

Here is a quick SetUp for LAMP environment

Let’s start

Step 1: Install Required Packages

To set up WordPress we might require few packages so please install following packages according to your system configuration, requirement, and OS version.

For RHEL/CentOS 7:

For RHEL/CentOS 6 & Fedora 15-20:

For Fedora 21 Or Above:

After successful installation of MySQL/MariaDB please start your MySQL server and run the following command to get some vulnerabilities removed from your MySQL/MariaDB server.

For CentOs/RHEL 7 and Fedora 22 or Above:

For CentOs/RHEL 6 and Fedora 15 -21:

Note: If Stuck Somewhere Please Read Article – Read How to SetUP MySQL Server 5.5

Step 2: Get WordPress

After installing Apache and MySQL we need the WordPress lump on our server. To get this download done you have to be the root user.

Step 3: Extracting WordPress Files

Now we will extract our WordPress files from this tarball and rename it ( If you want to ). Please run following command.



Step 4: Creating MySQL User & Database

We need a database for up and running WordPress and a database user which will interact with the database for WordPress. Use the following series of command to login in database and  to create database and MySQL user

Now, we will create a new user. You can replace the name of database and password, with your preferences.

Note: If you already have a user and want to change password you may use the following command

As we have our user and database created now let’s grant all required  privileges and permissions

Now refresh MySQL with following command and exit

Note: Highlighted values will be used later so please use accordingly and do as per your need. Also, if there is any problem in setting up mysql server read: – How to SetUP MySQL Server 5.5

Step 5: Creating Apache VirtualHost for WordPress

Here Are Two Conditions: First one, if you have a domain name for your WordPress installation then follow Setting 2 virtual host and if you want to run WordPress installation on localhost or IP then follow Setting 1 for the virtual host.

Setting 1: If Setting WordPress on IP or LocalHost

Copy paste these given lines of code  and change the highlighted values accordingly and as per your needs

Now save the file using the command  #: wq!

Now Restart your Server for getting your changes in effect

For CentOs/RHEL 7 and Fedora 22 And Above:

For CentOs/RHEL 6 and Fedora 15-21:

Setting 2: if want to install WordPress on a domain

Copy paste these given lines of code  and change the highlighted values accordingly and as per your needs

Now Restart your Server for getting your changes in effect

For CentOs/RHEL 7 and Fedora 22 And Above:

For CentOs/RHEL 6 and Fedora 15-21:



Step 6: Setting up WordPress

This is the key part of getting WordPress installation done. Make sure to make a copy of the default configuration file then make any changes. This configuration file is present in WordPress directory

Then open the WordPress configuration file:

You will see content like this and make your changes to the following which I have highlighted.

Write and quit the file using :wq!

Step 7: Finishing WordPress Installation and Verification

Now, Open your browser and type any of the following address as per your setting you chose above. I have done my installation using IP address so I will use http://192.168.1.188/wp_test

http://test.kapendra.com

http://localhost/wp_test (If System Is LocalHost)

http://your-ip/wp_test (If WordPress running on IP)

If everything goes right then you will be prompted for this

Now fill all the detailed like Site Title, Admin User, Admin Password, and Enter Your E-Mail and then hit Install button.

And you will have a site running on WordPress you may login into WordPress dashboard using

http://test.kapendra.com/wp-login

http://localhost/wp_test/wp-login/  (If system is Local)

http://your-ip/wp_test/wp-login/  (id WordPress running on IP)

Watch Video:

Coming Soon…



Kapendra
Love to write technical stuff with personal experience as I am working as a Sr. Linux Admin. and every day is a learning day and Trust me being tech geek is really cool.
http://kapendra.com

Leave a Reply