Articles in this section

How to configure a password-protected directory in Plesk

Plesk for Windows kb: how-to Plesk for Linux ABT: Group B

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Question

How to set up a password-protected directory for a domain in Plesk?

Answer

Note: Password-protected directories do not work together with Docker proxy rule.

  1. Log in to Plesk.

  2. Find which directory is the Document Root directory for the domain at Domains > example.com > Hosting Settings > Document root.


    Screenshot_2019-09-28_Hosting_Settings_for_example_com_-_Plesk_Onyx_17_8_11_1_.png

  3. Additional step for Plesk on Windows Server (if you are using Linux, move to step 3):

    Go to Domains > example.com > IIS Settings and make sure that Anonymous authentication is enabled:


    Screenshot_2019-09-28_IIS_Settings_for_example_com_-_Plesk_Onyx_17_8_11.png

  4. Go to Domains > example.com > Password-Protected Directories and click Add Protected Directory.


    Screenshot_2019-09-28_Plesk_Onyx_17_8_11.png

  5. Specify the directory, located inside Document Root from step 1 ('httpdocs' in this example), that should be secured. In this case, we are restricting an access to the /httpdocs/img folder (https://example.com/img). Click OK.

    Note: Specify "/" to protect the whole website with a password authentication.


    Screenshot_2019-09-28_Plesk_Onyx_17_8_11_2_.png

  6. Now, click on the directory name.


    Screenshot_2019-09-28_Plesk_Onyx_17_8_11_3_.png

  7. Click Add a User to create a user that will be used to access the password protected directory. Click OK. Add other users if required.


    Screenshot_2019-09-28_Plesk_Onyx_17_8_11_4_.png

  8. Open the now protected URL in a web-browser (in this example, example.com/img) and log in using the username and password from step 6.

    Note: If Apache restart interval is set at Tools & Settings > Apache Web Server, Apache must be restarted manually to apply the changes.

 

Additional Information

The command-line instructions are available at:

To learn more about password-protected directories, visit:

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.