Article 5AGEZ How to disable directory listing for specific directories in Apache?

How to disable directory listing for specific directories in Apache?

by
n00b_noob
from LinuxQuestions.org on (#5AGEZ)
Hello,
I'm using CentOS 8 x86_64 and my server hosting a WordPress website. I scanned my WordPress website with a security scanner and it found some vulnerabilities about directory listing. Some lines of my Virtual Host file are:
Code:<Directory "/var/www/WP">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>Some of my WordPress directories are browsable and when I open the URLs, then the content of the directories displayed:
Code:https://example.net/wp-content/plugins/email-subscribers/
https://example.net/wp-content/plugins/contact-form-7/How can I disable the directory indexing for those directories? I added below lines to my Virtual Host config file, but not worked:
Code:<Directory /var/www/WP/wp-content/plugins/email-subscribers>
Options -Indexes
</Directory>
<Directory /var/www/WP/wp-content/plugins/contact-form-7>
Options -Indexes
</Directory>I also did:
Code:<Directory "/var/www/WP">
Options -Indexes +FollowSymLinks
AllowOverride all
Require all granted
</Directory>But not matter. How can I solve it?

Thank you.latest?d=yIl2AUoC8zA latest?i=lBE6X7TIpvY:-_y4dSkzBnA:F7zBnMy latest?i=lBE6X7TIpvY:-_y4dSkzBnA:V_sGLiP latest?d=qj6IDK7rITs latest?i=lBE6X7TIpvY:-_y4dSkzBnA:gIN9vFwlBE6X7TIpvY
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments