This article will guide you on installing wordpress in a CentOS 7 64bit server.
You will need the wordpress files that you can freely download at https://wordpress.org/download/.
The tutorial will assume that:
Login to your mysql server using the command:
mysql -u root -p
Then create a database by following the commands. For this tutorial we will create a database named "orders_newdatabasename" with a user "orders_dbuser" and password of "mynewpassword".
You will have to write down this information since 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 users files:
then exit mysql:
Let us install php-gd first, this module is used to resize images so we can create a thumbnail. Let us try to fetch the package from CentOS repository:
sudo yum install php-gd
After that we will need to restart our httpd server so it can recognize the newly installed module:
sudo service httpd restart
Go to your /html folder before we download the latest wordpress files. The /html folder is the public facing folder of your webserver.
and download the latest wordpress files:
Now, we have to untar or unpack our wordpress files:
tar xzvf latest.tar.gz
Unzip the wordpress files in the /var/www/html directory:
unzip -q latest.zip
And then we set the appropriate permissions for the html directory and files to increase wordpress security and to avoid problems with permissions later on as we configure our wordpress.
sudo chown -R apache:apache /var/www/html/*
Now that wordpress is installed the next step we will do is to configure wordpress so we can use it.
To configure wordpress on CentOS 7, we have to open our browser and enter the ip of your server together with /wordpress. An example is: http://22.214.171.124/wordpress/.
Where 126.96.36.199 is the ip address of your webserver where you installed httpd, mysql and php.
On the first page you will see the language configuration, you can select your preferred language from the options but if your language is not available you can also select any language you can understand. You can always change it later on in the wordpress settings.
On the next page enter the database information as per the requirement on the left, you will need the database name, your database username & password, the database hostname which is usually localhost and the database prefix which you can set or leave as it is.
If the database information you entered is correct, wordpress will inform you that it can now communicate with the database. If not, you will have to enter the database information again while making sure all information is correct.
Once your database details are confirmed to be correct wordpress will ask you some information such as your site title, your administrator username and password.
If all is fine and no errors occur you can now login to the Wordpress administration area to add your theme, plugins and more users.