The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 04:50 AM
Squid Browsing problem teenasuresh Linux 0 12-31-2007 05:54 AM
Thread browsing during search tayyabq8 Post Here to Contact Site Administrators and Moderators 4 02-05-2007 09:46 AM
Change the root directory for apache, sshd and ftpd Sergiu-IT IP Networking 3 07-05-2006 06:47 AM
Browsing Unix Source Code via the Web Perderabo News, Links, Events and Announcements 0 12-16-2002 10:43 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-25-2004
ezekiel61 ezekiel61 is offline
Registered User
  
 

Join Date: Feb 2002
Location: HELLena, MT
Posts: 14
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
  #2 (permalink)  
Old 09-25-2004
fnoyan fnoyan is offline
Registered User
  
 

Join Date: Nov 2003
Posts: 17
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...
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0