Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

htaccess or chmod

Status
Not open for further replies.

coper

Technical User
Jan 4, 2002
36
US
Hello,

I have my server running r/h 7.1 and serving my domain.

# Path to DocumentRoot
/home/copper/
# Now I have a subdirectory that I want password protected.
/home/copper/
Would I use htaccess for this and if so can you recommend a tut on setting it up. I heard this was pretty secure.

Thanks
 
Hi,







At the simplest level you can use 'Basic' authentication via mod_auth reading a user/password file. You have something like this in your .htaccess :







AuthName "whatever"



AuthType Basic



AuthUserFile /var/


require user user1 user2 user3







Then you create the 'userfile' above with the first user :







/usr/bin/htpasswd -c /var/ user1







(it will prompt for password)







Add extra users with the same command but without the -c (create) flag :







/usr/bin/htpasswd /var/ user2







etc.







After that you should get a user/password prompt on access of the .htaccess directory. You must have valid users listed on the 'require' line as well as having them in the userauth file.
See also -->



Hope this helps
 
nope, i did just that, and it said i was not allowed, it did not give the option for user/pass it just said not allowed.
 
Aside from anything else, does the directory have Linux permissions such that the web server can access it- and of course the .htaccess etc. ? Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Hi,

...also does the <Directory> container have 'AllowOverride All' or equivalent ?

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top