[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] using htaccess to limit www access to a usersdirectory



I had the same thing happen to me.
Try using this for your .htaccess file:


AuthUserFile <path to>/.htpasswd
AuthName Protected_Area
AuthType Basic
AuthPAM_Enabled off

<Limit GET POST>
require valid-user
</Limit>



>Ok, I have searched and read all the posts on this topic and even tried the
>Interliant instructions from Team Cobalt @
>http://teamcobalt.interliant.com/faqs/faq_server.shtml
>But I keep getting [The server encountered an internal error or
>misconfiguration and was unable to complete your request.]
>
>The directory is /home/sites/site3/users/joeuser/web
>I created a .htaccess file in the directory I want protected
>the contents are:
>
># Access file
>order allow, deny
>allow from all
>require valid-user
>Authname protectedsite
>AuthPAM_Enabled off
>Authtype Basic
>AuthUserFile /etc/passwd (to use the system passwd file) I've tried leaving
>this line off also
>
>Then I created the .htpasswd file using /usr/sbin/htpasswd -c
>/home/sites/site3/users/joeuser/web joeuser
>I was prompted 2 times for the password. When I look in the users Dir using
>ls -a I see the .htpasswd file and it has the user and encrypted password
in
>it.
>I have also tried to create the htpasswd file in ./joeuser as opposed to
>./joeuser/web - SAME THING!!!
>What am I doing wrong?
>
Ok i figured it out!
what is was doing wrong was I had a space between the allow,deny line in the
.htaccess file

the correct line is:
order allow,deny

and the .htpasswd file must not be in a web accessiable folder. So I changed
the AuthUserFile line to /home/sites/site3/users/joeuser

works fine.

Thanks Johnc