Plesk for Linux
kb: how-to
ABT: Group A
Applicable to:
- Plesk for Linux
Question
How to enable/disable directory browsing for a domain in Plesk for Linux?
Answer
Note: By default, directory listing is disabled for security reasons.
In the example below, directory listing is enabled for the shared directory (example.com/shared/). Change this directory to your own in the configuration below.
-
Go to Domains > example.com > Apache & nginx Settings.
-
Add the following configuration:
-
to the Additional directives for HTTP and Additional directives for HTTPS fields:
CONFIG_TEXT: <Location /shared/>
Options +Indexes
</Location> -
to the Additional nginx directives field:
CONFIG_TEXT: location /shared/ {
autoindex on;
}
-
-
Apply the changes.
Note: To disable the directory browsing, remove the directives above.
Comments
9 comments
Cant use Location in .htaccess:
Error: /var/www/vhosts/domain.tld/httpdocs/.htaccess: <Location not allowed here, referer: https://domain.tld/
Hello Myhost.ie Support
This isn't allowed by Apache design.
So the above fix...?
Myhost.ie Support
My bad, I've not noticed this)
I will ask the article author to fix the article.
Thank you.
Invalid Apache configuration: AH00526: Syntax error on line 1 of /var/www/vhosts/system/mywebsite.co.uk/conf/vhost.conf: Invalid command 'location', perhaps misspelled or defined by a module not included in the server configuration
Hi John Biddulph
It looks like you tried to insert nginx directives into the additional directives fields for Apache (Additional directives for HTTP/HTTPS).
I tried it but I still get error 403......
doesn't work, I still get error 403
solved... I didn't change the directory /shared/ with my directory... ;-)
sorry.
Please sign in to leave a comment.