How to install WordPress on CentOS 7

May 6, 2017 | By | Reply More

Its time to turn my CentOS cloud server more usable by installing WordPress on it. On my previous tutorial, I have shown a great solution provided by DigitalOcean to create a low cost cloud server. If you prefer Amazon, they also have a great solution (Amazon LightSail) that as cheap as $5 per month to get a reliable cloud server. Today I am going to create a new website with WordPress.

Before we can install WordPress on CentOS 7, make sure you have installed LAMP on CentOS 7. I have summarized the steps to install LAMP on CentOS 7. Follow the link below:

  1. Install Apache webserver on CentOS 7
  2. Install MariaDB/MySQL on CentOS 7
  3. Install PHP on CentOS 7

Once you have those Apache, MySQL and PHP installed on CentOS, we can start installing WordPress on our system.

Steps to install WordPress on CentOS 7

Step 1. Create new Database for WordPress

On Terminal console, we need to log in to MySQL Server and create new database.

Now create a new database called “wordpress01” or anything you like.

Now create a new user for example: dhani

Grant privileges

Flush privileges and exit

Step 2. Install Wordpress

WordPress needs php-gd module to work properly. Install it first prior to WordPress installation

Restart Apache

Download WordPress

Extract wordpress

Copy wordpress folder content to apache directory

Now create upload directory

Change the ownership

Step 3. Configure WordPress

Now we need to configure WordPress. First we need to copy the config sample file

Now find the following section:

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘database_name_here‘);

/** MySQL database username */
define(‘DB_USER’, ‘username_here‘);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘password_here‘);

Change the red text with the actual wordpress database, username and password we created earlier. In my case this would be:

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘wordpress01’);

/** MySQL database username */
define(‘DB_USER’, ‘dhani’);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘12345678’);

Step 4. Complete WordPress Installation

The last step is to configure WordPress installation via web browser. Type the IP address of the CentOS 7 server on a web browser and follow the installation wizard.

Select the language

Enter the new site information and press Install to start the installation

You will see the following info when the installation was successfull

Now you can log in to the new WordPress site

Now happy blogging. Thanks for coming to this blog and please subscribe to my social network if you like this website.

 

Tags: ,

Category: CentOS

Leave a Reply