mod_ssl ignores DocumentRoot

Issues related to applications and software problems
Post Reply
wp.rauchholz
Posts: 133
Joined: 2016/11/20 11:58:45

mod_ssl ignores DocumentRoot

Post by wp.rauchholz » 2019/02/12 18:48:11

I run a CENTOS 7 headless server, latests update.
  • I setup Apache server with minimal changes to configuration to initial httpd.conf. I changed only ServerAdmin and ServerName. I restarted the and the webserver pointed to DocumentRoot /var/www/html
  • I setup then Apache Virtual Hosts configuration, adding to httpd.conf IncludeOptional sites-enabled/*.conf and creationg these directories and correspondent config files. I restarted and the webserver pointed now to the new DocumentRoot (/var/www/<domain>/html
  • I installed then mod_ssl and restarted the webserver. Now webserver back again to /var/www/html instead of to the DocumentRoot of the virtual host.
This is the content of the virtual host file:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName www.wo-lar.com
ServerAlias wo-lar.com
DocumentRoot /var/www/wo-lar.com/html
ErrorLog /var/log/httpd/wo-lar_error.log
CustomLog /var/log/httpd/wo-lar_requests.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/wo-lar.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/wo-lar.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/wo-lar.com/chain.pem
</VirtualHost>
</IfModule>

Any idea why? I did not do any further changes to httpd.conf not ssl.conf.

Thanks for your help.

Wolfgang

wp.rauchholz
Posts: 133
Joined: 2016/11/20 11:58:45

Re: mod_ssl ignores DocumentRoot

Post by wp.rauchholz » 2019/02/13 09:44:02

In case somebody runs into the same issue.
One solution (worked for me) is to comment out the virtual host commands in ssl.conf and move them into the conf file of the virtual host itself.

Wolfgang

Post Reply