Main Menu
Home
Search
Support
How To's
OpenWiki
Contact Us
Users Blogs
User HowTo's
Announcements
Google Translation

 

 

 

 

apache 2.2, htpasswd & mod_authz_owner PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Paul Matthews   

This 'how-to' is to explain how to use apache 2.2 with the add on mod_authz_owner to protect a directory with htpasswd so that only the owner of the directory can access it.

Name: Apache
HomePage: http://www.apache.org/
Function: Webserver

 

1. Firstly lets make a file

mkdir /var/ww/html/private

2. Now lets change it's owner and permissions

chown user1:user1 -R /var/www/html/private

chmod ug+rwx -R /var/www/html/private

 

apache 2.2 htpasswd mod_authz_owner

3. Make the index.html file

nano /var/www/html/private/index.html

 

Code.conf:

<html>

<head>

<title>

Test Index Page

<title>

</head>

<body>

OpenSourceHowTo.Org rocks!!! And the How-To on apache 2.2, htpasswd & mod_authz_owner worked!!

</body>

</html> 


apache 2.2 htpasswd mod_authz_owner

4. Now set a username/password the same the owner of the file

htpasswd -c /etc/httpd/conf/htpasswd user1

 

apache 2.2 htpasswd mod_authz_owner

5. Next add the following the httpd.conf file

nano /etc/httpd/conf/httpd.conf file

 

httpd.conf:
<Directory /var/www/html/pma>
AuthName "only pma has access"
AuthType basic
AuthUserFile /etc/httpd/conf/htpasswd
require file-owner
</Directory>

 

apache 2.2 htpasswd mod_authz_owner

6. Next restart apache

/etc/init.d/httpd restart

 

apache 2.2 htpasswd mod_authz_owner

7. Go the the web address and enter in your password and username

http://ip-address-of-the-apache-box/private

 


BookMarking:

 

cell1

cell3 Submit to del.icio.us
cell4
AddThis Social Bookmark Button

 


Trouble Shooting:

 

Go to the wiki page

Go to the 'Contact Us ' Forum

Go to the how-to's Support Forum


External Links:

 

http://httpd.apache.org/docs/2.2/howto/auth.html

Last Updated ( Wednesday, 06 June 2007 )
 
< Prev   Next >