LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache Virtual Host redirects to directory listing even though config is same as Vhosts that work (https://www.linuxquestions.org/questions/linux-newbie-8/apache-virtual-host-redirects-to-directory-listing-even-though-config-is-same-as-vhosts-that-work-4175660796/)

witchkinkofangmar 09-12-2019 09:45 AM

Apache Virtual Host redirects to directory listing even though config is same as Vhosts that work
 
All other Vhosts are working correctly.

Code:

<VirtualHost *:80>
        Redirect / https://site.name.com
        DocumentRoot /var/www/html/site.name.com
        ServerName site.name.com
        ErrorDocument 404 /notfound.php
        <Directory "/var/www/html/site.name.com">
                Options FollowSymLinks ExecCGI
                AllowOverride all
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>
<VirtualHost *:443>
        DocumentRoot /var/www/html/site.name.com
        ServerName site.name.com
        ErrorDocument 404 /notfound.php
        SSLEngine on
        SSLCertificateFile /.....
        SSLCertificateKeyFile /.....
        SSLCertificateChainFile /.....
        SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
        SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
        SSLHonorCipherOrder On
        SSLCompression off
        <Directory "/var/www/html/site.name.com">
                Options FollowSymLinks ExecCGI
                AllowOverride all
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>


scasey 09-12-2019 10:26 AM

That usually means there’s no index.htm(l) in the DocumentRoot
What’s in the DocumentRoot?

witchkinkofangmar 09-13-2019 02:30 PM

There was only 1 file but it was an index.html file. All I added to make it work was:

Code:

DirectoryIndex index.html
Not sure why that was necessary though since none of the others specifically had that.

scasey 09-13-2019 02:39 PM

What is the value of DirectoryIndex in the main httpd.conf?
That directive has to be set somewhere. On my server it's set globally.

If your question is solved, you can mark it so with the Thread Tools.

witchkinkofangmar 09-13-2019 03:23 PM

In the main httpd.conf:

Code:

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>


scasey 09-13-2019 03:31 PM

^^Hmmm. Strange. That should be all you needed, unless there's some other place dealing with
directives of /var/www/html/site.name.com


All times are GMT -5. The time now is 12:43 PM.