Apache

How to Install Apache mod_ssl module on CentOS

mod_ssl is an optional Apache Module which provides SSL and TLS support for the Apache Web Server. The mod_ssl package was created in April 1998 by Ralf S. Engelschall and was originally derived from software developed by Ben Laurie.

In this article I will show you how to install Apache mod_ssl on CentOS.

Install Apache mod_ssl Module

First of all check the mod_ssl installed and enabled on your server using below command.

# apachectl -M
Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_file_module (shared)
 authn_alias_module (shared)
 authn_anon_module (shared)
 authn_dbm_module (shared)
 authn_default_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 authz_owner_module (shared)
 authz_groupfile_module (shared)
 authz_dbm_module (shared)
 authz_default_module (shared)
 ldap_module (shared)
 authnz_ldap_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 env_module (shared)
 ext_filter_module (shared)
 mime_magic_module (shared)
 expires_module (shared)
 deflate_module (shared)
 headers_module (shared)
 usertrack_module (shared)
 setenvif_module (shared)
 mime_module (shared)
 dav_module (shared)
 status_module (shared)
 autoindex_module (shared)
 info_module (shared)
 dav_fs_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 actions_module (shared)
 speling_module (shared)
 userdir_module (shared)
 alias_module (shared)
 substitute_module (shared)
 rewrite_module (shared)
 proxy_module (shared)
 proxy_balancer_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_ajp_module (shared)
 proxy_connect_module (shared)
 cache_module (shared)
 suexec_module (shared)
 disk_cache_module (shared)
 cgi_module (shared)
 version_module (shared)
 fcgid_module (shared)
 php5_module (shared)
 ssl_module (shared)
Syntax OK

As you can see ssl_module (shared) is installed on enabled on your server if you did not get ssl_module (shared) in output means it is not enabled or installed on your server.

Follow the below command to install mod_ssl module.

# yum install mod_ssl

Configure Apache mod_ssl mime_module

After installing mod_ssl on you server now configure it.

Edit the mod_ssl Apache configuration file located at /etc/httpd/conf.d/ssl.conf.

Now enable name based virtual hosting on port 443. For this add following line just before the SSL Virtual Host Context comment.

NameVirtualHost *:443

Disable the Default HTTPS Host

If you want to disable HTTPS host just comment out all the line following the SSL Virtual Host Context comment like below:

#NameVirtualHost *:443

Next restart Apache service.

# service httpd restart
Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment