Jump to content

protecting directory with apache


marafa
 Share

Recommended Posts

Guest bradenm

OK, first put this in .htaccess of the dir you want to protect:

AuthUserFile /home/[your user name here]/.htpasswd

AuthGroupFile /dev/null

AuthName "Descriptive name of the protected area"

AuthType Basic

<Limit GET POST>

require user joe

require user pete

</Limit>

In the above you need to change AuthUserFile, AuthName, and change the words "joe"/"pete" etc. to usernames that you want to allow.

 

Next, run the command "/usr/sbin/htpasswd -c ~/.htpasswd [user name]" to set the password for each user.

 

I think that that's it!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...