mod_ssl on Rocky Linux in an Apache web server environment¶
The Apache web server has existed for many years now. mod_ssl provides greater security for the web server and is installable on almost any version of Linux.
This procedure will get you up and running with Rocky Linux and mod_ssl in an Apache web server environment.
Ensure that your goal is to have the website open to the world when you add this rule! If not, change the zone or configure the firewall to correct that.
At this point you should be able to access the Apache web server via HTTPS. Enter https://your-server-ip or https://your-server-hostname to confirm the mod_ssl configuration.
Generating a RSA private key
................+++++
..........+++++
writing new private key to '/etc/pki/tls/private/httpd.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:AU
State or Province Name (full name) []:
Locality Name (eg, city) [Default City]:
Organization Name (eg, company) [Default Company Ltd]:LinuxConfig.org
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:rocky8
Email Address []:
After this command completes, the following two SSL/TLS files will be there:
ls -l /etc/pki/tls/private/httpd.key /etc/pki/tls/certs/httpd.crt
-rw-r--r--. 1 root root 1269 Jan 29 16:05 /etc/pki/tls/certs/httpd.crt
-rw-------. 1 root root 1704 Jan 29 16:05 /etc/pki/tls/private/httpd.key
Configure Apache web server with the SSL/TLS certificates¶
To include your newly created SSL/TLS certificate into the Apache web server configuration open the ssl.conf file by running: