Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: SOLVED : Apache2 serving up directory listings |
|
Author |
|
trotskyicepick
Joined: 04 Oct 2010 Posts: 7
|
Posted: Thu 14 Oct '10 23:10 Post subject: SOLVED : Apache2 serving up directory listings |
|
|
Have just downgraded Apache2 to v2.0.63 from 2.2.15 and all of a sudden it is serving up directory listings. I have the following in my conf file:
<VirtualHost *:8080>
ServerName xxxxxx.com
DirectoryIndex index.php index.html index.htm
DocumentRoot "C:/www/xxxxxx"
ServerAlias www.xxxxxx.com
AddType application/x-httpd-php .php
ErrorLog "logs/xxxxxx.com-error.log"
CustomLog "logs/xxxxxx.com-access.log" common
<Directory "c:/www/xxxxxx">
Options FollowSymLinks Indexes
Allow from all
Order Allow,Deny
AllowOverride None FileInfo
</Directory>
</VirtualHost>
This previously worked fine, I have no idea if something else has changed.
Please advise, I know this is something simple but it's late and it's driving me nuts.
Thanks in Advance.
Last edited by trotskyicepick on Fri 15 Oct '10 22:32; edited 1 time in total |
|
Back to top |
|
VoodooMill
Joined: 11 Jan 2007 Posts: 60
|
Posted: Fri 15 Oct '10 0:25 Post subject: Re: Apache2 serving up directory listings and I don't know w |
|
|
trotskyicepick wrote: | Have just downgraded Apache2 to v2.0.63 from 2.2.15 and all of a sudden it is serving up directory listings. I have the following in my conf file:
<VirtualHost *:8080>
ServerName xxxxxx.com
DirectoryIndex index.php index.html index.htm
DocumentRoot "C:/www/xxxxxx"
ServerAlias www.xxxxxx.com
AddType application/x-httpd-php .php
ErrorLog "logs/xxxxxx.com-error.log"
CustomLog "logs/xxxxxx.com-access.log" common
<Directory "c:/www/xxxxxx">
Options FollowSymLinks Indexes
Allow from all
Order Allow,Deny
AllowOverride None FileInfo
</Directory>
</VirtualHost>
This previously worked fine, I have no idea if something else has changed.
Please advise, I know this is something simple but it's late and it's driving me nuts.
Thanks in Advance. |
Hey there,
Directory listings are displaying because 1) there is no default file present in the directory and 2) you have Indexes enabled in your list of Options. |
|
Back to top |
|
trotskyicepick
Joined: 04 Oct 2010 Posts: 7
|
Posted: Fri 15 Oct '10 2:43 Post subject: |
|
|
Hi Voodoo, thanks for responding. I now have:
<VirtualHost *:80>
ServerName andrewpc.com
DirectoryIndex index.php index.html index.htm
DocumentRoot "C:/Apache Group/Apache2/htdocs"
ServerAlias www.andrewpc.com
AddType application/x-httpd-php .php
</VirtualHost>
<VirtualHost *:8080>
ServerName xxxxxx.com
DirectoryIndex index.php index.html index.htm
DocumentRoot "C:/www/xxxxxx"
ServerAlias www.xxxxxx.com
AddType application/x-httpd-php .php
ErrorLog "logs/xxxxxx.com-error.log"
CustomLog "logs/xxxxxx.com-access.log" common
<Directory "c:/www/xxxxxx">
Options FollowSymLinks
Allow from all
Order Allow,Deny
AllowOverride None FileInfo
</Directory>
</VirtualHost>
Not sure what you mean by default file, I though that was the DirectoryIndex setting (forgive my ignorance). |
|
Back to top |
|
VoodooMill
Joined: 11 Jan 2007 Posts: 60
|
Posted: Fri 15 Oct '10 3:19 Post subject: |
|
|
trotskyicepick wrote: | Hi Voodoo, thanks for responding. I now have:
<VirtualHost *:80>
ServerName andrewpc.com
DirectoryIndex index.php index.html index.htm
DocumentRoot "C:/Apache Group/Apache2/htdocs"
ServerAlias www.andrewpc.com
AddType application/x-httpd-php .php
</VirtualHost>
<VirtualHost *:8080>
ServerName xxxxxx.com
DirectoryIndex index.php index.html index.htm
DocumentRoot "C:/www/xxxxxx"
ServerAlias www.xxxxxx.com
AddType application/x-httpd-php .php
ErrorLog "logs/xxxxxx.com-error.log"
CustomLog "logs/xxxxxx.com-access.log" common
<Directory "c:/www/xxxxxx">
Options FollowSymLinks
Allow from all
Order Allow,Deny
AllowOverride None FileInfo
</Directory>
</VirtualHost>
Not sure what you mean by default file, I though that was the DirectoryIndex setting (forgive my ignorance). |
Yep, so by default file that would be any of the files listed in your DirectoryIndex line. When someone visits. for example, http://www.site.com/folder/ Apache looks for the files listed for DirectoryIndex (in your case index.php, index.html, index.htm), starting with the first file in the list. If none of those files are found in the folder, and you have Indexes listed as one of your Options it will display the Directory Listing. |
|
Back to top |
|
trotskyicepick
Joined: 04 Oct 2010 Posts: 7
|
Posted: Fri 15 Oct '10 7:27 Post subject: |
|
|
Stupid me, only when I looked properly did I notice that the directory being loaded by the browser is the default /apache2/htdocs directory.
So for some reason Apache is completely ignoring my virtualhost setup. |
|
Back to top |
|
trotskyicepick
Joined: 04 Oct 2010 Posts: 7
|
Posted: Fri 15 Oct '10 22:31 Post subject: |
|
|
Gone back to Apache2 v2.2.15 with the following:
<VirtualHost *:80>
ServerName andrewpc.com
DirectoryIndex index.html index.htm index.php
DocumentRoot "C:/Apache Software Foundation/Apache2.2/htdocs"
ServerAlias www.andrewpc.com
</VirtualHost>
<VirtualHost *:80>
ServerName xxxxxx.com
DirectoryIndex index.html index.htm index.php
DocumentRoot "C:/www/xxxxxx"
ServerAlias www.xxxxxx.com
ErrorLog "C:/Apache Software Foundation/Apache2.2/logs/xxxxxx.com-error.log"
CustomLog "logs/xxxxxx.com-access.log" common
<Directory "C:/www/xxxxxx/">
# Options FollowSymLinks
Allow from all
# Order Allow,Deny
# AllowOverride FileInfo
</Directory>
and it works fine,but no doubt now I'll have the PHP issues that prompted the downgrade in the first place....c'est la vie. |
|
Back to top |
|
|
|
|
|
|