Allow access to Apache server from .local name in URL

1

I am running an Apache server on one of my macs in my local network.

At the same time in my httpd.conf file I allow all the computers in the local network to access it using

allow from 192.168.1.

This allows access in the form http://192.168.1.x but NOT in the form http://server.local.

What other IPs do I have to allow for the DNS name to be resolved?

(when I allow all it works by the way). Thanks.

Leptoceratops

Posted 2014-02-05T20:17:33.077

Reputation: 11

You don't need to allow any IP addresses access, you need to set up DNS or add the name to the hosts file on all other devices. – Der Hochstapler – 2014-02-05T20:24:28.573

Answers

0

The "name.local" form is as far as i know a part of Apple Bonjour network zero-configuration protocol.

The easiest way to resolve name.local on other computers is to add a line in the hosts files of said computers.

The Bonjour Browser for Windows may help you to find your server from Windows Computers.

As far as i known, GNU/Linux OS have a Bonjour like (zero-configuration) protocol support in the form of Avahi. There is some compatiblity library available (on Ubuntu Saucy Salamander, in the package libavahi-compat-libdnssd1)

As for the Apache 2 configuration, you need a ServerName line, and may be a better written allow from:

ServerName name.local
Allow from 192.168.1.0/24

For localhost access, you may need to add:

ServerAlias localhost

Biapy

Posted 2014-02-05T20:17:33.077

Reputation: 959

Thank you. ServerName name.local worked!! BTW, before it worked on Firefox and NOT on Safari, but now it works on both. You do not happen to know why? – Leptoceratops – 2014-02-05T20:55:24.067

Firefox may have a better support of available local web services :D. URL resolution is quite specifics to the browsers. – Biapy – 2014-02-05T20:58:24.950

Another weird observation. Safari (v 6.1.1) on the "server" still will not resolve it but Safari (v 7.0.1) on "client" works after the ServerName change. Weird! – Leptoceratops – 2014-02-05T21:03:20.847

edited with a possible answer. – Biapy – 2014-02-05T21:05:23.420