Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, how to prevent directory listing (directory browsing) of "https://myzabbix.com/icons/" web-page?
I found 2 methods how to do it on Apache on CentOS, but it doesn't work:
1) In httpd.conf in section <Directory "/var/www/html"> i removed a word "Indexes" or tried to write "-Indexes" in "Options FollowSymLinks", also i put "AllowOverride All" and restarted Apache.
2) I created .htaccess file in /var/www/html/ and put "Options -Indexes" in it.
But it didnt help.
What is wrong?
Hi, how to prevent directory listing (directory browsing) of "https://myzabbix.com/icons/" web-page?
I found 2 methods how to do it on Apache on CentOS, but it doesn't work:
1) In httpd.conf in section <Directory "/var/www/html"> i removed a word "Indexes" or tried to write "-Indexes" in "Options FollowSymLinks", also i put "AllowOverride All" and restarted Apache.
2) I created .htaccess file in /var/www/html/ and put "Options -Indexes" in it.
But it didnt help.
What is wrong?
FYI /icons is an Alias to /var/www/icons, so you need to toggle Indexes in that directory stanza in apache config file
I created a file zabbix_icons_dir.conf in /etc/httpd/conf.d. with code
<Directory "/usr/share/httpd/icons">
Require all denied
</Directory>
It helped.
Well yes, that would, but that's preventing anyone from using any of the files in that directory, not just suppressing the directory listing. If that's ok (if you don't need to use any of those files on any web page), then you're done. Otherwise, add
Code:
Options -Indexes
to that container:
Code:
<Directory "/usr/share/httpd/icons">
Options -Indexes
Require all granted
</Directory>
to allow access to the files but still suppress the directory listings.
As I said earlier:
Quote:
Originally Posted by scasey
To suppress a specific directory only, create a <Directory ...> container for that directory with the Options directive inside it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.