Monday, March 4, 2024

Install SSL Let’s Encrypt di CentOS 7 untuk Apache

- hostname
- nano /etc/hosts

yum install epel-release
yum install certbot python2-certbot-apache mod_ssl -y

nano /etc/httpd/conf.d/cloud.conf

<VirtualHost *:80>
    DocumentRoot "/var/www/html/nextcloud"
    ErrorLog "/var/log/httpd/test.error_log"
    CustomLog "/var/log/httpd/test.access_log" common

certbot --apache -d
certbot --apache

yum install cronie -y
crontab -e

Let’s Encrypt recommends the automatic renew cronjob to run twice a day, to do that add the following line and then save and exit the crontab:

* */12 * * * /usr/bin/certbot renew >/dev/null 2>&1

nano /etc/htppd/conf/httpd.conf

<IfModule mod_headers.c>
    Header always add Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"

systemctl restart httpd

sumber :
How to install Let’s Encrypt on CentOS 7 with Apache
(Visited 87 times, 1 visits today)
Baca Juga :  Cara mengaktifkan HTTPS dengan certobot/letsencrypt di Amazon Linux 2 dengan nginx

Similar Posts