rajibul5603 / serverManagement

0 stars 0 forks source link

How to Install Let's Encrypt SSL on CentOS 7 | Free SSL | CentOS 7 | Let's Encrypt | Step by Step #11

Open rajibul5603 opened 2 years ago

rajibul5603 commented 2 years ago

Let's Encrypt | Step by Step *

-Prerequisites

In this tutorial we will use eservice.pmeat.gov.bd

* Step 1 : Install Apache on systems

1.1.Installing Apache

yum install httpd -y

1.2-Enable and start the Apache service:

systemctl start httpd

systemctl enable httpd

1.3-Open Port 80 (HTTP) and 443 (HTTPS) in Firewall

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

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

firewall-cmd --reload

2.2.Create a Pages for Virtual Host cd /var/www/html**

touch index.html

vim index.html html title My Website /title body My Website /body
/html

2.3.Grant Permisions

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

2.4.Create New Virtual Host Files

By default, Apache is configured to load all configuration files that ends with .conf from the /etc/httpd/conf.d/ directory.

touch /etc/httpd/eservice.pmeat.gov.bd.conf

vim eservice.pmeat.gov.bd.conf

<VirtualHost *:80>
    ServerName eservice.pmeat.gov.bd
    ServerAlias www.eservice.pmeat.gov.bd
    ServerAdmin webmaster@local
    DocumentRoot /var/www/html

    <Directory /var/www/html>
        Options -Indexes +FollowSymLinks
        AllowOverride All
     </Directory>

    ErrorLog /var/log/httpd/eservice.pmeat.gov.bd-error.log
    CustomLog /var/log/httpd/eservice.pmeat.gov.bd-access.log combined
 </VirtualHost>

Certbot is a tool that simplifies the process for obtaining SSL certificates from Let’s Encrypt and auto-enabling HTTPS on your server. 3.1.Install Certbot The certbot package is provided by EPEL and mod_ssl is also required for the Encryption.First,we are need install EPEL and mod_ssl

yum install epel-release

The EPEL repository is enabled - Installing Certbot

yum install certbot certbot-apache mod_ssl -y

3.2.Setting up the SSL certificate

certbot --apache -d eservice.pmeat.gov.bd www.eservice.pmeat.gov.bd

Step 4.Test https://www.ssllabs.com/ssltest/