FAQ
Search:     Advanced search
Browse by category:
Contact Us

How Do I Create A Password Protected Directory?

Views: 440
Plesk
  1. After loggging on to your Plesk control panel you will want to click on the "Home" link on the left-hand menu.  When the page loads click on the "Protected Directories" icon under the "Hosting" category.
  2. Under the "Tools" category click on the "Add New Directory" icon.
    1. Fill in the "Directory name" with the directory that you want protected.  If you have a directory in /httpdocs/mydir, you would enter "/mydir" into the Directory name field
    2. Check both Non-SSL and SSL for the location, and only click cgi-bin if the directory is in your /cgi-bin directory instead of your /httpdocs directory
    3. The header text can be anything you want.  The user will see this on the password prompt window.
    4. Then click OK
  3. The configuration page for the new protected directory will be displayed.  Click on the "Add New User" icon.
    1. Enter the Username and Password into the fields and press OK
  4. After adding a user you can browse to that protected directory and it should prompt your for the Username and Password.

Shell (Only if you have this enabled for your website)
  1. SSH in, and login using the adminstrative FTP username and password
  2. Navigate to the directory you want to password protect.
  3. Create the .htaccess file, it should contain the following lines:
    # Access file
    order allow,deny
    allow from all
    require valid-user
    Authname DirectoryName
    AuthPAM_Enabled off
    Authtype Basic
    AuthUserFile /var/www/vhosts/YourDomain/httpdocs/Directory/.htpasswd
    Make Sure To Replace DirectoryName, YourDomain and Directory as appropriate
  4. Now you must create the .htpasswd file using the htpasswd tool.
    1. Type the following command to create the file and add a user:
      htpasswd -c .htpasswd username
    2. You will be prompted for the users' password twice.
  5. If you need to add additional users to the file, use the command above without the -c.
Others in this Category
document My Pages Are Not Showing Up After I Upload Them, Why?
document I Can Not Access My Domain Via Host Name, Why?
document What Are The Server Paths For User Installed CGI Scripts?
document Can I Have More Than One Domain Point To My Existing Site?
document Where Do I Find The Site Statistics?
document How Do I Configure My Email Account? What Are The Values?
document My Email Is Getting Rejected / Fails When I Send It to My Domain.
document Does Each POP/User Account Include An Email Autoresponder / Vacation Reminder?
document How Do I Configure Email Forwarding / Redirects?
document How Do I Access / Use The Subscribable Mailing Lists?
document How Do I Access My Web Based Control Panel?



RSS