In this article, we will show you how to install WordPress on a CentOS server.

Login to your server via SSH or KVM, via root.
Disable selinux;

setenforce 0
sed -i ‘s/enforcing/disabled/g’ /etc/selinux/config

Run the following command to install all the required packages for your LAMP stack, which will host the WordPress site;

yum install httpd php php-common php-mysqlnd php-mbstring php-gd mariadb-server mod_ssl -y

Update the Apache config to allow for htaccess to be used;

sed -i ‘s/AllowOverride none/AllowOverride all/g’ /etc/httpd/conf/httpd.conf

Start Apache & MySQL on the server;

systemctl start httpd && systemctl start mariadb

You should now be able to confirm that Apache is started by going to either your server IP address or the domain name you have pointed to the server, in this example we will use the server IP address.
Create the MySQL user and database for WordPress, enter the mysql command to get to a prompt (choose a different password to the below one, just make sure it is secure!)

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

Download and put into place the latest version of WordPress;

curl -O
tar zxvf latest.tar.gz
mkdir /var/www/html/
mv wordpress/* /var/www/html/

Update the permissions so that we can upload files through the WordPress control panel;

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

You can now go to your site URL or IP address in the browser to complete the WordPress installation, below are the following pages you should go through to complete the install;

On the following page you should enter the details that you used earlier when creating the MySQL database;

9. Your site is now setup and ready to login to, if you go to your URL or server IP address you should see a basic WordPress installation. You can login to your WordPress admin control panel at http://IP-ADDRESS/wp-admin/.