<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE object PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<object>
<left_navigation />
<body>&lt;!--StartFragment--&gt;Using a UNIX program called .htaccess, you can restrict users from browsing materials on your web pages. Access to any or all of your web pages will be controlled with user/password authentication and authorization.&#13;
&lt;p class="bodyText"&gt;Per-file control is not available. Password protection can only be applied to a directory (folder); the password will apply to all the contents of that directory.&lt;/p&gt;&#13;
&lt;p class="bodyText"&gt;To protect an individual file, put the file into a directory by itself.&lt;/p&gt;&#13;
&lt;h3 class="bodyText"&gt;Set up Password Protection&lt;/h3&gt;&#13;
&lt;p class="bodyText"&gt;Before setting up password protection, ITD recommends that you understand the following:&lt;/p&gt;&#13;
&lt;ul class="list"&gt;&#13;
    &lt;li&gt;Telnet&lt;/li&gt;&#13;
    &lt;li&gt;&lt;a href="http://www.mtsu.edu/%7Eoit/oitref/pico.html"&gt;Pico&lt;/a&gt;, a text editor on frank&lt;/li&gt;&#13;
    &lt;li&gt;Paths to your directories on frank&lt;/li&gt;&#13;
    &lt;li&gt;UNIX file &lt;a href="/id0900b40a800d5b5d"&gt;permissions&lt;/a&gt;&lt;/li&gt;&#13;
&lt;/ul&gt;&#13;
&lt;p class="bodyText"&gt;The following steps will be completed in the directory you want to protect. The steps will be repeated for each directory you wish to protect.&lt;/p&gt;&#13;
&lt;h4 class="bodyText"&gt;1. Create .htaccess&lt;/h4&gt;&#13;
&lt;ol class="oList"&gt;&#13;
    &lt;li&gt;Login to your frank account.&lt;/li&gt;&#13;
    &lt;li&gt;Change to the directory (folder) which will be protected&lt;br /&gt; &lt;code&gt;frank $ cd&lt;/code&gt; &lt;var&gt;directory name&lt;/var&gt;&lt;br /&gt;&lt;/li&gt;&#13;
    &lt;li&gt;Create a file called &amp;quot;.htaccess&amp;quot; using pico, a text editor available on frank.&lt;br /&gt; &lt;code&gt;frank $ pico .htaccess&lt;/code&gt; (This creates the file then opens it in pico)&lt;br /&gt;&lt;/li&gt;&#13;
    &lt;li&gt;Enter the following information in your .htaccess file and save it. Frank is a case-sensitive server; copy the commands correctly.&lt;br clear="all" /&gt; NOTE: The value of &lt;code&gt;AuthName&lt;/code&gt; cannot contain any empty spaces. If a space is needed, substitute an underscore ( _ ) character.&lt;br /&gt;&lt;br /&gt; &lt;code&gt;AuthUserFile&lt;/code&gt; &lt;var&gt;complete path to your protected subdirectory&lt;/var&gt;&lt;code&gt;/.htpasswd&lt;/code&gt;&lt;br /&gt; &lt;code&gt;AuthGroupFile /dev/null&lt;/code&gt;&lt;br /&gt; &lt;code&gt;AuthName&lt;/code&gt; &lt;var&gt;your name, course, organization, etc...&lt;/var&gt;&lt;br /&gt; &lt;code&gt;AuthType Basic&lt;/code&gt;&lt;br /&gt;&lt;br /&gt; &lt;code&gt;&amp;lt;Limit GET&amp;gt;&lt;/code&gt;&lt;br /&gt; &lt;code&gt;require user&lt;/code&gt; &lt;var&gt;list authorized person(s) here&lt;/var&gt;&lt;br /&gt; &lt;code&gt;&amp;lt;/Limit&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br clear="all" /&gt; (&lt;kbd&gt;Ctrl-x&lt;/kbd&gt; exits pico; when prompted, select &lt;kbd&gt;Y&lt;/kbd&gt; for save)&lt;/li&gt;&#13;
&lt;/ol&gt;&#13;
&lt;h5 class="bodyText"&gt;Sample .htaccess File&lt;/h5&gt;&#13;
&lt;p class="bodyText"&gt;&lt;samp&gt;AuthUserFile /users/faculty/johndoe/public_html/classfile/.htpasswd&lt;br /&gt; AuthGroupFile /dev/null&lt;br /&gt; AuthName ProfessorSmart&lt;br /&gt; AuthType Basic&lt;br /&gt;&lt;br /&gt; &amp;lt;Limit GET&amp;gt;&lt;br /&gt; require user John Smith&lt;br /&gt; &amp;lt;/Limit&amp;gt;&lt;/samp&gt;&lt;br clear="all" /&gt;&lt;br clear="all" /&gt; The file &amp;quot;classfile,&amp;quot; located in Professor Smart's public_html folder, is available to John Smith.&lt;/p&gt;&#13;
&lt;h4 class="bodyText"&gt;2. Create the Password&lt;/h4&gt;&#13;
&lt;p class="bodyText"&gt;The following command will create the encrypted password and a hidden file named .htpasswd. &lt;var&gt;Username&lt;/var&gt; refers to the person receiving your permission to access the file (&amp;quot;John Smith&amp;quot; in the above example). The names should match exactly.&lt;/p&gt;&#13;
&lt;p class="bodyText"&gt;&lt;code&gt;frank $ /usr/local/etc/httpd/support/htpasswd -c .htpasswd&lt;/code&gt; &lt;var&gt;username&lt;/var&gt;&lt;/p&gt;&#13;
&lt;ul class="list"&gt;&#13;
    &lt;li&gt;The program will prompt you to enter a password and a confirmation. This is the password the user must enter to get access to your web pages.&lt;/li&gt;&#13;
    &lt;li&gt;Remember the password is case-sensitive; if you use an uppercase character, the users must use an uppercase character.&lt;/li&gt;&#13;
    &lt;li&gt;The path in the above command is correct; it will not be the same as the path to your protected directory.&lt;/li&gt;&#13;
    &lt;li&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The &amp;quot;-c&amp;quot; option should only be used when creating an &amp;quot;.htpasswd&amp;quot; file for the first time. If an &amp;quot;.htpasswd&amp;quot; file already exists and a &amp;quot;-c&amp;quot; option is issued, the old &amp;quot;.htpasswd&amp;quot; will be deleted, and all previous username/password data will be removed.&lt;/li&gt;&#13;
&lt;/ul&gt;&#13;
&lt;h4 class="bodyText"&gt;3. Change Permissions&lt;/h4&gt;&#13;
&lt;p class="bodyText"&gt;Change the permissions of the .htaccess and .htpasswd files to allow all users to read and execute them.&lt;br /&gt;&lt;br /&gt; &lt;code&gt;frank $ chmod a+rx .htaccess&lt;/code&gt;&lt;br /&gt; &lt;code&gt;frank $ chmod a+rx .htpasswd&lt;/code&gt;&lt;/p&gt;&#13;
&lt;!--EndFragment--&gt;&#13;
</body>
<Dept_Branding />
<Sub_Right_Col1 />
<MTSU_AccessabilityTabs />
<MTSU_MainTabs />
<header>Webpage Password Protection</header>
<Sub_Right_Col3 />
<MTSU_MainFooter />
<title />
<Sub_Right_Col2 />
<search />
</object>
