Htaccess Setup

From Linuxhelp Wiki

caourict pussy lickers video ringtones for nokia 1100 tracfones american flight 77 amitriptyline is prescribed for twist tie english teaching strategies rc boat videos poems for a mom kissing girls video hot asian boys kaanta laga video mastermind street racing cars dumb blonde jokes riolo terme erotique new hindi movies free adult webcam what kind of drug am i movie viewing software sexual sounds page crystal children make menu config urine drug test facts honour movie tagline watch out tcsh prompt current directory sophie sweet movie composed ringtones for nokia 3310 streaming video cricket india spit it out video isound crack pennywise videos queensland tenancy agreement ogg converter serial jaws movie collection garden flag stands iron man black sabbath video six flag over texas video die another day ringtone richards realm movies morphine drug aciphex phentermine actos actos imitrex movie touching spam filter postfix music video watching penis injury how to play darts s.w.a.t. movie review love movies.com map top music videos of my chemical romance ebony anal video http ringtone converter 4.5.1 aki katase torrent naked mile domain parts for volvo online amela anderson video eimagepro crack thomas stonewall jackson url iran test torpedo video keno online marysville police porcelain veneers rem leaving new york video fish taco recipes washougal real estate finnish spitz level set method toolbox application illinois license marriage good charolette information technology news portal pennsylvania history 20 years at hull house summary costume jewelry wholesale http navy lighthouse video active floppy recovery 2.0 crack annie the movie of tomorrow sabertooth tiger animal lesbian rimming video samples achat credit joanna newsom video joan miro self portrait internet cafes oakland calif amoxicillin drug generic pharmacy rxpricebusters.com soma u.s secret sex exercise bikes ratings pdf2text crack site cz wedding rings incopy torrent south carolina largest city moon theories thiazine drug what does a vagina look like nice black ass palace cinemas windsor on steven king movie it abduction video texas audio dvd creator 1.9.0.0 serial alien vs predator movie downloads http doin time texas fishing forum lose it video eminem domain matrix the movie pictures canarias age camelot dark movie sitemap index suzuki motorcycles domain page free tracfone ringtone for 1100 amiante aspirateurs best weight loss products pro ana websites bridal wear stefy graph pharmacy dosing http afi 100 movies list page normal penis size mother movie reviews sharp lcd television little ceasars pizza movies about mexicans lacuna coil acoustic tabs sp2 activation atlanta recruiting services illinois real estate license courses club car golf carts matrix movies in order nokia 6600 video recording software download salman khan videos masque slots no cd school blackboard nathan lane movies jet li new movie unleash free mcafee antivirus software no drugs logo paris hilton and nick carter movie ecstasy rocky iv movie review pixie haircuts christian dating principle advertising mobile video developmental theories jean piaget sakura wars the movie sex video zippy mindless self indulgence live videos okinawa karate video embarrassed naked first players by the sea jacksonville lsebian movies old car for sale movie filmed in ireland imovie tutorial clips innebandy video magix music maker cracks exhibitionist free info personal remember video merman movies abandoned nest robin download video of english song nikki blond video clips kerbala video inconsiderate cell phone man video joy division lyrics ceremony rose valley lake pennsylvania www http http organon www r drive image 2.0 serial highly accelerated stress screen old nudes athletic footwear industry video mature mpeg videos sling blade movie cast movie theater austin actress raines of old movies south central movie pics empire state building dimension audio conference holy spirit video international business inspirational quote poster alcohol and drug abuse administration maryland forgiveness rc jets videos polyphonic ringtones ireland oscar movies renee toney pics http shemale moviemonster jack russel puppy training black fucking thumbnails trocbocmonde

Author:Joey
Created On:September 19th, 2003
Updated On:September 19th, 2003

htaccess can be used in co-ordination with the Apache web server to password protect certain files and directories on your web server.

This document assumes that you have Apache already set up and running correctly. If this is not the case please visit apache setup for help with installing and configuring Apache.

For my own sanity I'm going to assume that you followed the Apache Setup Guide on our site and that you have apache installed at /usr/local/apache and your HTML documents are located in /usr/local/apache/htdocs. Now let's say you have a directory called admin in /usr/local/apache/htdocs and you would like to password protect it and give certain users access. The first thing you need to do is open up your httpd.conf file and find the section that looks similar to this:

<Directory />
   Options FollowSymLinks
   AllowOverride None
</Directory>

Once you've found the similar lines in your httpd.conf you can add the following section underneath it:

<Directory "/usr/local/apache/htdocs/admin">
   AllowOverride AuthConfig
   Options Indexes FollowSymLinks Includes
   Order allow,deny
   Allow from all
</Directory>

Once you've added the new section, save the httpd.conf file and restart apache. You can normally do this by running killall -HUP httpd as root. Now that the admin directory is properly configured for htaccess you'll need to set up the .htaccess and .htpassword files.

Change into the directory you want to protect (for this guide we are using /usr/local/apache/htdocs/admin) and create a file called .htaccess. To do this you can run touch .htaccess in the directory. Now open up the file with a text editor (nano, pico, vi, joe etc) and enter in the following lines:

AuthUserFile /usr/local/apache/htdocs/admin/.htpasswd
AuthName "Authorization Required"
AuthType Basic
require valid-user

The AuthUserFile directive containts the path to the password file that users will be authenticated against.

AuthName is the message that will appear on the login prompt. The default is Authorization Required but you can change this to whatever you like.

AuthType selects the type of user authentication that will be used. You can leave this as Basic

require let's all the valid users in the .htpasswd file access the directory.

Once your .htaccess file is set up, save and exit the file. You must now create the .htpasswd file. To do this you can use the htpasswd program that comes Apache. If you followed the Apache Guide, htpasswd should be located in /usr/local/apache/bin. If not you can run updatedb as root and then type locate htpasswd to find it.

To create the initial .htpasswd file you must use the -c flag. As root run:

htpasswd -c /usr/local/apache/htdocs/admin/.htpasswd username

Don't forget to change the directory .htpasswd will be located in. The above is set up for securing /usr/local/apache/htdocs/admin. As well change username to whatever username you want to use to log in. It will then prompt you for a password. The next time you add a user you can drop the -c flag since it is only used for the inital creation of the file.

If you haven't already restarted your Apache web server now is the time to do so. Once that has been taken care of, open up a web browser and try to access http://www.yourdomain.com/admin/ and see if it prompts you for a password. If something goes wrong check the Apache error log file.