Friday, October 31, 2014

Apache Virtual host (SSL) Doc Root issue

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


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




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

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...