Recently I faced another issue during Apache restart. When I ran “httpd -t” command to check Apache configuration. I got ” module ssl_module is already loaded, skipping ” or ” module rewrite_module is already loaded, skipping” warning message during test. This happened because ssl module or rewrite module was already enabled more than 1 place. If you have more virtual host configuration file in Apache, it is very difficult to find where ssl module or rewrite module line is define.
In this article I will explain you how to fix these type of warning message easily.
Fix module is already loaded, skipping warning in Apache/HTTPD
Follow these below steps to fix these type of issue.
How to find out syntax error in Apache configuration file ?
Execute below command to check for error.
For Debian Linux :
# /usr/sbin/apache-perl -t
You will get command output something like below:
[Fri Jun 08 11:12:19 2012] [warn] module ssl_module is already loaded, skipping [Fri Jun 08 11:12:19 2012] [warn] module rewrite_module is already loaded, skipping Syntax OK
For Redhat Linux :
command output: [Fri Jun 08 11:12:19 2012] [warn] module ssl_module is already loaded, skipping [Fri Jun 08 11:12:19 2012] [warn] module rewrite_module is already loaded, skipping Syntax OK
To fix above warning message, first we will use grep command to find “ssl_module” word in all configuration file. Follow these below command to find out these lines.
# grep ssl_module -rI /etc/httpd/* conf/httpd.conf:LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so conf.d/ssl.conf:LoadModule ssl_module modules/mod_ssl.so
# grep rewrite_module -rI /etc/httpd/* conf/httpd.conf:LoadModule rewrite_module /usr/lib64/httpd/modules/mod_rewrite.so conf.d/ssl.conf:LoadModule ssl_module modules/mod_rewrite.so
Run the same grep command for Apache on Ubuntu system.
# grep ssl_module -rI /etc/apche2/* # grep rewrite_module -rI /etc/apche2/*
You can see there are two file found where ssl_module or rewrite_module is define.
We can load all needed modules in one place /etc/httpd/conf/httpd.conf for httpd or /etc/apache2/apache2.conf file. So we can remove or comment out it from /etc/httpd/conf.d/ssl.conf file or /etc/apache2/apache2.conf .
Example for httpd on CentOS/Unix :
# vim /etc/httpd/conf.d/ssl.conf # LoadModule ssl_module modules/mod_ssl.so # LoadModule rewrite_module
commend out ssl_module or rewrite_module and exit after saving file.
Example for Apache on Ubuntu/Debian
# LoadModule ssl_module moduless/mod_ssl.so
# LoadModule rewrite_module modules/mod_rewrite.so
Now run again syntax check command and check
For httpd on CentOS/Unix system
#httpd -t Syntax OK
For apache on Ubuntu/Debian system.
# /usr/sbin/apache-perl -t
You can see there are any warning.
Restart httpd service on Centos/Unix system.
# service httpd restart
Restart apach2 service on Centos/Unix system.
# service apache2 restart
I hope this article will be helpful to fix Apache ssl_module skipping warning if already loaded. If you have any queries and problem please comment in comment section.