09-06-2019, 07:02 PM
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 1 - Installing 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.
Now when inside MySQL terminal, use the following commands to create user & database and assign proper permissions to each other.
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.
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.
Assign proper permission to Apache to access WordPress directory and it's filed.
Now head over to WP's directory.
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.
Now let's edit 'wp-config.php' and put values according to what we've set in step 2.
Now edit it accordingly. We'll put the default values we've used to create the database(according to step 2).
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.)
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 1 - Installing 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.
Code: (Select All)
mysql -u root -p
Now when inside MySQL terminal, use the following commands to create user & database and assign proper permissions to each other.
Code: (Select All)
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.
Code: (Select All)
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.
Code: (Select All)
wget http://wordpress.org/latest.zip
unzip -q latest.zip -d /var/www/html/
mkdir -p /var/www/html/wordpress/wp-content/uploads
Code: (Select All)
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.
Code: (Select All)
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.
Code: (Select All)
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.
Code: (Select All)
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).
Code: (Select All)
// ** 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');
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.
If you find my post/thread useful, you're supposed to +rep me.