Centos7 WordPress Installation

Install and guidance notes for WordPress on CENTOS7

sudo yum update –y

Now for the WordPress installation:

sudo yum install httpd mariadb mariadb-server php php-common php-mysql php-gd php-xml php-mbstring php-mcrypt php-xmlrpc unzip wget –y

sudo systemctl start httpd

sudo systemctl start mariadb

sudo systemctl enable httpd

sudo systemctl enable mariadb

sudo mysql_secure_installation

Set root password? [Y/n] n

Remove anonymous users? [Y/n] y

Disallow root login remotely? [Y/n] y

Remove test database and access to it? [Y/n] y

Reload privilege tables now? [Y/n] y

Once you have finished, login to MariaDB console with the following command:
mysql -u root –p

MariaDB [(none)]>CREATE DATABASE wordpress;

MariaDB [(none)]>GRANT ALL PRIVILEGES on wordpress.* to ‘user’@’localhost’ identified by ‘password’;

MariaDB [(none)]>FLUSH PRIVILEGES;

MariaDB [(none)]>exit

DOWNLOAD WORDPRESS

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

Once download is finished, extract the downloaded file with the following command:

tar -xzvf latest.tar.gz 

Next, move the extracted files to the Apache web root directory:

sudo cp -avr wordpress/* /var/www/html/

Create WORDPRESS DIRECTORYS

sudo mkdir /var/www/html/wp-content/uploads

Next, assign proper ownership and permissions to your WordPress files and folders:
sudo chown -R apache:apache /var/www/html/

sudo chmod -R 755 /var/www/html/

Next, you will need to make some changes in the WordPress main configuration file, so it can be connected with the database and user.
First, rename and edit the WordPress main configuration file:

cd /var/www/html/

sudo mv wp-config-sample.php wp-config.php

sudo nano wp-config.php

Change the DB_NAME, DB_USER, and DB_PASSWORD variables as shown below:
define(‘DB_NAME’, ‘wordpress’);
define(‘DB_USER’, ‘user’);
define(‘DB_PASSWORD’, ‘password’);

Save and close the file when you are finished.
Before starting, you will need to allow access to the Apache ports using firewalld.
You can do this by running the following command:

sudo firewall-cmd –permanent –zone=public –add-service=http

sudo firewall-cmd –permanent –zone=public –add-service=https

sudo firewall-cmd –-reload

On welcome APACHE screen follow instructions to disable the welcome page.

restorecon -r /var/www/html

Browse to apache and install wizard should appear.

Give a site title, username = admin, password = *******

 

Heh, why not leave a comment?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s