You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jacob <fu...@yahoo.com> on 2006/06/13 22:38:19 UTC

[users@httpd] .htaccess pages refuse to work, AllowOverride or not

I've been trying to wrestle answers out of Google for two days now, but 
I finally decided that I have done enough looking to be a worthy poster 
of your newsgroup. ;)

Basically, I want an authentication system where one of those nifty 
username and password dialog boxes appear and ask for a password. I know 
it isn't the most secure thing in the world, but it is at least something.

I have written down the 3 changes I've made to the configuration since a 
fresh install.

1. Added these lines to the bottom of the /etc/apache2/apache2.conf 
configuration file. /var/www/ is the root directory of my website.
<Directory "/var/www/">
         AllowOverride AuthConfig
         Options None
</Directory>
2. Wrote this .htaccess file in /var/www/:
AuthType Digest
AuthName "Private"
AuthDigestFile /var/www/.htpasswd
Require valid-user
3. Ran the command sudo htdigest -c /var/www/.htpasswd <DOMAIN> jacob
NOTE: I replaced <DOMAIN> with the address of my website minus the http 
part.
4. Created an empty index2.html file in /var/www/, and opened it in a 
browser.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: .htaccess pages refuse to work, AllowOverride or not

Posted by Jacob <fu...@yahoo.com>.
Comments inserted below.

Joshua Slive wrote:
> 
> And what happened?!?!  What exactly was the result in the browser?

A blank page. Nothing whatsoever.

> What exactly is in the error and access logs?

Nothing.

> 
> One source of problems that you should just get rid of is the
> .htaccess file itself.  Put the auth directives inside the <Directory>
> section in httpd.conf.  There is no reason to use .htaccess if you
> have access to httpd.conf.

Thanks for this solution! It has fixed my problem! I wonder why most 
tutorials online have you make a .htaccess file in the first place 
without mentioning this alternative...

> 
> Joshua.
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess pages refuse to work, AllowOverride or not

Posted by Joshua Slive <jo...@slive.ca>.
On 6/13/06, Jacob <fu...@yahoo.com> wrote:
> I've been trying to wrestle answers out of Google for two days now, but
> I finally decided that I have done enough looking to be a worthy poster
> of your newsgroup. ;)
>
> Basically, I want an authentication system where one of those nifty
> username and password dialog boxes appear and ask for a password. I know
> it isn't the most secure thing in the world, but it is at least something.
>
> I have written down the 3 changes I've made to the configuration since a
> fresh install.
>
> 1. Added these lines to the bottom of the /etc/apache2/apache2.conf
> configuration file. /var/www/ is the root directory of my website.
> <Directory "/var/www/">
>          AllowOverride AuthConfig
>          Options None
> </Directory>
> 2. Wrote this .htaccess file in /var/www/:
> AuthType Digest
> AuthName "Private"
> AuthDigestFile /var/www/.htpasswd
> Require valid-user
> 3. Ran the command sudo htdigest -c /var/www/.htpasswd <DOMAIN> jacob
> NOTE: I replaced <DOMAIN> with the address of my website minus the http
> part.
> 4. Created an empty index2.html file in /var/www/, and opened it in a
> browser.

And what happened?!?!  What exactly was the result in the browser?
What exactly is in the error and access logs?

One source of problems that you should just get rid of is the
.htaccess file itself.  Put the auth directives inside the <Directory>
section in httpd.conf.  There is no reason to use .htaccess if you
have access to httpd.conf.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org