CentOS 8 / Redhat 8 install wordpress with let’s encrypt ssl https.

Set Current Hostname :

hostnamectl set-hostname example.com
hostnamectl restart systemd-hostnamed

Install EPEL release

yum -y install epel-release

Install httpd mod_ssl php and mariadb server database

yum -y install php php-mysqlnd php-json mod_ssl httpd mariadb-server

Enable httpd and mariadb server database

systemctl enable mysqld
systemctl enable httpd
systemctl start mariadb httpd

Configure Mariadb Secure Installation

mysql_secure_installation

Configure User WordPress and database

# mysql -u root -p
Enter password:
## Create database ##
CREATE DATABASE wordpress;
## Creating new user ##
CREATE USER wordpress@localhost IDENTIFIED BY "change_this";
## Grant privileges to database ##
GRANT ALL ON wordpress.* TO wordpress@localhost;
## FLUSH privileges ##
FLUSH PRIVILEGES;
## Exit ##
exit

Configuring Firewalld to open traffic for http and https

yum -y install firewalld
firewall-cmd –zone=public –permanent –add-service=http
firewall-cmd –zone=public –permanent –add-service=https

Install https ssl letencrypt

wget https://dl.eff.org/certbot-auto
mv certbot-auto /usr/local/bin/certbot-auto
chown root /usr/local/bin/certbot-auto
chmod 0755 /usr/local/bin/certbot-auto
/usr/local/bin/certbot-auto

Edit SSL.conf /etc/httpd/conf.d/ssl

add

DocumentRoot /var/www/html/wordpress

INSTALL WORDPRESS

cd /var/www/html
wget https://wordpress.org/latest.tar.gz
tar -zxvf latest.tar.gz
chown -R apache:apache wordpress
rm -rf latest.tar.gz

Point your browser to https://domain.com and follow the instruction. 🙂

Leave a Reply