Web Development Support
    General Info   Cool Tools
    Getting Started   Troubleshooting
    Design & Promotion   Feedback
 

Search this site:


view site map

mkhtaccess

mkhtaccess is a barebones utility for creating .htaccess restrictions (either by username/password pairs or by restricting to the virginia.edu domain). mkhtaccess is very simple to use, but offers little flexibility. If you require more options and flexibility, please consult our more complete .htaccess documentation.

The process for using mkhtaccess is as follows:

1. Using either SecureCRT or Nifty Telnet (both available from Software Central), log on to the server where your files reside (such as blue.unix.virginia.edu or minerva.acc.virginia.edu).

2. Change to the directory that you want to protect. For example, if you wanted to protect the directory "forfriends" in your personal Web site, you do the following (the commands you should type are in red):

node16: /home/mst3k $ cd public_html/forfriends

3. Run the mkhtaccess utility by entering the following command:

node16: /home/trn-web/public_html/forfriends $ /contrib/scripts/mkhtaccess

You should then see the following menu:

Your .htaccess options are:
(1) Password protect
(2) Restrict to virginia.edu
1 or 2?

4. Enter your choice and then follow the directions on the screen. If you choose to password protect, you will then be prompted to supply the desired username and password combination. If you choose to restrict to virginia.edu, there are no further steps to complete.

5. Finally, you should test your .htaccess restriction. Using your preferred Web browser, go to a page that is in the restricted directory. If you chose to password protect that directory, you should be prompted for the username and password. If you restricted your directory to virginia.edu, then you will need to use an outside Internet Service Provider to verify the protection.


Technical Notes:

mkhtaccess places a .htaccess file in the current directory. If option 1 (password protect) is selected, the htaccess file will resemble the following:

AuthUserFile /home/mst3k/.htpasswd
AuthGroupFile /dev/null
AuthName RestrictedAccess
AuthType Basic

require valid-user

The .htpasswd file will be placed in the home directory of the person who initiated the mkhtaccess utility.

If option 2 (restrict to virginia.edu) is selected, the htaccess file will resemble the following:

AuthUserFile /home/mst3k/.htpasswd
AuthGroupFile /dev/null
AuthName AllowFromUVa
AuthType Basic

order deny,allow
deny from all
allow from .virginia.edu

 

 


Web Development Support | General Info | Getting Started | Design & Promotion
Cool Tools | Troubleshooting | Feedback

If you need further assistance with Web applications or questions, send e-mail to web-consult@virginia.edu or call the ITC Help Desk at 924-3731.

© 2008 by the Rector and Visitors of the University of Virginia.

The information contained on the University of Virginia’s Department of Information Technology and Communication (ITC) website is provided as a public service with the understanding that ITC makes no representations or warranties, either expressed or implied, concerning the accuracy, completeness, reliability or suitability of the information, including warrantees of title, non-infringement of copyright or patent rights of others. These pages are expected to represent the University of Virginia community and the State of Virginia in a professional manner in accordance with the University of Virginia’s Computing Policies.