Install WordPress (LAMP) On CentOS 8

WordPress is a very popular PHP based CMS (Content Management System). For small businesses, personal/hobby websites, WordPress can be a lifesaver. In this article, I am going to show you how to install WordPress on CentOS 8. So, let’s get started.

yum install mariadb mariadb-server httpd httpd-tools php php-cli php-json php-gd php-mbstring php-pdo php-xml php-mysqlnd php-pecl-zip wget

systemctl status httpd
systemctl start httpd; systemctl enable httpd
systemctl status httpd

systemctl status mariadb
systemctl start mariadb;systemctl enable mariadb
systemctl status mariadb

mysql -u root -p
CREATE DATABASE wordpress;
GRANT ALL ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'secret';
FLUSH PRIVILEGES;
quit
cd /var/www
wget https://wordpress.org/latest.tar.gz
tar xvzf latest.tar.gz ; rm -v latest.tar.gz
chown -Rf apache:apache ./wordpress/
chmod -Rf 775 ./wordpress/

vim /etc/httpd/conf.d/wordpress.conf

 

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/wordpress
<Directory "/var/www/wordpress">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
ErrorLog /var/log/httpd/wordpress_error.log
CustomLog /var/log/httpd/wordpress_access.log common
</VirtualHost>
httpd -t
systemctl restart httpd

 

Leave a Reply