alternate Department header image
Converting to HTML
Blue horizontal rule image

If you have already created a document in LaTeX, WordPerfect, etc., then you may want to convert it to HTML rather than starting from scratch.

Password Protection
Blue horizontal rule image

Our web server allows you to control who can access different directories. I use it to give my students access to their grades.

Note that the following methods of access control can work independently, or be combined.

The .htaccess file (NOT htaccess.txt) is a hidden file, use ls -a to see hidden files within a directory.

Host Filtering
Host filtering is used to limit document trees to certain machines, most likely local machines or those directly involved in a project.
For example, I have some documents which are for people in the Math Department only. If you are not from a machine in math.montana.edu, you can't access them.
This is acomplished by placing a file called .htaccess in the directory that contains the document. Note that now ALL documents in that directory and in all sub-directories are protected.

In this case, the .htaccess file contains:

     AuthUserFile /dev/null
     AuthType Basic
     AuthGroupFile /dev/null
     AuthName "Example Allow From MATH"

     <Limit GET>
     order deny,allow
     deny from all
     allow from .math.montana.edu
     </Limit>
I have another directory that I don't want people in this department to read.

In this case, the .htaccess file contains:

     AuthType Basic
     AuthUserFile /dev/null
     AuthGroupFile /dev/null
     AuthName "Example Deny From MATH"

     <Limit GET>
     order allow,deny
     allow from all
     deny from .math.montana.edu
     </Limit>
User Authentication
If your users are using a browser that supports user authentication, like Netscape/Mozilla or M$ Internet Explorer, you can have the users authenticate themselves with a user name and a password before they are able to access protected documents.
For an example, I have created a user.
I have protected this directory so that only blong can access it.
In this case, the .htaccess file contains:
AuthType Basic
AuthUserFile /usr/local/apache2/passwd/htpasswd
AuthName "Descriptive name name here"

<LIMIT GET>
Require user blong
</LIMIT>
I have protected this directory so that only blong can access it, and only from guass.math.montana.edu.
In this case, the .htaccess file contains:
     AuthType Basic
     AuthUserFile /usr/local/apache2/passwd/htpasswd
     AuthGroupFile /dev/null
     AuthName "Example Allow From GAUSS.MATH"

     <Limit GET>
     order deny,allow
     deny from all
     allow from gauss.math.montana.edu
     Require user blong
     </Limit>

Notice the line that begins with "AuthUserFile". In the last example, it pointed to the file "/usr/local/etc/httpd/passwd/htpasswd". You must point it to your own file. Basically, there are two parts to password protection:

  1. Put a file called ".htaccess" in the directory you want to protect. Copy the example above and modify a few lines.
  2. AuthUserFile
    The AuthUserFile is a text file that you create. It contains usernames and encrypted passwords (one user per line). E.g.,
    blong:feWCE9YuVPnFI
    user2:02dfvzXkx4mqg
    Just use emacs, pico, etc., to create and edit this file. Then make sure the AuthUserFile line in .htaccess refers to the right place. It is best not to put the AuthUserFile under your public_html directory. Also, notice the path to the AuthUserFile is a unix path not a URL.
    You can encrypt a password by entering the text in the box (try it and see a more complete example.)
    (hit return)
    8 character max
    Paste the result into your AuthUserFile.
Blue horizontal rule image

Other Information

Other Sources

Blue horizontal rule image
Our local Tutorials:
Basic HTML | Less Basic HTML | More Advanced HTML | Web Design II A mini-seminar
Blue horizontal rule image
Last Modified: Tuesday, 14-Jun-2011 16:52:16 MDT