The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Browsing the Web the old-fashioned way iBot UNIX and Linux RSS News 0 04-24-2008 01:50 AM
Squid Browsing problem teenasuresh Linux 0 12-31-2007 01:54 AM
Thread browsing during search tayyabq8 Post Here to Contact Site Administrators and Moderators 4 02-05-2007 05:46 AM
Change the root directory for apache, sshd and ftpd Sergiu-IT IP Networking 3 07-05-2006 03:47 AM
Browsing Unix Source Code via the Web Perderabo News, Links, Events and Announcements 0 12-16-2002 06:43 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-24-2004
Registered User
 

Join Date: Feb 2002
Location: HELLena, MT
Posts: 13
Stumble this Post!
apache directory browsing

How do i prevent clients from browsing directory structures if there is no index.html in a directory?

For example, lets say that i dynamically create directories on in my doc root of an apache based web server. I know if i type the url and there is no index or default page in there, then apache will allow the browser to see all the files in that directory. I don't want this, I'd rather force a redirect or a 404 or anything but letting them see my document.

Any ideas?

System:
FreeBSD 5.2.1 64-Bit
www: apache 2
__________________
g_M_e
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-24-2004
Registered User
 

Join Date: Nov 2003
Posts: 17
Stumble this Post!
hi
I could not understand you exactly. But I have some suggestion, hope helps.....
1 ) change the mode of your diresctory to 700 or 600 something that does not allow "other" user to see your directory content. This will show a "Forbidden" message on the browser screen. But, by the way you cannot list directory content even your docs!

2 ) edit your httpd.conf file (it must be under /usr/local/apache/con in FreeBSD, I am not sure!) and find the lines below

<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.htm
</IfModule>

I your documents are in HTML or TXT format add the name of your file to the list and restart your server.

<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.htm my_doc.html
</IfModule>

something/apache/bin/apachectl restart

Now, your browser assumes that "my_doc.html" is an index page.

Bye...
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0