Web
Server Manual
| Frames
Format
Password Protected Directories | top
If you do not have SSH access you may create password protected directories via your control panel, at:
http://cp.your_domain.com
Assumptions
Create the .htaccess File
<Files ~ "\.htpasswd$"> order deny,allow deny from all </Files> AuthUserFile /home/vs#####/public_html/protected/.htpasswd AuthGroupFile /dev/null AuthName Password_secure AuthType Basic require user dave juliet
- Notes:
- The "<Files ~ "\.htpasswd$">" part of the text above prevents others from looking at your .htpasswd file in a web browser.
- "AuthName Password_secure" line above can be changed to anything you wish.
- This text appears when the username/password request window pops up.
- Very important: no spaces are allowed between words on this line.
- This will not work for example: "AuthName Password secure"
- Add as many names with spaces as needed on line "require user dave juliet"
Create the Secret Password
|
Screen Shot Example: [vs02000@vs02
public_html]$ mkdir protected The password entered is: test I created and uploaded the .htaccess file, as "text," into the /protected directory, contents: <Files
~ "\.htpasswd$"> require user dave juliet Done. Check Web Site... |
Add Additional Users
Assumptions:
Step by step:
Restricting Access by domain name or IP address | top
To put a site lock on your Web pages, you need to create a file called .htaccess and upload it into the directory that contains the pages you wish to restrict.
This allows all, but denies what you set in the .htaccess file:
<Files ~ "\.htaccess$"> order deny,allow deny from all </Files> <Limit GET POST> order allow,deny allow from all deny from 209.240.200.144 209.240.198 </Limit>
This denies all, but allows some:
<Files ~ "\.htaccess$"> order deny,allow deny from all </Files> <Limit GET POST> order deny,allow deny from all allow from .ncsa.uiuc.edu aol.com </Limit>
The restrictions put in place by the .htaccess file will affect all of the files in that directory, as well as all files in any subdirectories, so if you want to restrict only a part of your pages, recommend you put the restricted pages into their own directory.
The "<Files ~ "\.htaccess$">...</Files>" part of the text above prevents others from looking at your .htpasswd file in a web browser.
How to create WWW FTP directory listings (like the Software directory) | top
This document is a
brief explanation on how directory listings can be set up.
Majority of this writing was taken from a tutorial written by
J
J Fardoulis
(July 2, 1996), University of Western Sydney.
Steps to the Process
Create a file called
.htaccess in the directory you wish the contents to
be displayed.
NOTE: The .htaccess file can
be used for many things (including WWW security), but we are using it
for the purpose of listing the contents of the
directory.
The .htaccess file should have something like the following in it:
Options Indexes DefaultType text/plain AddDescription "Back to TT Page" .. AddDescription "Commerce" 1 AddDescription "Education" 2 AddDescription "Visual & Perform Arts" 3 AddDescription "Science & Technology" 4 AddDescription "Nursing & Health Stud" 5 AddDescription "Humanities & Soc Sci" 6 AddDescription "Non-Faculty" 7 AddDescription "Engineering" 8 AddDescription "Law" 9 AddDescription "** ALL SUBJECTS **" all
The first line causes the directory to be listed. The optional second line indicates that, as a default, the files in the directory have the text/plain MIME type. This can be changed as required. The following optional lines allow you to add a description to each of the (expected) files in the directory. The format of these lines are, the word AddDescription, followed by a string to display (the first 16 characters are used), and the file to display the description for. The file can have wildcard characters as in:
Options Indexes AddDescription "Text file" *.TXT AddDescription "MS Word document" *.DOC AddDescription "MS Powerpoint document" *.PPT AddDescription "Bin-hex archive" *.hqx
You can also add one or both of the following text files to the directory:
HEADER README
The contents of the HEADER file gets displayed at the top of the directory listing page. The contents of the README file gets displayed at the bottom of the directory listing page. These two files seem to accept some HTML commands and execute them similarly to html files.
How to turn off directory listings | top
Add this line to your .htacess file:
Options -Indexes