Apache Indexes stopped working

]SK[

One of Freddy's beloved
Joined
Dec 22, 2003
Messages
302
Ive not made a single change to the configs for maybe 6 months. Noticed today that its stopped listing folder contents. Ideas on why it would just do this out of the blue?

Code:
NameVirtualHost 10.50.2.4
<VirtualHost 10.50.2.4>
DocumentRoot /home/homepage/www
ServerName test.homepage
<Directory /home/homepage/www>
AllowOverride Options Indexes FileInfo
Order allow,deny
Allow from all
</Directory>
ServerAdmin an@example.com
</VirtualHost>
 

Athan

Resident Freddy
Joined
Dec 24, 2003
Messages
1,063
Has the apache been restarted in the last 6 months :p ? (i.e. not picked up a config change in that long)

Otherwise... what are you counting as configs? Has some .htaccess file popped up/been changed ? Is mod_autoindex still configured to load, and actually present and loading ok ?

-Ath
 

]SK[

One of Freddy's beloved
Joined
Dec 22, 2003
Messages
302
Code:
Loaded Modules  core prefork http_core mod_so mod_access mod_auth mod_auth_anon mod_auth_digest mod_include mod_log_config mod_env mod_expires mod_headers mod_usertrack mod_setenvif mod_mime mod_status [b]mod_autoindex[/b] mod_asis mod_info mod_cgi mod_vhost_alias mod_negotiation mod_dir mod_imap mod_actions mod_userdir mod_alias mod_rewrite mod_auth_mysql mod_php4

No .htaccess

Ill have to check to make sure the right config is loading later.
 

Athan

Resident Freddy
Joined
Dec 24, 2003
Messages
1,063
Back to the obvious... what EXACTLY is the symptom ? If it's not listing folder contents, what is it doing instead?

I'm hoping I'm correct in assuming it's not just 403'ing :p ? (Which may simply indicate directory permissions have changed).

-Ath
 

]SK[

One of Freddy's beloved
Joined
Dec 22, 2003
Messages
302
I dont remember seeing a 403. Just the Forbidden message and then the apache version etc. The site works in that index.htm etc is being read and I can hot link to files. Just not do a directory listing.

I b0rked my router over the weekend and cant get access to the site remotly now. Must have missed it out on the port forwarding. Ill check later.
 

]SK[

One of Freddy's beloved
Joined
Dec 22, 2003
Messages
302
OK so I can get on remotly...

Code:
Forbidden

You don't have permission to access /demos/ on this server.
Apache-AdvancedExtranetServer/2.0.47 (Mandrake Linux/6.5.92mdk) auth_mysql/1.11 PHP/4.3.2 Server at test.homepage Port 80

It must be the correct config as if I remove this virtual host and restart the site fails.
 

Athan

Resident Freddy
Joined
Dec 24, 2003
Messages
1,063
403 == Forbidden (I had to go view Page Info on firefox to confirm this to get the right error code for my post :p).

So, first off, check file permissions down the entire path to the affected directory as the user the Apache serves requests as. Hopefully 'su - apache' (or whatever the user is) will give a shell to allow you to do this.

Edit: And note that if the directory permissions happen to be something like drwx--x--x then index.htm will work, but you won't be able to get a directory listing (x on a directory allows to 'search' it, i.e. cd into it and access filenames in it, but without 'r' you can't straight off read the entire directory contents).

-Ath
 

]SK[

One of Freddy's beloved
Joined
Dec 22, 2003
Messages
302
drwxrwxr-x 3 homepage homepage 4096 Nov 24 16:31 demos/

I can view all folders and their contents when using the apache logon.
 

Athan

Resident Freddy
Joined
Dec 24, 2003
Messages
1,063
This is the stage where I'd personally get strace out to see where access is failing.

The problem with this is you'll have multiple apache processes (pre-forking) and no way to know which one will get hit by a given request. So, for *each* running apache process you'll want something like:

Code:
strace -p <process id> -f -ff -o apache-<process id>

-p should be obvious, -f and -ff are to follow children (forks) and put output in separate files (.<child pid> will be appended to...), and -o is to place output in that file.

Of course if you don't know much about the C/Unix APIs you won't be able to interpret the results :p.

-Ath
 

Users who are viewing this thread

Top Bottom