Setup Centos 7 / RHEL 7 WordPress + FreeSSL

Since wordpress is not supporting php that come with centos 7 default package anymore , we use remi php repo , at current of this tutorial , stable php is version 7.3. Follow guide through of the following command . it just take than 5 minute before you have wordpress site running with Let’s encrypt free ssl .

# yum -y update

# hostnamectl set-hostname yourdomain.com

# systemctl restart systemd-hostnamed

# yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

# yum install yum-utils

# yum-config-manager –disable remi-php54

# yum-config-manager –enable remi-php73

# yum install httpd mod_ssl mariadb mariadb-server php php-common php-mysql php-gd php-xml php-mbstring php-mcrypt

# systemctl enable mariadb

# systemctl enable httpd

# systemctl start httpd

# systemctl start mariadb

# mysql_secure_installation

# 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

# cd /var/www/html

# yum -y install wget

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

# tar -xvzf latest.tar.gz

# chown -R apache:apache /var/www/html/wordpress

# vi /etc/httpd/conf.d/yourdomain.com.conf

<VirtualHost *:80>
   ServerAdmin admin@yourdomain.com
   DocumentRoot /var/www/html/wordpress
   ServerName yourdomain.com
   ServerAlias www.yourdomain.com
   ErrorLog /var/log/httpd/yourdomain.com-error-log
   CustomLog /var/log/httpd/yourdomain.com-acces-log common
</VirtualHost>

# systemctl restart httpd

Now we are setting up Let’s Encrypt SSL Certificate to Secure Apache on RHEL/CentOS 7. Follow the walk through

# yum install epel-release

# cd /usr/local/

# git clone https://github.com/letsencrypt/letsencrypt

# cd /usr/local/letsencrypt/

Almost Finished Hang in there . now just run ./letsencrypt-auto and follow the installation. As easy as that and restart httpd.

# ./letsencrypt-auto

# systemctl restart httpd

Verify our brand new https by clicking link below
https://www.ssllabs.com/ssltest/analyze.html
Enjoy !!!
 

Leave a Reply

Your email address will not be published. Required fields are marked *