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

4

1 回答 1

9

万一其他人遇到这个问题,那是因为我在 mod_ssl 扩展之前加载了 vhosts 配置文件。

我将调用移到Include vhost调用下方Include conf.d/*.confhttpd.conf然后重新启动 Apache,它就可以工作了。

希望对某人有所帮助!

于 2017-10-24T15:34:45.197 回答