You are here:

Using CentOS 7 64-bit Server to Install and Configure WordPress

Using CentOS 7 64-bit Server to Install and Configure WordPress

Overview

This guide will walk you through the process of installing WordPress on a CentOS 7 64-bit server. Ensure you have the WordPress files, which can be freely downloaded from https://wordpress.org/download/.

Requirements

This tutorial assumes the following:

  1. You have a CentOS 7 64-bit VPS server from blendhosting.com. If not, you can purchase one from Blend Hosting.

  2. You have logged in to your VPS server through an SSH terminal.

  3. Apache, PHP, and MySQL are already configured on your server.If not, refer to this page for instructions on Setting up CentOS 7 64-bit LAMP (Linux Apache MySQL and PHP) Stack  [1].

Construct a database with MySQL

To log in to your MySQL server, use the appropriate command followed by your MySQL username and password when prompted.

mysql -u root -p

Proceed to create a database using the commands. For this tutorial, let’s create a database named “orders_newdatabasename” with a user “orders_dbuser” and a password “mynewpassword“. Make sure to note down this information as we will use it later on.

CREATE DATABASE wordpress_sample;

CREATE USER wp_user@localhost IDENTIFIED BY 'wp_password';

GRANT ALL PRIVILEGES ON wordpress_sample.* TO wp_user@localhost;

Flush all privileges to re-read the user files with the appropriate command.

FLUSH PRIVILEGES;

Next exit mysql:

exit

WordPress Installation Guide

Begin by installing php-gd, a module utilized for image resizing, particularly for creating thumbnails. Retrieve the package from the CentOS repository using the appropriate command.

sudo yum install php-gd

Following the installation of php-gd, restart the HTTPD server to ensure it recognizes the newly installed module.

sudo service httpd restart

Navigate to your /html folder before downloading the latest WordPress files. The /html folder serves as the public-facing directory of your web server.

cd /var/www/html/

Download the latest WordPress files in your current directory.

wget https://wordpress.org/latest.tar.gz

Now, you need to untar or unpack your WordPress files using the appropriate command.

tar xzvf latest.tar.gz

Unzip the WordPress files located in the directory /var/www/html:

unzip -q latest.zip

Set the appropriate permissions for the html directory and files to enhance WordPress security and prevent potential permission issues during the configuration process.

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

Now that WordPress is installed, the next step is to configure it so that it can be used.

Setting up WordPress

To configure WordPress on CentOS 7, open your browser and enter the IP address of your server followed by `/wordpress`. For instance: `http://52.41.13.20/wordpress/`, where `52.41.13.20` is the IP address of your webserver with installed Apache, MySQL, and PHP.

On the first page, you will encounter the language configuration. Choose your preferred language from the options. If your language is not available, select any language you understand. You can always modify this setting later in the WordPress configurations.

enter image description here

On the next page, provide the necessary database information on the left. You will need the database name, your database username and password, the database hostname (usually localhost), and the database prefix, which you can either set or leave as it is.

enter image description here

If the database information you entered is correct, WordPress will confirm that it can communicate with the database. If not, you will need to re-enter the database information, ensuring that all details are accurate.

enter image description here

After confirming the correctness of your database details, WordPress will prompt you to provide additional information such as your site title, administrator username, and password..

enter image description here

If everything is in order and no errors occur, you can now log in to the WordPress administration area. From there, you can add your theme, plugins, and additional users.

enter image description here

[1]: https://www.blendhosting.com/kb/setting-up-centos-lamp/

Was this article helpful?
Dislike 0