 |
The method in this document is best if you only want specific
machines to be able to access the documents on your site.
-
Change into your pub directory:
cd ~/../pub
-
Create a directory for your password protected web
page.
mkdir private
(You can use whatever directory name you like; we have
used the name private)
-
Change the AFS permissions on the directory that you
created with the commands:
fs sa private/ system:anyuser none system:httpd
read
This will give the web server read permissions and remove
the world read permissions that your pub directory has by
default.
-
Change into the directory you just created.
cd private
-
Create a text file called
.htaccess containing
the following (you might type pico .htaccess
to begin creating the file):
AuthType Basic
Order deny,allow
Deny from all
Allow from <ip-address>
Satisfy all
(Replace ip-address with the ip address of the
computer you want to give access to. If you used pico to
create the file, save it using control-O, press return, and
then use control-X to exit. If you want to allow multiple
users to access the page, put additional allow from
<ip-address> lines in the .htaccess file,
one for each ip address or use wildcards for ranges of ips
i.e. 129.2 .)
That's it! Now, just put the web page you'd like to protect
into the private directory. To access the
page, point your web browser to:
http://www.terpconnect.umd.edu/~yourusername/private/filename.html
(Where filename.html is the name of your
password-protected web page, and yourusername is
your TerpConnect login ID.)
Also note that you can mix this with user restricted access
found at the Password Protecting A Web Page Using The TerpConnect Password Database page.
|