A photo of Mitesh Shah

Mitesh Shah

Linux Expert | Automation Enthusiast | Security Consultant

Email Skype Github Twitter Resume Hire Me Keybase LinkedIn Stackoverflow


How to Install WordPress on CentOS7

Overview

Prerequisites

Setup Database & DB User

$ mysql -u root -p
MariaDB [(none)]> CREATE DATABASE example_com;
MariaDB [(none)]> CREATE USER example_user@localhost IDENTIFIED BY 'E1hciAx';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON example_com.* TO example_user@localhost IDENTIFIED BY 'E1hciAx';
MariaDB [(none)]> FLUSH PRIVILEGES;

Setup Virtual Host

$ vim /etc/httpd/conf/httpd.conf +$
<VirtualHost 1.1.1.1:80>
  ServerName example.com
  SetEnv realm prod
  DocumentRoot /var/www/vhosts/example.com
  ErrorLog logs/example.com-error_log
  CustomLog logs/example.com-access_log enhanced
  <Directory /var/www/vhosts/example.com>
    Options Indexes FollowSymLinks
    Require all granted
    AllowOverride All
  </Directory>
</VirtualHost>

Download WordPress

$ wget http://wordpress.org/latest.tar.gz
$ tar -zxvf latest.tar.gz -C /var/www/vhosts/example.com/ --strip-components=1

Fix Permission

$ sudo chown -R apache:apache /var/www/vhosts/example.com/




Post Navigation