Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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>
share|improve this question
    
Does /var/www/html/websites/https_domain.co.uk/ exist? and is it readable by the apache user (usually www-data)? –  wrdevos Nov 5 '13 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)?" –  Steve Hamber Nov 5 '13 at 16:07

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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