Page 1 of 1

htaccess and apache

Posted: Fri Dec 11, 2009 12:47 pm
by JKM
Hi there!

I just installed apache and it's working great (so far), but I was just wondering if there's something I need to do so that I can make .htaccess work. I made this .htaccess file in /var/www/XXX/XXX/:

Code: Select all

AuthUserFile /var/htpasswd/.xxx
AuthGroupFile /var/htpasswd
AuthName "Password Protected Area"
AuthType Basic
<limit GET POST>
require valid-user
</limit>
The path to AuthUserFile is correct, and when I'm opening myhost.com/XXX/XXX, it doesn't ask for login or anything.

Thanks for any help. :)

Re: htaccess and apache

Posted: Fri Dec 11, 2009 1:28 pm
by Christopher
You need to make sure in your httpd.conf file that you allow ConfigOptions (or whatever it is called?) for that directory/site. There are several options available. See the Apache manual.

Re: htaccess and apache

Posted: Fri Dec 11, 2009 1:32 pm
by JKM
Hmm, /etc/apache2/httpd.conf is empty.

Re: htaccess and apache

Posted: Fri Dec 11, 2009 4:02 pm
by pickle
Make a phpinfo() page - that should tell you where the Apache conf is (I think).

Re: htaccess and apache

Posted: Fri Dec 11, 2009 4:42 pm
by JKM
I'm sorry - but where does it echo the path to the config file? I can't find it.

Re: htaccess and apache

Posted: Sat Dec 12, 2009 10:11 pm
by JKM
I'm running Ubuntu, so apache2 is using apache2.conf and not httpd.conf.

From apache2.conf:

Code: Select all

# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
 
AccessFileName .htaccess
So I can't understand why it won't work. Anyone got a clue?

Re: htaccess and apache

Posted: Sun Dec 13, 2009 3:57 am
by Eran
Check that under your <Directory> settings for your document root AllowOverride is set to All (default is None)