Рубрики
CentOS

httpd \ apache2 \ ssl \ centos

Ссылки:

https://linuxconfig.org/how-to-install-mod-ssl-on-redhat-8

Установка ssl:

dnf install mod_ssl apache2

Перезапускаем и проверяем:

systemctl restart httpd
apachectl -M | grep ssl
  ssl_module (shared)

Настройка фаервола:

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

Генерация ключей:

0.
openssl req -newkey rsa:2048 -nodes -keyout /etc/pki/tls/private/httpd.key -x509 -days 365 -out /etc/pki/tls/certs/httpd.crt

1.
ls -l /etc/pki/tls/private/httpd.key /etc/pki/tls/certs/httpd.crt

2. /etc/httpd/conf.d/ssl.conf
FROM:
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
TO:
SSLCertificateFile /etc/pki/tls/certs/httpd.crt
SSLCertificateKeyFile /etc/pki/tls/private/httpd.key

3.
systemctl reload httpd

Redirect http to https:

1.
/etc/httpd/conf.d/redirect_http.conf
------------------------------------

        Servername rhel8
        Redirect permanent / https://rhel8/

------------------------------------
2.
systemctl reload httpd