apache directory browsing


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers apache directory browsing
# 1  
Old 09-25-2004
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  
Old 09-25-2004
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...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Runtime Error Enable user directory apache

Hi I am exactly according to this link CentOS 6 - Apache httpd - Enable Userdir : Server World I Enabled userDirectory Server version: Apache/2.2.15 CentOS release 6.8 (Final) But Iget this Error Forbidden You don't have permission to access /~mn/index.html on this server Goal... (2 Replies)
Discussion started by: mnnn
2 Replies

2. UNIX for Dummies Questions & Answers

Changing the Apache Installation directory in Linux

Hi All, I have installed apache using yum on centos. I know that the default installation directory is /var/www/html. Now I want to change the installation directory to /mnt/ebs. How can I do this ? (5 Replies)
Discussion started by: Palak Sharma
5 Replies

3. Web Development

Apache write permission issues to another user owned directory

Hi I am trying to make a web program which is command line equivalent. i have done the coding in cgi program in perl and html for basic forms to take inputs. when i ran the program from web application i see permission denied messages. after analyzing i found apache is running as wwwrun which... (2 Replies)
Discussion started by: rakeshkumar
2 Replies

4. Linux

Restricting directory access in Apache server

Hi all, I have a web site that I'm serving on an Apache server, and it has a number of different folders, but I only want the user to be able to access certain ones -- the majority of them I don't want the user to access. I tried modifying my /etc/apache2/conf.d/security file to do this, but I... (1 Reply)
Discussion started by: Zel2008
1 Replies

5. UNIX for Dummies Questions & Answers

Allowing a backup of a directory through apache/php

I've made a webpage has a button that backs up the /var/www directory to a mounted USB drive. Assume that the page that this is on is completely safe and there is no way that anyone can see it. (unless actually relevant) PHP code for the button: (I'm quite sure this isn't the issue, it works... (2 Replies)
Discussion started by: cuvvvie
2 Replies

6. Shell Programming and Scripting

Configuring Apache an php Directory root.

Hi , I have installed apache and configured Document root as /home DocumentRoot "/home" The files under home directory is listed on the web server, i have one text file under "/home/test/1.txt" i can view the file when i set DocumentRoot to /home. But when i change Document root to ... (1 Reply)
Discussion started by: asak
1 Replies

7. UNIX for Dummies Questions & Answers

Problem with Restricting Directory in Apache

Hello, I want to restrict access to our Subversion repositories to only our internal network. I have a virtual host directive setup in Apache for the IP and port 443. When I put the following: <Directory "/var/www/svn/"> Order allow,deny AllowOverride None Allow from 10.5.10.0/24 Allow... (1 Reply)
Discussion started by: mojoman
1 Replies

8. UNIX for Dummies Questions & Answers

Problem with Restricting Directory in Apache

Hello, I want to restrict access to our Subversion repositories to only our internal network. I have a virtual host directive setup in Apache for the IP and port 443. When I put the following: <VirtualHost 205.147.86.33:443> <Directory "/var/www/svn/"> Order deny,allow AllowOverride... (0 Replies)
Discussion started by: mojoman
0 Replies

9. Web Development

apache, surfing a directory

Hi, I have a directory and I need a url that users can surf it.like ftp. my web server is apache. Thanks in advance. (2 Replies)
Discussion started by: Zaxon
2 Replies

10. IP Networking

Change the root directory for apache, sshd and ftpd

Helo ! I want to do something and I don't know where to start... I want to make a small web hosting server (just for me and a few friends) and for the sake of learning I'd like to make an account for every user. The thing is that I want everyone to log into the server and to be put in his home... (3 Replies)
Discussion started by: Sergiu-IT
3 Replies
Login or Register to Ask a Question