RE: Can't get .htaccess to work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> > >For my httpd.conf, I have one main configuration file in /etc/httpd/conf
> > and for each virtual domain, I have individual
> > >www.mydomain.com.conf files with associated virtual host tags inside, and
> > located in /etc/httpd/conf.d directory.
>
> Okay. These are vhost configs only. You *can* set them globally in
> httpd.conf, but they can be overwritten later, so it's best to do it
> vhost by vhost.

OK so do/set what vhost by vhost?  Place the  AllowOverride AuthConfig
directive vhost by vhost?  If that's what yo u meant, I tried again inserting the

<Directory />
    Options FollowSymLinks
    AllowOverride AuthConfig
</Directory>

and the

<Directory />
    AllowOverride AuthConfig
</Directory>

directives inside the individual vhost file and am still not getting a login prompt on the site.
However this time, apache did reload for both directives.
The reason why It did not reload last time, was because all I did earlier was
insert the AllowOverride AuthConfig statement inside the vhost file, without the directory tags,
so at least there is some progress there ;)

> > >I also tried placing the AllowOverride AuthConfig directive inside the
> > individual conf.d virtual domain
> > >files but then apache would not reload, so I took them out and reloaded
> > again.
>
> This depends on where within the vhost config you put them. Apache
> should tell you exactly what line of the config the error is on, and
> what exactly is wrong with it.

I did not get indication from apache what line the syntax error
was or what file either, all I got was:

Reloading httpd: not reloading due to configuration syntax error
                                                           [FAILED]
But I guess that point is moot now since at least httpd is reloading.
I have however got line-syntax indications for other apache errors,
just don't know why I was not getting them for this error.

 
> > >Are the individual conf.d files causing the problem?
>
> Only because they aren't formatted properly.
>
>
> > <Location /secure>
> > AuthType basic
> > AuthName "private area"
> > AuthBasicProvider file
> > AuthDBMUserFile /home/maindir/.htpasswd
> > Require valid-user
> > </Location>
>
> This one is wrong because you're pointing a DBM statement to a flat
> user file which isn't in dbm format.
>
> > <Location /secure>
> > AuthType basic
> > AuthName "private area"
> > AuthBasicProvider file
> > Require valid-user
> > </Location>
>
> This one sets the auth type outside everything else, and provides
> multiple names.
>
> > AuthUserFile /home/maindir/.htpasswd
> > AuthType Basic
> > AuthName "My Secret Folder"
> > Require valid-user
>
>
>
> Here's a statement that I know works, from my nagios setup at home,
> altered for what you're looking to do.
>
>
> <Directory "/change/this">
> Options None
> AuthName "Nagios Access"
> AuthType Basic
> AuthUserFile /etc/httpd/htpasswd.users
> Require valid-user
> </Directory>

OK, just to make sure I am doing this exactly correct,
do I substitute "Nagios Access" to whatever login name I used when I
created my .htpasswd file?

Also, for Directory "/change/this", do I set this to the directory
where my .htpasswd file is located? Or is this the path to the dir I am trying to
protect?

Or, for AuthUserFile /etc/httpd/htpasswd.users, is this the path and filename
of the .htpasswd file?









Get in touch in an instant. Get Windows Live Messenger now.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux