How to install and configure WordPress on Redhat 7 / Centos 7

WordPress is an open-source content management system, Over the internet lots of website created with WordPress CMS, WordPress has more than 20,000+ plugins to extend its functionality, click here for more information about WordPress.
 
Get wordpress on ubuntu link is given below :-
 

Before Installation of WordPress on your machine, Make sure you have working  LAMP Server, click here to install and configure LAMP Server on your Redhat  Linux Machine.

Step 1: To install WordPress in Redhat operation system, Need to download WordPress compressed archive file from WordPress website by using  the following commands.

[root@localhost ~]# wget http://wordpress.org/latest.tar.gz

Step 2: Extract the archived files by using  the following commands.

[root@localhost ~]# tar xzvf latest.tar.gz

Step 3: Need to copy or move inside all files of WordPress directory by using  the following commands.

[root@localhost ~]# cp -ivr wordpress/* /var/www/html/

Step 4: Need to add a folder for WordPress to store uploaded files by using  the following commands.

[root@localhost ~]# mkdir /var/www/html/wp-content/uploads

Step 5: Change the owner of the WordPress file to Apache by using  the following commands.

[root@localhost ~]# chown -R apache:apache /var/www/html/*

Before the start,  WordPress installation needs to rename or copy of the WordPress’s config file wp-config-sample.php to wp-config.php by using  the following commands.

[root@localhost ~]# cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php

Now its time to create database and user for WordPress by using given the command, first you need to log in as an administrator with MariaDB.

[root@localhost ~]# mysql -u root -p

Enter password:
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 11
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input statement.

MariaDB [(none)]>

Create here database for WordPress by using  the following commands.

CREATE DATABASE wordpress;

Create a database user for WordPress by using  the following commands.

CREATE USER wordpressuser@localhost IDENTIFIED BY ‘password’;

Grant all privileges to the database user by using  the following commands.

GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY ‘password’;

Need to flush the privileges so that MySQL knows about the recent privilege changes with the database user by using  the following commands.

FLUSH PRIVILEGES;Now exit from MariaDB prompt by using  the following commands
exit, Now need to add WordPress database and user details in WordPress’s config file.

[root@localhost ~]# nano /var/www/html/wp-config.php

You should get parameter like this.

// ** MySQL settings – You can get this info from your web host ** //

/** The name of the database for WordPress */
define(‘DB_NAME’, ‘wordpress’);

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

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

Save and exit from the text editor.

It’s time to restart the httpd service by using  the following commands.

[root@localhost ~]# systemctl restart httpd

Now navigate to your server’s domain name or public IP address, You will get the web interface to configure WordPress, Now you can choose a language of WordPress and you can create WordPress site admin username and password.

How to install and configure WordPress on Redhat 7 / Centos 7

11 thoughts on “How to install and configure WordPress on Redhat 7 / Centos 7

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top