Rocky 9.x Installing lets-encrypt SSL certificate
From Notes_Wiki
Home > Rocky Linux or CentOS > Rocky Linux 9.x > |Web Servers > Apache > Lets encrypt
To install lets-encrypt certificate on a machine for use with apache (httpd) use:
- dnf -y install epel-release mod_ssl
- dnf -y install certbot python3-certbot-apache
- certbot apache mode works only when NameVirtualHost is enabled and appropriate VirtualHost are created in apache. If this is not present then add configuration similar to below in '/etc/httpd/conf/httpd.conf' at bottom:
NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin saurabh@sbarjatiya.com DocumentRoot /var/www/html ServerName server.example.com ErrorLog logs/server.example.com-error_log CustomLog logs/server.example.com-access_log combined </VirtualHost>
- Then request certificate via:
- certbot --apache
- We may have to give email address, accept agreement and optionally agree to share details.
- After that we need to select virtualhosts for which we want to request TLS certificate.
Refer:
There are older articles on this at:
Home > Rocky Linux or CentOS > Rocky Linux 9.x > |Web Servers > Apache > Lets encrypt