LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-12-2019, 09:45 AM   #1
witchkinkofangmar
Member
 
Registered: May 2019
Posts: 32

Rep: Reputation: Disabled
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>
 
Old 09-12-2019, 10:26 AM   #2
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,778

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
That usually means there’s no index.htm(l) in the DocumentRoot
What’s in the DocumentRoot?
 
1 members found this post helpful.
Old 09-13-2019, 02:30 PM   #3
witchkinkofangmar
Member
 
Registered: May 2019
Posts: 32

Original Poster
Rep: Reputation: Disabled
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.
 
Old 09-13-2019, 02:39 PM   #4
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,778

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
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.

Last edited by scasey; 09-13-2019 at 02:40 PM.
 
Old 09-13-2019, 03:23 PM   #5
witchkinkofangmar
Member
 
Registered: May 2019
Posts: 32

Original Poster
Rep: Reputation: Disabled
In the main httpd.conf:

Code:
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
 
Old 09-13-2019, 03:31 PM   #6
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,778

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


Reply

Tags
apache 2.4.7, centos7, virtualhosts


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pidgin (IM) not listing Office Communicator protocol even though MS Communicator plugin is installed aniruddha.jagdale Linux - Desktop 3 12-22-2015 06:18 PM
virtual host generating 408 errors even though file is served correctly slackist Linux - Server 0 09-23-2014 09:45 PM
[SOLVED] Changing my site's domain - need to set up an Apache virtual host for 301 redirects Pyplate Linux - Networking 3 07-15-2013 04:57 AM
webmin error: unable to open a webpage even though virtual server in apache is added arvindikchari Linux - Newbie 2 08-03-2010 08:33 AM
Mouse scrolly doesn't work, even though added axis option in config file. RHLinuxGUY Slackware 8 07-22-2005 11:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration