Setting up htpasswd

resglowing

Registered
I want to set up htpasswd for users on our server. I added .htaccess:
AuthUserFile .htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic

<Limit GET>
require user username
</Limit>

and .htpasswd files to a test directory. I also uncommented
AccessFileName .htaccess in the main httpd.conf as well as configured the users conf
<Directory "/Users/user/Sites/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

But I still get no login window.
Any ideas?
 
here is a good tute on htaccess. the latter half talks about using the /etc/passwd file, wich is nice. tale a look at this:

http://www.devshed.com/Server_Side/PHP/UserAuth/page1.html

another way to do this is not using htaccess/htpasswd at all. you can add this directive to your main httpd.conf file, or what i do is put it in a seperate .conf file and include it in the main one (just to keep things neat and tidy).

Code:
# Alias the /Volumes/Contents 2/Development/ directory to
# [url]http://www.yourdomain.com/dev/[/url] hierarchy.

Alias /dev "/Volumes/Contents 2/Development"

<Directory "/Volumes/Contents 2/Development/">
  Options MultiViews
  AllowOverride None
  Order allow,deny
  Allow from all

  AuthName "Development Area"
  AuthType Basic
  <Limit GET HEAD OPTIONS CONNECT POST>
    Require group staff
  </Limit>
</Directory>

this will will work with the parent or chield netinfo authentication. i am using it on child netinfo OSXS boxes, and it works great. change the group to whatever group you want, or if you just want a single user, you can change it to that as well. the reason i like this meathod a lot better is b/c it authenticated to the OSXS netinfo db.
 
Back
Top