[CentOS] CentOS 4 snag with htaccess

Sun Jul 24 18:13:27 UTC 2005
John Hinton <webmaster at ew3d.com>

dan1 wrote:

>>I'm hitting a snag with htaccess. Have created .htaccess and .htpasswd 
>>files, set up apache directory options just like always... the exact same 
>>setup works fine on CentOS 3, but I can't seem to get it to authenticate on 
>>CentOS 4? Am I just being blind stupid (as in not seeing something 'exactly 
>>the same') or is there something different I'm missing? I have selinux 
>>running in warn mode I think it was, but not fully enabled.
>>
>>Best,
>>John Hinton
>>    
>>
>
>Hello, John.
>
>The problem might be that you have the mod_auth_mysql module enabled.
>Please have a look at your '/var/log/httpd/ssl_error_log' file. If you find 
>an error like the following:
>'MySQL ERROR: Table 'test.user_info' doesn't exist'
>Then it means that the mod_auth_mysql module is enabled, making Apache to 
>look for the permissions in the MySQL database, and completely forgetting 
>the .htaccess and .htpasswd files.
>
>In this case, just remove the module like this:
>
>yum remove mod_auth_mysql
>or
>rpm -e mod_auth_mysql
>
>And then restart apache: 'service httpd restart'
>
>Then it should work. This is a strange behaviour I know, but it doesn't 
>bother anybody, appart of those using that function unfortunately...
>
>Else, please report the error that you receive in your 
>/var/log/httpd/ssl_error_log' file.
>
>Regards,
>Daniel
>
>  
>
I did have mod_auth_mysql installed, but it doesn't seem to be the 
problem. Removed it just in case. I have been back through again and 
again.... compared this machine with another CentOS 4 install (forgot 
about my success on that machine), where I'm not having any trouble. The 
only difference that is obvious to me between the two machines, is that 
yes I do have selinux installed in the 'warning only'  mode on the 
troublesome box.

While trying to make things as indentical as possibly between the two 
machines, I found different perms on the .htaccess and .htpasswd files, 
so I changed them... still no go

-rw-r--r--  root     root     root:object_r:httpd_sys_content_t .htaccess

are the perms I now have set on both files. Of course the other machine 
doesn't do a return on ls -Za

[Sun Jul 24 12:57:04 2005] [warn] RSA server certificate CommonName (CN) 
`localhost.localdomain' does NOT match server name!?

Are the only entries from ssl_error_log and they show only during 
restart of apache. I don't have a domain on this machine that I'd like 
to set as the default ssl domain, so I haven't done much with the ssl 
conf settings other than entering the server IP.

Another difference between the two boxes, is the working box is a single 
domain box, so .htaccess is on the root domain. The one not working is a 
vhost on the box. I know that 'could' make a difference, but if it does 
I'm going to be really bothered!

I have hit logs everywhere I can think to look and I can't find 
anything! It's like apache is simply not finding the .htaccess file, in 
spite of being told to look for one. I even tried adding AccessFileName 
.htaccess inside the virtualhost directive, and that didn't do anything 
either. It does exist in the main server conf area. WOW!!! I've never 
had such trouble!!!

So, I disabled selinux, rebooted and still have the same issue..... I 
guess it's time to go off in another direction... get it working 
somewhere else, and then try to figure out what I've missed. I must be 
overlooking something... but darn if I've ever had it hidden so well.

Thanks
John Hinton