Ссылки:
1 |
https://linuxconfig.org/how-to-install-mod-ssl-on-redhat-8 |
Установка ssl:
1 |
dnf install mod_ssl apache2 |
Перезапускаем и проверяем:
1 2 3 |
systemctl restart httpd apachectl -M | grep ssl ssl_module (shared) |
Настройка фаервола:
1 2 |
firewall-cmd --zone=public --permanent --add-service=https firewall-cmd --reload |
Генерация ключей:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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 2 3 4 5 6 7 8 9 10 |
1. /etc/httpd/conf.d/redirect_http.conf ------------------------------------ <VirtualHost _default_:80> Servername rhel8 Redirect permanent / https://rhel8/ </VirtualHost> ------------------------------------ 2. systemctl reload httpd |