Apache Server configuration support - .htaccess file not working

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > December 2007 > .htaccess file not working





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author .htaccess file not working
Vladimir Tserijemiwtz

2007-12-24, 7:21 pm

I created a directory in my webserver's document directory. In this
directory I created a .htaccess file using the instructions at

http://httpd.apache.org/docs/1.3/howto/auth.html

I also created the password file using htpasswd. This HOWTO seems to say
that if I place the .htaccess file in this directory it will prompt me for a
password. It also appears to be saying that I don't need to edit the
httpd.conf file nor restart Apache.

So I access this folder from one of the machines on the LAN and poof, I'm
in. No password prompt appears at all.

Can someone tell me what I did wrong?


Wietse Muizelaar

2007-12-24, 7:21 pm

On 2007-12-24, Vladimir Tserijemiwtz <vtserijemiwtz@msn.com> wrote:
> I created a directory in my webserver's document directory. In this
> directory I created a .htaccess file using the instructions at
>
> http://httpd.apache.org/docs/1.3/howto/auth.html
>
> I also created the password file using htpasswd. This HOWTO seems to say
> that if I place the .htaccess file in this directory it will prompt me for a
> password. It also appears to be saying that I don't need to edit the
> httpd.conf file nor restart Apache.
>
> So I access this folder from one of the machines on the LAN and poof, I'm
> in. No password prompt appears at all.
>
> Can someone tell me what I did wrong?


Do you have the AllowOverride setting in the httpd.conf?

--
Cheers,
Wietse
Vladimir Tserijemiwtz

2007-12-24, 7:21 pm


"Wietse Muizelaar" <wietse.muizelaar@xs4all.nl> wrote in message
news:slrnfn08sn.8fk.wietse.muizelaar@localhost.localdomain...
> On 2007-12-24, Vladimir Tserijemiwtz <vtserijemiwtz@msn.com> wrote:
>
> Do you have the AllowOverride setting in the httpd.conf?
>
> --
> Cheers,
> Wietse


My httpd.conf file has this line in it:'

AllowOverride None

Is this what you mean? Should I change it to AlllowOverride All or
something.


Wietse Muizelaar

2007-12-24, 7:21 pm

On 2007-12-24, Vladimir Tserijemiwtz <vtserijemiwtz@msn.com> wrote:
>
> "Wietse Muizelaar" <wietse.muizelaar@xs4all.nl> wrote in message
> news:slrnfn08sn.8fk.wietse.muizelaar@localhost.localdomain...
>
> My httpd.conf file has this line in it:'
>
> AllowOverride None
>
> Is this what you mean? Should I change it to AlllowOverride All or
> something.


Yep. This means .htaccess-files aren't allowed. See
http://httpd.apache.org/docs/1.3/mo...l#allowoverride for
possible values; and pick the one you prefer.

--
Cheers,
Wietse
Vladimir Tserijemiwtz

2007-12-24, 7:21 pm

"Wietse Muizelaar" <wietse.muizelaar@xs4all.nl> wrote in message
news:slrnfn09jh.8fk.wietse.muizelaar@localhost.localdomain...
> On 2007-12-24, Vladimir Tserijemiwtz <vtserijemiwtz@msn.com> wrote:
>
> Yep. This means .htaccess-files aren't allowed. See
> http://httpd.apache.org/docs/1.3/mo...l#allowoverride for
> possible values; and pick the one you prefer.
>
> --
> Cheers,
> Wietse


Thanks for your help.. I really hate to be a pain but this is just not
working. Let me see if I explain it very carefully because something is just
not working. Remember I'm running 1.3

1. I executed the command htpasswd -c /path/to/passwdfile fred
2. I entered and confirmed the password for user fred
3. I then created an .htaccess file in the folder I want to protect
AuthType Basic
AuthName "By Invitation Only"
AuthUserFile /path_to/passwd_file
Require user fred
4. I edited the httpd.conf file
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
5. I then restarted Apache

The folder is still wide open. No password prompt appears. I cleared the
cache in the browser but got the same thing.

I even tried to lock down the actual folder in httpd.conf like this
<Directory "/usr/local/www/data/jic">
AllowOverride All
AuthType Basic
AuthName "By Invitation Only"
AuthUserFile /home/frank/incoming/misc/appass
Require user fred
</Directory>

This at least asked for a password but then refused entry even though I was
using the correct password and username.

Any advice would be helpful.


5. I


Vladimir Tserijemiwtz

2007-12-24, 7:21 pm


"Vladimir Tserijemiwtz" <vtserijemiwtz@msn.com> wrote in message
news:OI2dnXLf8c6vr-3anZ2dnUVZ_uCinZ2d@comcast.com...
> "Wietse Muizelaar" <wietse.muizelaar@xs4all.nl> wrote in message
> news:slrnfn09jh.8fk.wietse.muizelaar@localhost.localdomain...
>
> Thanks for your help.. I really hate to be a pain but this is just not
> working. Let me see if I explain it very carefully because something is
> just not working. Remember I'm running 1.3
>
> 1. I executed the command htpasswd -c /path/to/passwdfile fred
> 2. I entered and confirmed the password for user fred
> 3. I then created an .htaccess file in the folder I want to protect
> AuthType Basic
> AuthName "By Invitation Only"
> AuthUserFile /path_to/passwd_file
> Require user fred
> 4. I edited the httpd.conf file
> <Directory />
> Options FollowSymLinks
> AllowOverride All
> </Directory>
> 5. I then restarted Apache
>
> The folder is still wide open. No password prompt appears. I cleared the
> cache in the browser but got the same thing.
>
> I even tried to lock down the actual folder in httpd.conf like this
> <Directory "/usr/local/www/data/jic">
> AllowOverride All
> AuthType Basic
> AuthName "By Invitation Only"
> AuthUserFile /home/frank/incoming/misc/appass
> Require user fred
> </Directory>
>
> This at least asked for a password but then refused entry even though I
> was using the correct password and username.
>
> Any advice would be helpful.
>
>
> 5. I
>
>

Don't know what I did differently this time but it's working now....I did
set AllowOverride all in the <Directory /usr/local/www/data> section. That
seems to have done the trick.

Thanks again.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com