Re: Disable directory indexing for a specific directory.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you.
I asked it on WordPress froum:

They told me: This is 100% a server issue... and that WordPress has nothing to do with it.
...
Also, note that this automatic indexing is provided by the mod_autoindex Apache module. So you can disable this automatic indexing server-wide by simply disabling this model.

Is it OK to disable mod_autoindex?




On Tue, Nov 24, 2020 at 6:02 PM, Lucien Gentis
<lucien.gentis@xxxxxxxxxxxxxxxx> wrote:
I meant outside any VirtualHost.

You mentionned it in your original message :

Hello,
I have a WordPress website and my Virtual Host file include below lines:

<Directory "/var/www/WP">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>

Le 24/11/2020 à 13:46, Jason Long a écrit :
> Not really.
> In server global configuration? Is you mean "httpd.conf"?
>
>
>
>
>
>
> On Monday, November 23, 2020, 08:59:56 PM GMT+3:30, Lucien Gentis <lucien.gentis@xxxxxxxxxxxxxxxx> wrote:
>
>
>
>
>
> Seems OK for me.
>
> Did you try to delete "Indexes" in:
>
> <Directory "/var/www/WP">
> Options Indexes FollowSymLinks
> AllowOverride all
> Require all granted
> </Directory>
>
> (which is, I suppose, in server global configuration)
>
>
> Le 23/11/2020 à 12:11, Jason Long a écrit :
>> Sure.
>>
>> <VirtualHost *:80>
>> Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
>> ServerAdmin root@localhost
>> ServerName www.Example.net
>> ServerAlias www.Example.net
>> DocumentRoot /var/www/WP
>> <Directory "/var/www/WP">
>> Options -Indexes +FollowSymLinks
>> AllowOverride all
>> Require all granted
>> </Directory>
>> <Directory /var/www/WP/wp-content/plugins/contact-form-7>
>>          Options -Indexes
>> </Directory>
>> <Directory /var/www/WP/wp-content/plugins/elementor>
>>          Options -Indexes
>> </Directory>
>> <Directory /var/www/WP/wp-content/plugins/elementor-pro>
>>          Options -Indexes
>> </Directory>
>> <Directory /var/www/WP/wp-content/plugins/email-subscribers>
>>          Options -Indexes
>> </Directory>
>> <Directory /var/www/WP/wp-content/plugins/wp-aparat>
>>          Options -Indexes
>> </Directory>
>> ErrorLog /var/log/httpd/wordpress_error.log
>> CustomLog /var/log/httpd/wordpress_access.log common
>> RewriteEngine on
>> RewriteCond %{SERVER_NAME} =Example.net [OR]
>> RewriteCond %{SERVER_NAME} =www.Example.net [OR]
>> RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
>> Redirect permanent / https://www.Example.net
>>
>> TraceEnable off
>> ServerSignature Off
>>
>> TimeOut 60
>>
>> # Modules
>> RequestReadTimeout header=20-600,MinRate=500 body=20,MinRate=500
>> </VirtualHost>
>>
>> <VirtualHost *:80>
>>        ServerName 1.2.3.4
>>        Redirect 403 /
>>        ErrorDocument 403 "Sorry, direct IP access not allowed."
>>        DocumentRoot /dev/null/
>>        UseCanonicalName Off
>>        UserDir disabled
>> </VirtualHost>
>>
>>
>>
>> Which part is wrong?
>>
>>
>>
>>
>>
>> On Sunday, November 22, 2020, 06:37:27 PM GMT+3:30, Lucien Gentis <lucien.gentis@xxxxxxxxxxxxxxxx> wrote:
>>
>>
>>
>>
>>
>> Hello,
>>
>> Could you please join your Virtual host complete configuration ?
>>
>> Le 22/11/2020 à 14:50, Jason Long a écrit :
>>> Hello,
>>> Any idea?
>>>
>>> Thanks.
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Monday, November 16, 2020, 08:11:58 PM GMT+3:30, Jason Long <hack3rcon@xxxxxxxxx.invalid> wrote:
>>>
>>>
>>>
>>>
>>>
>>> Hello,
>>> I have a WordPress website and my Virtual Host file include below lines:
>>>
>>> <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:
>>>
>>> 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:
>>>
>>> <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>
>>>
>>> Thank you.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux