Introduction
mod_ssl
is an Apache module that provides strong cryptography for the Apache Webserver through SSL v2/v3 and TLS v1. With this module you can use self-signed or 3rd party SSL certificates.
In this brief tutorial we will show you how to install the mod_ssl module on a CentOS VPS server using the root user and a basic configuration guide.
1. How to install the Apache mod_ssl module.
Run the mod_ssl install command
yum install mod_ssl
When asked if you want to download and install the package and all its dependencies, say yes by typing "y" and hit enter.
2. How to configure the Apache mod_ssl module
Open the mod_ssl Apache configuration file located at /etc/httpd/conf.d/ssl.conf
vi /etc/httpd/conf.d/ssl.conf
Save and edit the file.
Enable name-based virtual hosting on port 443 by adding the following text, just before the SSL Virtual Host Context comment
# Use name-base virtual hosting NameVirtualHost *:443
3. Disable the default https host.
https default host can be disabled by commenting out all text following the SSL Virtual Host Context comment
Restart the Apache HTTP Server
service httpd restart
4. Enable SSL traffic on your firewall.
Now that you have fixed setup basic configuration of the module. You need to make sure to allow SSL traffic on your firewall. In this case wi will use the following iptables
rule:
iptables -A INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT
5. Restart iptables firewall service
service iptables restart
Enjoy!
or