LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache2 Directory Listing issue (https://www.linuxquestions.org/questions/linux-software-2/apache2-directory-listing-issue-229470/)

DrJonesAC2 09-11-2004 06:11 PM

Apache2 Directory Listing issue
 
Hello all,
I am running Apache2 on Mandrake10 with just the defaults. I have an issue that I did not have with Apacke 1.3. I want to be able to view the contents of a directory if there is no index file (index.html/index.php) I have googled and searched this and other forums for a solution to my problem.
I am able to access and browse files that exist in the directories I go to but if I just try to bring up, for example, http://mysite.com/images/ to view a directory listing of the available images then I get the following error:

Forbidden

You don't have permission to access /images/ on this server.
Apache-AdvancedExtranetServer/2.0.48 (Mandrake Linux/6.3.100mdk) mod_perl/1.99_11 Perl/v5.8.3 mod_ssl/2.0.48 OpenSSL/0.9.7c DAV/2 PHP/4.3.4 Server at 127.0.0.1 Port 80

I know there is something to do with mod_autoindex but I think that I have everything configured properly. I include that section of my commonhttpd.conf file in case there is something I have missed.

#
# Directives controlling the display of server-generated directory listings.
#
<IfModule mod_autoindex.c>

#
# FancyIndexing is whether you want fancy directory indexing or standard
#
<IfDefine !APACHE2>
IndexOptions FancyIndexing NameWidth=*
</IfDefine>
<IfDefine APACHE2>
IndexOptions FancyIndexing VersionSort NameWidth=*
</IfDefine>
#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions. These are only displayed for
# FancyIndexed directories.
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.png) text/*
AddIconByType (IMG,/icons/image2.png) image/*
AddIconByType (SND,/icons/sound2.png) audio/*
AddIconByType (VID,/icons/movie.png) video/*

AddIcon /icons/binary.png .bin .exe
AddIcon /icons/binhex.png .hqx
AddIcon /icons/tar.png .tar
AddIcon /icons/world2.png .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.png .Z .z .tgz .gz .zip .bz2
AddIcon /icons/a.png .ps .ai .eps
AddIcon /icons/layout.png .html .shtml .htm .pdf
AddIcon /icons/text.png .txt
AddIcon /icons/c.png .c
AddIcon /icons/p.png .pl .py .php .php3
AddIcon /icons/f.png .for
AddIcon /icons/dvi.png .dvi
AddIcon /icons/uuencoded.png .uu
AddIcon /icons/script.png .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.png .tex
AddIcon /icons/bomb.png core

AddIcon /icons/back.png ..
AddIcon /icons/hand.right.png README
AddIcon /icons/folder.png ^^DIRECTORY^^
AddIcon /icons/blank.png ^^BLANKICON^^

#
# DefaultIcon is which icon to show for files which do not have an icon
# explicitly set.
#
DefaultIcon /icons/unknown.png

#
# AddDescription allows you to place a short description after a file in
# server-generated indexes. These are only displayed for FancyIndexed
# directories.
# Format: AddDescription "description" filename
#
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz

#
# ReadmeName is the name of the README file the server will look for by
# default, and append to directory listings.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes.
#
# If MultiViews are amongst the Options in effect, the server will
# first look for name.html and include it if found. If name.html
# doesn't exist, the server will then look for name.txt and include
# it as plaintext if found.
#
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>
# End of indexing directives.

I would appreciate any help on this I can get. It's been driving me insane since I upgraded!
Thanks!

Mega Man X 09-11-2004 06:45 PM

Wild guess, but try to place a hash (#) at the beginning of this line:

IndexIgnore .??* *~ *# HEADER* RCS CVS *,v *,t

to comment it out...

DrJonesAC2 09-11-2004 07:01 PM

Thanks for the suggestion but I did as you said and that didn't work. Any other ideas???

hw-tph 09-11-2004 07:06 PM

Try setting "UseCanonicalName On". :)


Håkan

DrJonesAC2 09-11-2004 07:20 PM

Still no luck. Same thing. (already was set that way)

Cerbere 09-12-2004 04:25 AM

Read the Apache documentation on the Options directive. You'll want something like the following:
Code:

<Directory /var/www/htdocs>
Options Indexes
  ...
</Directory>

or
Code:

<Directory /var/www/htdocs/area/with/indexes>
Options +Indexes
  ...
</Directory>

The first would provide indexing globally (replace /var/www/htdocs with your DocumentRoot), while the second would only provide indexing for a specific area of your site.

Enjoy!
--- Cerbere


All times are GMT -5. The time now is 12:50 AM.