I am setting up SSL on my Apache/2.4.6 RHEL server. In httpd.conf
, have VirtualHosts as shown below...
<VirtualHost *:80>
ServerName foo.bar
Redirect permanent / https://foo.bar
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /path/to/file
ServerName foo.bar
SSLEngine on
SSLCertificateFile /path/to/file
SSLCertificateKeyFile /path/to/file
SSLCertificateChainFile /path/to/file
</VirtualHost>
When I comment out DocumentRoot in httpd.conf outside of the VirtualHosts, the web browser returns error 404 The requested URL / was not found on this server.
Do I need to have a DocumentRoot outside of VirtualHost *:443
? If not, what is going on when I comment it out?