ROCKCI
HOME
DIY
Virtual Servers
User Manual
Chapter 1 Introduction
Chapter 2 Getting Started
Chapter 3 Features
Chapter 4 Security
Appendix A Administrative
Appendix B add-ons
Appendix C facilities

|
Password Protecting Webpages
Chapter 3-4-10 ROCKCI
DIY Virtual Server Features
Password Protecting Webpages
ROCKCI DIY virtual servers allow users to easily install
password protection on the contents of a particular directory. For complete
details, please refer to the Apache Website.
You can install password protection for a directory under your
ROCKCI DIY Virtual Domain by following the following simple steps:
-
Create a file named ".htaccess" in the directory you wish to protect.
-
Place the following information within the .htaccess file:
-
(don't forget to upload in ascii mode!
)
-
(don't forget the "" signs around "Resource
Name" )
AuthUserFile path to the directory/.passwdfile
AuthGroupFile /dev/null
AuthName "Resource Name"
AuthType Basic
<Limit GET>
require valid-user
</Limit>
For example:
AuthUserFile /usr/local/www/data/joediyuser/private/.passwdfile
AuthGroupFile /dev/null
AuthName "Joe DIY User Co. Private Access"
AuthType Basic
<Limit GET>
require valid-user
</Limit>
-
Create a password file named ".passwdfile" by using the htpasswd
utility. Execute the following commands from the UNIX shell while within
the directory to be protected:
cd /usr/local/www/data/joediyuser/private
htpasswd -c .passwdfile {username to add}
You will then be prompted for a password for the user
name you supplied. For example:
htpasswd -c .passwdfile bob
Password: ********
-
Set the permissions on the files with the following commands:
chmod 644 .htaccess
chmod 644 .passwdfile
-
To add a user, execute the htpasswd command as above without
the -c option. For example:
htpasswd .passwdfile betty
Password: ********
-
To remove a user, edit the .passwdfile file and remove the line with that
user's information.
-
To change a user's password, remove the user and then recreate the user
with the new password.
-
Now when a www user trys to access a page in the protected directory, he/she
will be asked for a user name and password. If he/she types the correct
information, access to the page is granted.

Powered by ROCKCI DIY
Virtual Servers
|