View previous topic :: View next topic |
Author |
Message |
jcpunk n00b
Joined: 22 Jul 2003 Posts: 37
|
Posted: Tue Jan 27, 2004 9:36 pm Post subject: apache2 autoindexing |
|
|
I am trying to get apache2 to generate those nice index pages that it makes when there isnt an index in the directory. However, all I ever get is a 403 Forbidden error (error log below). I've got the important section from my commonapache2.conf below and I just cant figure out why this doesn't work. The directory /var/www/localhost/htdocs/thing is set to 755 permissions which should be enough. All of the other directories in the path are set to 755 as well. There are no .htaccess files any where on my computer so they cannot be getting in the way.
Parts of this config file were copied from a working Redhat 9 box with apache2.0.46, so I find it doubtful that apache2.0.47 would break enough things to prevent operation. Which leads me to conclude that I have made a grevious error some place.
In relation to this whenever I start apache2 I get the following message
Code: |
voltaire conf # /etc/init.d/apache2 start
* Starting apache2...
apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName ok
|
I think that this may have more to do with the actual problem then the configuration information below.... but it did start which is why I am not sure that it is an error message so much as a warning message.
commonapache2.conf
Code: |
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride None
<IfModule mod_access.c>
Order deny,allow
Deny from all
</IfModule>
</Directory>
<Directory /var/www/localhost/htdocs>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
<IfModule mod_access.c>
Order deny,allow
Deny from all
</IfModule>
</Directory>
<Directory /var/www/localhost/htdocs/thing>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
<IfModule mod_access.c>
Order deny,allow
Deny from all
</IfModule>
</Directory>
#many omitted lines
<IfModule mod_autoindex.c>
#
# FancyIndexing is whether you want fancy directory indexing or standard
#
IndexOptions FancyIndexing VersionSort NameWidth=* FoldersFirst IgnoreCase
#more omitted lines
ReadmeName README.html
HeaderName HEADER.html
#
# IndexIgnore is a set of filenames which directory indexing should ignore
# and not include in the listing. Shell-style wildcarding is permitted.
#
IndexIgnore .??* *~ *# HEADER* RCS CVS *,v *,t
</IfModule>
|
/var/log/apache2/error_log
Code: |
[Tue Jan 27 16:15:56 2004] [error] [client 10.2.6.101] client denied by server configuration: /var/www/localhost/htdocs/thing/
[Tue Jan 27 16:15:57 2004] [error] [client 10.2.6.101] client denied by server configuration: /var/www/localhost/htdocs/thing/
[Tue Jan 27 16:15:57 2004] [error] [client 10.2.6.101] client denied by server configuration: /var/www/localhost/htdocs/thing/
|
|
|
Back to top |
|
|
alexod n00b
Joined: 15 Mar 2003 Posts: 69
|
Posted: Tue Jan 27, 2004 9:58 pm Post subject: |
|
|
try replacing the
Code: |
<IfModule mod_access.c>
Order deny,allow
Deny from all
</IfModule>
|
from <Directory /var/www/localhost/htdocs> with
Code: |
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
|
and deleting the <Directory /var/www/localhost/htdocs/thing>-Block (it is redundant as all options for /var/www/localhost/htdocs are also in effect for its subdirectories).
This will allow web-access from everywhere to all files in /var/www/localhost/htdocs
See also http://httpd.apache.org/docs-2.0/mod/mod_access.html |
|
Back to top |
|
|
Diorf n00b
Joined: 05 Jun 2003 Posts: 52 Location: Paris
|
Posted: Wed Jan 28, 2004 1:17 pm Post subject: |
|
|
for the other error, you just have to put your server's name in the /etc/hosts file...
On the line beginning with "127.0.0.1 localhost" just add your hostname like :
127.0.0.1 localhost hostname
And the error should go away |
|
Back to top |
|
|
jcpunk n00b
Joined: 22 Jul 2003 Posts: 37
|
Posted: Wed Jan 28, 2004 7:14 pm Post subject: |
|
|
Thanks for the tip on /etc/hosts!
Sadly with those changes made to the commonapache.conf and restarting apache2 (/etc/init.d/apache2 restart), I still get the Forbidden error.
The following is in /var/log/apach2/error_log
Code: | [Wed Jan 28 14:24:01 2004] [error] [client 127.0.0.1] Directory index forbidden by rule: /var/www/localhost/htdocs/thing/ |
That strikes me as odd.......
I can provide any section of my apache logs or config files if requested. |
|
Back to top |
|
|
wiSHmaKeR n00b
Joined: 04 May 2004 Posts: 44 Location: Stara Zagora, Bulgaria
|
Posted: Thu May 06, 2004 2:50 pm Post subject: |
|
|
This version has a bug i think, I can't fix mine! I lost the whole day!
Now I'm trying an older version to see if there are problems. _________________ And all your wishes come true... |
|
Back to top |
|
|
wiSHmaKeR n00b
Joined: 04 May 2004 Posts: 44 Location: Stara Zagora, Bulgaria
|
Posted: Mon Aug 02, 2004 5:53 am Post subject: |
|
|
Today I upgraded to apache-2.0.50, and the problem is no longer there. Cheers! _________________ And all your wishes come true... |
|
Back to top |
|
|
lousyd Apprentice
Joined: 15 Mar 2003 Posts: 166 Location: Des Moines
|
Posted: Wed Sep 29, 2004 6:24 pm Post subject: Indexes |
|
|
I'm running Apache2 from a recent emerge. I had to explicitly enable indexing. I think it's supposed to be turned on by default, in the standard from-source installation, but that the Gentoo devs disabled it. I think. Anyway, in my "commonapache2.conf" file, I have:
Code: | <Directory /var/www/localhost/htdocs>
Options Indexes FollowSymLinks MultiViews
|
I can't say for 100% sure that this was what I had to change (take away a dash in front of "Indexes"), but I'm fairly sure. I hope that fixes your problem. Or that your problem has already been fixed.
As for the ServerName problem, there are other forum threads on it. The best one I've found says to specifically set ServerName in apache2.conf, and this worked for me. You can find that thread here:
https://forums.gentoo.org/viewtopic.php?p=1592832#1592832 _________________ Minds are like parachutes... Most people will do their damnedest to avoid having to use one. |
|
Back to top |
|
|
beandog Bodhisattva
Joined: 04 May 2003 Posts: 2072 Location: /usa/utah
|
Posted: Wed Dec 01, 2004 1:56 am Post subject: |
|
|
Okay -- I finally figured out how to do this, and recursively apply.
Code: | <Directory "/home/steve/public_html/*">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory> |
Steve _________________ If it ain't broke, tweak it. dvds | blurays | blog | wiki |
|
Back to top |
|
|
|