Control Web Panel

WebPanel => Apache => Topic started by: wpmagic70 on May 08, 2016, 07:09:32 AM

Title: How to disable directory listing
Post by: wpmagic70 on May 08, 2016, 07:09:32 AM
Hi all. I installed cwp on my vps but sounds like directory browsing is enabled and i added following code on httpd.conf but it not works at all:
Options -Indexes

I have inserted it in many places even in my domain directory but it not works.
Please help me.
Thanks.
Title: Re: How to disable directory listing
Post by: Sandeep on May 08, 2016, 07:23:36 AM
create .htaccess file and add Options -Indexes
or add Options -Indexes in you existing .htaccess file

in root folder of website files (in public_html)
Title: Re: How to disable directory listing
Post by: wpmagic70 on May 08, 2016, 07:37:25 AM
Thank you. I was inserted it in there but seems the file was not changed at that time! this time tried changing that file from cwp root filemanager2 instead of  ftp and that worked.

Also i was inserted it in /usr/local/apache/conf/httpd.conf but it was not working there. Why ?
Thanks.
Title: Re: How to disable directory listing
Post by: Sandeep on May 08, 2016, 08:04:34 AM
you can't add this to apache config file

i will recommend you to use winscp
https://winscp.net/eng/download.php
Title: Re: How to disable directory listing
Post by: tristar78 on May 18, 2016, 10:29:20 AM
Hello, there.

I have been using CWP Panel more than 1 year. Really thanks founder&contributers to give us such nice platform.

Please follow this small modification for disable "Directory indexing" or "Directory Listing" on all server-side.

Quote
[OPEN]
/usr/local/apache/conf/extra/httpd-userdir.conf
[FIND]
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
[REPLACE]
Options MultiViews SymLinksIfOwnerMatch IncludesNoExec
[IMPORTANT]
RESTART APACHE SERVICE AFTER CHANGES!!!

Title: Re: How to disable directory listing
Post by: Sandeep on May 18, 2016, 10:38:45 AM
thanks

but its not necessary at all
Title: Re: How to disable directory listing
Post by: pivey on October 18, 2016, 11:37:06 AM
hmm.. i added an .htaccess with Options -Indexes but still get 500 Internal Server error
Did also try recommended edit to \usr\local\apache\conf\extra\httpd-userdir.conf
Also 500 Internal Server error with log files indicating "htaccess: Options not allowed here"
Title: Re: How to disable directory listing
Post by: Sandeep on October 26, 2016, 09:18:37 AM
hmm.. i added an .htaccess with Options -Indexes but still get 500 Internal Server error
Did also try recommended edit to \usr\local\apache\conf\extra\httpd-userdir.conf
Also 500 Internal Server error with log files indicating "htaccess: Options not allowed here"
kindly let us know the url and its path
Title: Re: How to disable directory listing
Post by: pivey on November 04, 2016, 08:43:44 PM
Please apologize, i was away for some time.
I sent you a private message for Url & path
Title: Re: How to disable directory listing
Post by: Sandeep on November 05, 2016, 08:06:31 AM
Please apologize, i was away for some time.
I sent you a private message for Url & path

if you have .htaccess file kindly rename it to .htaccess.bak and check
Title: Re: How to disable directory listing
Post by: adisreyaj on February 24, 2018, 11:45:52 AM
Hello, there.

I have been using CWP Panel more than 1 year. Really thanks founder&contributers to give us such nice platform.

Please follow this small modification for disable "Directory indexing" or "Directory Listing" on all server-side.

Quote
[OPEN]
/usr/local/apache/conf/extra/httpd-userdir.conf
[FIND]
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
[REPLACE]
Options MultiViews SymLinksIfOwnerMatch IncludesNoExec
[IMPORTANT]
RESTART APACHE SERVICE AFTER CHANGES!!!

You are a savior!
Title: Re: How to disable directory listing
Post by: TheMobiHost on September 11, 2020, 05:54:59 PM
Thank you..  :)

Hello, there.

I have been using CWP Panel more than 1 year. Really thanks founder&contributers to give us such nice platform.

Please follow this small modification for disable "Directory indexing" or "Directory Listing" on all server-side.

Quote
[OPEN]
/usr/local/apache/conf/extra/httpd-userdir.conf
[FIND]
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
[REPLACE]
Options MultiViews SymLinksIfOwnerMatch IncludesNoExec
[IMPORTANT]
RESTART APACHE SERVICE AFTER CHANGES!!!