Ubuntu – Apache “allow from” rule only works with ip addresses

apache-2.2Ubuntu

I have a pretty simple apache2 setup on a personal server – i.e. very little customization in the configuration file except for allow/deny rules, and I just upgraded Ubuntu versions from 8.04 – 8.10 on the machine in question. However, despite keeping the apache configuration files during the upgrade, apache now gives me "403 fobidden" if I try to access a formerly accessible web page, unless I use the local host. If I change

Allow from hostname.domain.local

to

Allow from 192.168.1.xxx

in the apache configuration file for the directory I'm requesting, I can access the page without a hitch.

Unfortunately my Apache skill set is not very advanced. Can anyone offer any suggestions as to why this might be happening?

Here's a few things we've tried:

  • nslookup by hostname an ip address
    from the affected computer (I get the
    expected results)
  • php -r 'echo gethostbyaddr("192.168.1.196")."\n";'
    This command replied with a hostname

Best Answer

Ok, I found the problem: It has to do with the avahi-daemon: see bug 80900 If I disable the daemon, apache works fine. There may be a configuration file I can edit, too, but for now disabling the daemon is all I can take time to do. I'll update this question if I find a better answer!

Related Topic