7

I'm trying to secure my server's vhosts. I installed LE/Certbot fine, and had no issues. I installed/upgraded any dependencies to get certbot to work, again they ran fine.

mod_ssl is installed and loaded. I ran phpinfo(), and in the LoadedModules section, I see mod_ssl.

However, in my vhosts file, when I use

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ... 
    </VirtualHost>
</IfModule>

That specific site <VirtualHost></VirtualHost> block is ignored (i.e. I can't access site defined in VirtualHost block) UNLESS I remove/comment out the ` wrapper.

httpd version:

$ httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Apr 12 2017 21:03:28

I can't find much online, so I'm a little stuck. I'm worried there's something more sinister that's going to catch me out if I don't figure out why.

Any help would be much appreciated!

Cheers

2
  • 1
    Try removing the .c, leaving <IfModule mod_ssl>. If that doesn't work, screw IfModule and just take it out of the wrapper.
    – user7192474
    Commented Oct 19, 2017 at 2:18
  • Hey, I appreciate the reply! I removed the .c and restarted apache, and still not luck. Yeah, that's what I'm going to have to. I just hope it's nothing serious!
    – Kingsley
    Commented Oct 19, 2017 at 13:29

1 Answer 1

11

In case anyone else runs into this issue, it's because I was loading the vhosts configuration files before the mod_ssl extension.

I moved the Include vhost call to below the Include conf.d/*.conf call, in httpd.conf and restarted Apache and it worked.

Hope that helps someone!

1
  • 2
    Literally spent 4 days researching this. I also have <IfModule mod_ssl.c> wrapper and I ended up resolving by switching the order of the IncludeOptional statements at the end of the http.conf file. Thank you for posting back here with your solution.
    – DanCue
    Commented Sep 1, 2018 at 1:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.