Install WordPress 5 In CentOS 7 or Oracle Linux 8.5 And VMware
This tutorial presumes you have CentOS 7 or Oracle Linux 8.5 installed with Apache, MariaDB and php7.x. You need to be logged in to the server using Putty or equivalent as an administrator. During your server installation, you should have already installed nano and wget.
I highly recommend you create a new document in NotePad++ or your favorite text editor. Copy the commands found below into your new document where you can then make changes such as server name, user name etc. You can then copy and paste these lines of code one at a tine into Putty. This will give you a reliable document showing exactly how you created your WordPress installation.
Now lets get started.
It is recommended to disable SELINUX for WordPress to function fully. Use the code below to check the SELINUX status. If you wish to disable SELINUX, use the following tutorial before installing WordPress.
Check status of SELINUX.
Disable SELINUX.
Edit this line as shown.
Save the file and reboot.
Log back in using Putty and check the status of SELINUX.
SELinux status: disabled
Install WordPress.
Log in to the database server.
Now enter the root password.
MariaDB [(none)]>
Create a database for WordPress.
Next, create a user that will be associated with the WordPress database. Be sure to leave the single quotes in place.
Next, grant all permissions to the user on the database.
Finally, flush the privileges to save all the changes.
To exit from the database server, run EXIT.
To apply the changes, restart the MariaDB server by running the following command.
With the WordPress database already created, proceed and download the WordPress tarball from WordPress repository as shown.
This unpacks the WordPress tarball to your /home directory and extracts the tarball into a folder labeled wordpress. This contains all the WordPress files that will be essential as we move along.
Move the ‘WordPress’ folder to the webroot directory /var/www/html.
Change the directory name from wordpress to anything that identifies your domain.
At this point, you need to change permissions of the new folder to user ‘Apache’ .
Change file permissions as shown below. -R757 will allow your administrator to alter files.
Next, you need to create the upload directory manually.
We need to give the Apache webserver write permissions to the newly created uploads folder. This will enable Apache to create directories and files. You need to su to root to accomplish this.
Issue the command below.
Return to the administartor.
Navigate to the directory you created earlier.
Rename the wp-config-sample.php to wp-config.php as shown.
Open the newly renamed file using your favorite text editor. I will be using nano.
Fill out the database details accordingly as defined when creating the WordPress database. Be sure to leave the single quotes in place.
define( 'DB_USER', 'db_user' );
define( 'DB_PASSWORD', 'pasword' );
Save and exit the text editor. The final step is to complete the installation via a web browser. To do this, launch your web browser and enter your server’s IP address or domain name as shown below.