0

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>
2
  • Does /var/www/html/websites/https_domain.co.uk/ exist? and is it readable by the apache user (usually www-data)?
    – wrdevos
    Nov 5, 2013 at 16:00
  • The path does exist and the permissions are the same on every directory. Not sure what or how i check this - "and is it readable by the apache user (usually www-data)?"
    – user191828
    Nov 5, 2013 at 16:07

1 Answer 1

0

Try specifying the IP responding to SSL requests on the SSL Virtual HOST,

Something like

<VirtualHost 192.12.13.1:443>

You should also check Apache Acces Log to see which vhost is responding.

You must log in to answer this question.