HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=15)
-   -   How can I disable directory browsing in apache (http://www.howtoforge.com/forums/showthread.php?t=54311)

arastirici 28th September 2011 11:24

How can I disable directory browsing in apache
 
Hello

I use ispconfig2 on opensuse11.1, apache,php5 work on it.
it works well But. directory indexes is enable. I can't disable it ?

cat /etc/apache2/httpd.conf;

<Directory /wwwroot1/*/web>
Options -Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
Order allow,deny
Allow from all
<Files ~ "^\.ht">
Allow from all
</Files>
</Directory>

How can I disable directory browsing in apache ?

Thanks

falko 29th September 2011 18:30

Did you set
Code:

Options -Indexes
in the correct vhost? Did you check if there's maybe an .htaccess file where directory indexes are enabled?

arastirici 29th September 2011 20:32

for example, a vhost is located in /wwwroot1/web106

I added .htaccess file to web106/web/
and if I put down it " IndexIgnore */* " , it works
But if I put down Options -Indexes I get internal server error.

and it gets an error message;
.htaccess: Options not allowed here

I can't see any configure that it is enable +indexes
Also Allowoverride is All

What could be the problem ?

falko 30th September 2011 12:10

I guess you set
Code:

Options -Indexes
and
Code:

AllowOverride All
in the wrong locations. I'd set these in <Directory> containers inside your vhost.

arastirici 30th September 2011 12:54

Hello

the apache server doesn't allow me to configure "Allowoverride All" into vhost ( onto ispconfig control panel )
Therefore I configured "Allowoverride All" into /etc/apache2/httpd.conf

Note: I use opensuse11.1 and ispconfig2

falko 1st October 2011 10:28

Quote:

Originally Posted by arastirici (Post 264574)
Hello

the apache server doesn't allow me to configure "Allowoverride All" into vhost ( onto ispconfig control panel )

You can use the Apache Directives field on the Options tab in ISPConfig.

arastirici 1st October 2011 11:04

These apache directives in options tab of ispconfig works but Options -indexes does not work.

That's very interesting. i think it is a bug.

falko 2nd October 2011 10:45

What exactly did you put in the Apache Directives field?
Did you wrap <Directory ...></Directory> around the Options line?

arastirici 2nd October 2011 20:37

I put down as following in ispconfig's apache directives;

<Directory /wwwroot1/web167/web>
Options -Indexes
</Directory>

I get an internal server error.

if I put down "IndexIgnore */*" in .htaccess
it works.

falko 3rd October 2011 20:01

And there's nothing in Apache's error logs?


All times are GMT +2. The time now is 23:13.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.