I am using Apache httpd and have the following VirtualHost configuration:
<VirtualHost *:443>
ServerName www.test.site
ServerAlias test.site
DocumentRoot /var/www/test.site/html
ErrorLog /var/www/test.site/log/error.log
CustomLog /var/www/test.site/log/requests.log combined
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
<Directory /var/www/html>
AllowOverride none
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.test.site
ServerAlias test.site
DocumentRoot /var/www/test.site/html
</VirtualHost>
When entering http://test.site in my browser, I see what I want to see.
However, https://test.site returns the Apache test page, even though I specified literally the same DocumentRoot.
What could be the reason? Thanks in advance.
I tried changing the VirtualHost configuration.
I created new certificates, there are no errors with them.
2
Answers
Well, I finally found the problem. In the /etc/httpd/conf.d/ folder, there is an ssl.conf, which contains:
Deleting this, or changing
default
to123.123.123.123
, solves the problem, although it is arguably not an elegant solution.Try to delete file 000-default.conf or 000-default-ssl.conf from dir sites-enabled, if exist this one.
Then change
To
Good practice to make dummy virtualhost to first place on virtualhost config, like below.
Maybe it is helpful.