LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   apache authentication (https://www.linuxquestions.org/questions/linux-software-2/apache-authentication-47459/)

plisken 02-27-2003 02:39 PM

apache authentication
 
I have created a user, and within their public_html directory, I have a small site, which I require users to be authenticated prior to gaining access.

Now I have set up the exact same site, which is located at /var/www and it works fine, but when I try to get it to authnticate using .htpasswd and .htaccess while using the fomat www.mydomain/~user/ it simply does not even ask for a user/pass.

As it works as expected in the /var/www location, then I would assume my .htaccess and .htpasswd files are configured properly.

Any ideas?

bulliver 02-27-2003 02:46 PM

This might have something to do with your AllowOveride directive in httpd.conf. You have to specify that httpd.conf may be overided by .htaccess files.

Look for something like this:
Code:

...
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/usr/local/httpd/htdocs">

AllowOverride All # or,
AllowOverride AuthConfig

...


plisken 02-27-2003 03:12 PM

Cool, that seemed to do it...

I didn't know that you had to explicitly define parameters for different directories.

I obviously had the parameters etc for /var/www but not for /home/user/public_html or whatever.

Cheers mate...

bulliver 02-28-2003 12:00 AM

Glad it works. Usually all apache directives work recursively from your document root but I guess that the ~user directory needs to be explicitly defined.


All times are GMT -5. The time now is 03:18 AM.