LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-11-2004, 06:11 PM   #1
DrJonesAC2
LQ Newbie
 
Registered: May 2003
Posts: 9

Rep: Reputation: 0
Question 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!
 
Old 09-11-2004, 06:45 PM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

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

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

to comment it out...
 
Old 09-11-2004, 07:01 PM   #3
DrJonesAC2
LQ Newbie
 
Registered: May 2003
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for the suggestion but I did as you said and that didn't work. Any other ideas???
 
Old 09-11-2004, 07:06 PM   #4
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Try setting "UseCanonicalName On".


Håkan
 
Old 09-11-2004, 07:20 PM   #5
DrJonesAC2
LQ Newbie
 
Registered: May 2003
Posts: 9

Original Poster
Rep: Reputation: 0
Still no luck. Same thing. (already was set that way)
 
Old 09-12-2004, 04:25 AM   #6
Cerbere
Member
 
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Directory Listing Of NFS Mount, cannot view directory list via apache luqmana Linux - Networking 2 12-19-2005 06:03 AM
Apache2 listing colabus Linux - Software 1 11-09-2005 06:51 PM
directory listing script linuxzouk Programming 2 06-04-2004 12:07 PM
Directory Listing mattbeekler Linux - Software 8 07-22-2003 02:27 PM
Listing a web directory Radicalm16 Linux - Software 3 06-14-2003 11:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration