htaccess and apache

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

htaccess and apache

Post 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. :)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: htaccess and apache

Post 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.
(#10850)
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Re: htaccess and apache

Post by JKM »

Hmm, /etc/apache2/httpd.conf is empty.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: htaccess and apache

Post by pickle »

Make a phpinfo() page - that should tell you where the Apache conf is (I think).
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Re: htaccess and apache

Post by JKM »

I'm sorry - but where does it echo the path to the config file? I can't find it.
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Re: htaccess and apache

Post 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?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: htaccess and apache

Post by Eran »

Check that under your <Directory> settings for your document root AllowOverride is set to All (default is None)
Post Reply