Apache Virtual host (SSL) Doc Root issue
Posted
by
Steve Hamber
on Server Fault
See other posts from Server Fault
or by Steve Hamber
Published on 2013-11-05T15:53:01Z
Indexed on
2013/11/05
15:56 UTC
Read the original article
Hit count: 292
I am having issues with the SSL document root of my vhosts configuration. Http sees to work fine and navigates to the root directory and publishes the page fine -
DocumentRoot /var/www/html/websites/ssl.domain.co.uk/ (as specified in my vhost config)
However, https seems to be looking for files in the main apache document root found further up the httpd.conf file, and is not being overwritten by the vhost config. (I assume that vhost config does overwrite the default doc root?).
DocumentRoot: The directory out of which you will serve your documents. By default, all requests are taken from this directory, but symbolic links and aliases may be used to point to other locations.
DocumentRoot "/var/www/html/websites/"
Here is my config, I am quite a new Linux guy so any advise is appreciated on why this is happening!?
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:443>
ServerAdmin root@localhost
DocumentRoot /var/www/html/websites/https_domain.co.uk/
ServerName ssl.domain.co.uk
ErrorLog /etc/httpd/logs/ssl.domain.co.uk/ssl.domain.co.uk-error_log
CustomLog /etc/httpd/logs/ssl.domain.co.uk/ssl.domain.o.uk-access_log common
SSLEngine on
SSLOptions +StrictRequire
SSLCertificateFile /var/www/ssl/ssl_domain_co_uk.crt
SSLCertificateKeyFile /var/www/ssl/domain.co.uk.key
SSLCACertificateFile /var/www/ssl/ssl_domain_co_uk.ca-bundle
</VirtualHost>
<VirtualHost *:80>
ServerAdmin root@localhost
DocumentRoot /var/www/html/websites/ssl.domain.co.uk/
ServerName ssl.domain.co.uk
ErrorLog /etc/httpd/logs/ssl.domain.co.uk/ssl.domain.xo.uk-error_log
CustomLog /etc/httpd/logs/ssl.domain.co.uk/ssl.domain.xo.uk-access_log common
</VirtualHost>
© Server Fault or respective owner