You are not logged in.

#1 2012-04-06 13:19:53

sbtkd85
Member
Registered: 2012-04-06
Posts: 2

[Closed] Apache +Indexes Directory Listing

I've Googled extensively but I haven't gotten this to work. Hopefully someone here can point me in the right direction. I'm running Arch x86_64 installed LAMP via ArchWiki guide. I'm trying to get directory contents listing to work with mod_alias and mod_autoindex. I've enabled Indexes but all I get back is a 404 page not found from Apache. Checking logs only shows cache misses and 404 when trying to access the Alias path (see below)

/etc/http/conf/http.conf:

LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
...
<Directory "/srv/http">
  Options Indexes FollowSymLinks
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>

<IfModule dir_module>
  DirectoryIndex index.html index.php
</IfModule
...
Include conf/extra/httpd-test-dir.conf

Contents of /etc/http/conf/extra/http-test-dir.conf

Alias /test_dir "/home/user/dir"
<Directory "/home/user/dir">
  AllowOverride All
  Options Indexes FollowSymLinks MultiViews
  IndexOptions FancyIndexing
  Order allow,deny
  Allow from all
</Directory>

I don't want to use the userdir_module (mod_userdir.so) because I don't want every user to be able to create a public_html folder and serve up pages. Permissions of /home/user/dir/ are:

drwxr-xr-x

Same permissions for every folder from / to get to /home/user/dir/

Contents of /home/user/dir/ are a bunch of .log files and one .html file but nothing named index.html/index.php.

I thought at first it was an issue with the DirectoryIndex option as part of the dir_module but commenting out the LoadModule and IfModule lines and restarting apache didn't help at all.

I am able to get the files if I type the path in manually. So browsing to http://hostname/test_dir/2012-04-06/filename.log shows me the log file. I'd like to be able to list the directories/files in test_dir (/home/user/dir/) and click and browse manually since the logs will be generated daily and have a different path every day (folder name is based on date).

Any insights or guidance would be greatly appreciated.

Last edited by sbtkd85 (2012-04-06 20:03:52)

Offline

#2 2012-04-06 20:05:09

sbtkd85
Member
Registered: 2012-04-06
Posts: 2

Re: [Closed] Apache +Indexes Directory Listing

Found a fix. It was Passenger that was causing issues. I had to modify httpd-test-dir.conf like this:

Alias /test_dir "/home/user/dir"
<Directory "/home/user/dir">
  AllowOverride All
  Options Indexes FollowSymLinks MultiViews
  IndexOptions FancyIndexing
  PassengerEnabled off    <---------------Added this and restarted Apache
  Order allow,deny
  Allow from all
</Directory>

Offline

Board footer

Powered by FluxBB