Department of Mathematics

F.A.Q.

If your question is not answered on this page or you do not understand the answer, you can contact the Helpdesk for technical help.


Web

  • How can I password protect a directory in my Math Web space?

    1. You need to create two files.
      1. ~/WWW/protecteddir/.htaccess
      2. ~/.htpasswd
    2. An .htaccess file can be used to specify webserver settings at the directory or file level. Here is a sample .htaccess file:
      • AuthName “Display name of protected area”
        AuthType Basic
        AuthUserFile /homes/ivetter/.htpasswd
        #require user ivetter
        require valid-user
    3. Your .htaccess file points to a file of usernames and passwords, commonly named .htpasswd
      1. To create your .htpasswd directory and place a user in the file on one of the departmental unix servers, run a command like this:
        1. htpasswd -c ~/.htpasswd username
        2. You’ll be prompted for the password twice.
        3. Voila! You should now have a username and encrypted password in the ~/.htpasswd file.
      2. To add another username to your .htpasswd file, run this command:
        1. htpasswd ~/.htpasswd username2
    4. Please note that your .htpasswd file can go anywhere in your home directory, but must be readable (but never writable!) by the ‘nobody’ user (or the world). Additionally, it’s best to not place the ~/.httpasswd directory under your WWW folder.