LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 04-12-2010, 03:43 AM   #1
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 266

Rep: Reputation: 19
Apache - protecting folders view in webbrowser


Hi all,

how to protect my /var/www folder in Apache ?

When I`m putting wrong url I see the content of /var/www . How to restricted it ?

.htaccess ?

who can help me ?


cheers

Dlugasx
 
Old 04-12-2010, 04:11 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
When I`m putting wrong url I see the content of /var/www . How to restricted it ?
Apache by default gives a 404 Error page, when the document you've requested does not exist.
So I guess you have changed somehow the "ErrorDocument" directive in httpd.conf resulting in a directory listing.

You should post httpd.conf in order to be able to help you.
 
Old 04-12-2010, 04:41 AM   #3
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 266

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by bathory View Post
Apache by default gives a 404 Error page, when the document you've requested does not exist.
So I guess you have changed somehow the "ErrorDocument" directive in httpd.conf resulting in a directory listing.

You should post httpd.conf in order to be able to help you.
lets say You dont have index.html file or index.php... then Apache will show You the content of the folder. How to protect it ?

I have forgot which option is responsible for that.

This what I know , You can setup this here


<Directory /var/www>

Options .... -Indexes ?

</Directory>


Do You know ?
 
Old 04-12-2010, 04:51 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Yes, if you don't have "Indexes" among the other Options, or you use -Indexes, apache will stop the directory listing.
 
1 members found this post helpful.
Old 04-12-2010, 06:24 AM   #5
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 266

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by bathory View Post
Yes, if you don't have "Indexes" among the other Options, or you use -Indexes, apache will stop the directory listing.
Thanks man

SOLVED
 
  


Reply



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
Password Protecting Web Folders dudeman41465 Linux - Security 2 02-01-2006 03:18 PM
protecting Web Folders tommytomato Linux - Security 1 12-14-2003 09:52 AM
Password Protecting Web Folders tommytomato Linux - Security 4 12-07-2003 08:18 AM
Password Protecting Web Folders tommytomato Linux - Security 3 12-06-2003 09:51 AM
Password Protecting Folders with Apache wyndman Linux - Newbie 0 06-27-2003 01:11 PM

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

All times are GMT -5. The time now is 10:38 PM.

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