arrow_upward

Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing WordPress on CentOS 7
#1
Hey!

In this thread, we're going to learn how to install WordPress on your CentOS 7 machine. To do so, login to your server with your credentials using Putty or any other SSH client and follow the steps.

Step 1Installing LAMP Stack

Most of us would already know what LAMP stack is, for those who don't, it means "Linux, Apache, MySQL & PHP". We must install them. Since it's an easy part, we'll skip. For those who don't know, they can follow up on the tutorial given at the end of the tutorial.

Step 2 - Creating MySQL Database & Configuring Proper permissions to it.
Before we start downloading and installing WordPress, we will need to create a MySQL database and configure it properly. To do so, login to your MySQL root user by using this command.

mysql -u root -p

Now when inside MySQL terminal, use the following commands to create user & database and assign proper permissions to each other. 
mysql> CREATE DATABASE wordpress;
mysql> GRANT ALL PRIVILEGES on wordpress.* to 'wpuser'@'localhost' identified by 'your_password';
mysql> FLUSH PRIVILEGES;
mysql> exit

Note - Make sure 'wpuser' is edited with your desired username for WP's database username and 'wordpress' to be replaced as your desired name for the WP database. 
 
After configuring it, restart it.
systemctl restart mariadb

Step 3 - Downloading & Installing WordPress

Download and unzip WP package into the proper directory. After that, make 'uploads' directory as it is not created by default.
wget http://wordpress.org/latest.zip
unzip -q latest.zip -d /var/www/html/
mkdir -p /var/www/html/wordpress/wp-content/uploads
Assign proper permission to Apache to access WordPress directory and it's filed.

chown -R apache:apache /var/www/html/wordpress
chmod -R 755 /var/www/html/wordpress
chown -R :apache /var/www/html/wordpress/wp-content/uploads

Now head over to WP's directory.


cd /var/www/html/wordpress/

By default, the 'wp-config.php' is named as 'wp-config-sample.php'. To configure WordPress, we need to rename it to its original name. To do so, write the following command.
mv wp-config-sample.php wp-config.php


Now let's edit 'wp-config.php' and put values according to what we've set in step 2.

nano wp-config.php

Now edit it accordingly. We'll put the default values we've used to create the database(according to step 2).

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wpuser');

/** MySQL database password */
define('DB_PASSWORD', 'your_password');

/** MySQL hostname */
define('DB_HOST', 'localhost');
To save the file, press CTRL + X and then press “y” and it will ask you if you really want to save. Press ‘Enter’. In short, ‘CTRL + X > press y > press Enter’ and saved! Make sure you scroll down with arrow key and find these line and edit it accordingly and don’t touch other lines unless you completely know what you’re doing or it may result in errors.

Step 4 - Installing WordPress

To install WordPress after configuring it, go to http://your_ip_address/wordpress/wp-admin/install.php (replace your_ip_address with your server’s IP) and continue with the steps that WordPress instructs and you shall be able to completely work the way out of installing WordPress.


Detailed Article link - Installing WordPress on CentOS 7

(Note - This article is solely my work and has been published on Shadow Hosting's blog. All credits go to Shadow Hosting accordingly.)
Premium Web Hosting | ShadowCrypt | Manal Shaikh Official Website
If you find my post/thread useful, you're supposed to +rep me. 


Messages In This Thread
Installing WordPress on CentOS 7 - by Manal - 09-06-2019, 07:02 PM

Possibly Related Threads…
Thread
Author
Replies
Views
Last Post
5,226
04-13-2020, 06:45 AM
Last Post: Mashiro

person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting