HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   .htaccess / Apache (http://www.howtoforge.com/forums/showthread.php?t=82)

kermit 13th May 2005 12:41

.htaccess / Apache
 
I want to password-protect a directory with .htaccess. How can I do that?

deedee 18th May 2005 16:32

First, you have to create a file called .htaccess in the directory you want to password-protect:

Code:

AuthType Basic
AuthName "Members Only"
AuthUserFile /path/to/your/.htpasswd
<limit GET PUT POST>
require valid-user
</limit>

Then create the file /path/to/your/.htpasswd which contains the users that are allowed to login and their passwords. You can use the htpasswd command for it:

Code:

htpasswd /path/to/your/.htpasswd user1
htpasswd /path/to/your/.htpasswd user2
...

Obviously you have to adjust /path/to/your/.htpasswd :D


All times are GMT +2. The time now is 15:59.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.