Installing and Setting up a WordPress on RHEL 7 / CentOS 7

Installing and Setting up a WordPress on RHEL 7 / CentOS 7

Basic Requirements

Step 1: Connect to the server using key or user/password

Step 2: update yum repo metadata.

Step 3: Install wget

Install LAMP (Linux, Apache, MySql [mariaDB] and PHP) stack

Step 1: Install, start, enable and check the status of Apache web server (httpd)

Note: If you are looking for a secure, scalable managed WordPress management solution, take a look at Serverpilot WordPress management

Step 2: Install and start MariaDB (MySQL)

Step 3: Configure MariaDB. Enter appropriate values on each prompt.

Step 4: Install php, php modules and restart httpd

Step 5: To test php installation, create simple PHP script. Open a test.php file using the following command.

Step 6: Copy the following php script to the file and save it.

Step 7: Now, try accessing the demo script using the public IP followed by demo.php as shown below. If every configuration is correct, you will see a web page with all the installed php information.

Configure Database User and Password For WordPress

We should not use the root user and password for WordPress. It should be used only for administrative purposes. So let’s create a new database, user, and password for the WordPress website we are going to set up.

Step 1: Login to MariaDB (MySQL) with root credentials you created. It will open the MariaDB shell where you can run the scripts for managing databases and its users.

Step 2: Create a database named wordpress. You can give your own database name.

Step 3: Now create a user named wordpress_admin for managing the wordpress database. You can choose your database username and password.

Step 4: Grant all database privileges to wordpress_admin on wordpress database.

Step 5: Flush the privileges using the following command.

Step 6: Exit the database shell

Install and Configure WordPress

Now that we have all the components required for running WordPress, we will go ahead with the WordPress installation.

Step 1: Download latest WordPress

Step 2: Extract the tar file.

Step 3: Copy wordpress folder content to /var/www/html folder

Step 4: Change the owner of /var/www/html to apache user. Because the WordPress files will be manipulated by httpd apache user.

Configuring WordPress

Step 1: cd in to /var/www/html folder

Step 2: Copy wp-config-sample.php to wp-config.php file.

Step 3: Open wp-config.php file and add the database details in the following parameters.

That’s it! If you browse to the IP you will be able to access the WordPress website

Also read,

  1. How to Setup Free SSL (https) for WordPress Website using Cloudflare
  2. How to SetUp High-Performance WordPress on Cloud/VPS

Related

When you do an ssh to a remote server, you might see a welcome message with the OS name, Team name or the Company name.…

Read more
git ssh authentication

I want to setup ssh authentication keys for my GitHub and Bitbucket account. So that I can commit to those repositories…

  • GIT+1 more
  • 515
Read more

SSL (Secure Socket Layer) is a protocol , which establishes a secure connection between a web browser and the server so…

Read more
About

The Best Tutorials & Tips to Speedup Your DevOps Workflow.

Created by Bibin Wilson.