• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Password Protecting a directory

C

Coldfusion2006

Guest
Most control panels have a nice and easy way to .htaccess protect folders

Plesk has a nice way by allowing you to click "Directories"

When you have clicked this it opens up a new window and asks if want to Add a New Directory.

It protects standard directories or domains fine..

Example http://example.com (Works Fine)


Example http://subdomain.example.com (Doesnt Work)

What am I missing?

Another issue that I dont like so far with my plesk panel, is how it divides http and https folders... Why not just use one single folder?
 
I'm not sure about password protecting subdomain directories from the control panel. I ususlly just do it from the shell. Create an .htaccess file in the directory you want to protect, and run htpasswd on the username to create a password file. Post back if you need detailed steps.

For putting http and https in a single directory, there is a setting for that under the "Setup" icon. Look for the setting "Use a single directory for housing SSL and non-SSL content"
 
Originally posted by TXRanger
I'm not sure about password protecting subdomain directories from the control panel. I ususlly just do it from the shell. Create an .htaccess file in the directory you want to protect, and run htpasswd on the username to create a password file. Post back if you need detailed steps.

For putting http and https in a single directory, there is a setting for that under the "Setup" icon. Look for the setting "Use a single directory for housing SSL and non-SSL content"

That would be great! Please tell me how!
 
Create a file in the directory you want to password protect called ".htaccess". I create the file from the shell using vi, but you should be able to create it from the shell or the control panel. Example from command line (assuming you know how to use vi / vim and your subdomain is test.yourdomain.com):
Code:
vim /home/httpd/vhosts/yourdomain.com/subdomains/test/.htaccess

Then use the following code (replace yourdomain.com with your real domain name):
Code:
AuthUserFile /home/httpd/vhosts/yourdomain.com/access.pwd
AuthGroupFile /dev/null
AuthName "My protected directory"
AuthType Basic

<Limit GET>
   require user Coldfusion2006
</Limit>

Then create the file to hold the password(s) with the following command from the shell:
Code:
htpasswd -c /home/httpd/vhosts/yourdomain.com/access.pwd Coldfusion2006
It will then prompt you for the password you want to use for the user "Coldfusion2006". After you enter and confirm your password it should work.
 
Back
Top