/etc/avahi/services folder and it all works.
And then I thought: how do I test it works? (I don't use Epiphany, I use Firefox.) BonjourFoxy to the rescue too; it browses the local network for websites that are so advertised and displays them in a sidebar; works for all platforms.
So, this oughta work. (People with both Macs and Ubuntu; I'd appreciate it if you could use Ross's docs to advertise a local webpage with a specific path on the Ubuntu box and then see if Safari on the Mac picks it up.)
And this is Auto-discoverable local websites, written , and concerning Web, Sundry Hacks, and Linux
Comments
BonjourFoxy link is wrong fwiw.
Can you post the file that you put in /etc/avahi/services ?
Kjetil T: that's correct behaviour, according to the RFC-draft for mDNS (it halves the number of queries, and people wanting to publish https sites can just publish a http site that redirects to the https one).
See also mod_dnssd:
http://0pointer.de/lennart/projects/mod_dnssd/
http://packages.qa.debian.org/m/mod-dnssd.html
Roger: thanks, fixed.
Ben:
$ cat /etc/avahi/services/web.service
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name>FOWD 2009</name>
<service>
<type>_http._tcp</type>
<port>80
<txt-record>path=/~aquarius/fowd2009/</txt-record>
</service>
</service-group>
Sadly, (at least) epiphany does the wrong thing when going to the website, going to http://ip instead of http://name, which break virtualhosting.
Zeroconf continues to impress!
sil: is missing from that file?
Should be: is "tagstart" "slash" port "tagend" missing from web.service ?
Btw. is it also possible to publish URLs to completely different servers, or can you only publish URLs that are on the same server where Avahi is running? I haven't found any conclusive answer yet and would be grateful for some insights :-)
Mats: yes, it is. Sorry :)
oliver: I don't know. There's a suggestion in Ross's post that that feature was coming (and that was written in 2006), so I believe so, I've jst never done it.
sil: Thanks for the positive feedback on BonjourFoxy :)
oliver: You can advertise a service on behalf of another machine - here's an example:
Example Website
example.com
_http._tcp.
80
path=/
If an mDNS hostname needs to be created for the machine it can be added to '/etc/avahi/hosts' although there is a few limitations with this method.
The formatting for the example got chewed up so I have posted it here: http://andrew.tj.id.au/files/example-avahi-service.txt
Andrew: thanks for the example! I have tried it, but Ubuntu 9.04 can't resolve the host name (avahi-browse-domains -a -t -r does not give an IP for example.com). Do I have to add example.com to /etc/avahi/hosts even though its IP is available in normal DNS?
oliver: you should replace example.com with the hostname of the machine that's exporting the service you want to advertise.
Well I want to advertise some site that's on the Internet - something like a LAN-wide bookmark. Isn't that possible?
oliver: ah. I don't know whether that's possible or not. Andrew might know. :)
oliver: There shouldn't be any need to add records for a host that can already be resolved (whether it be via mDNS or DNS).
This is a snip from the output of 'avahi-browse-domains -a -t -r' on my system with the previous example active:
= eth0 IPv4 Example Website Web Site local
hostname = [example.com]
address = [208.77.188.166]
port = [80]
txt = ["path=/"]
Perhaps 'avahi-browse-domains -a -t -r -d dns-sd.org' might show if Avahi's having problems with unicast DNS for some reason?
Andrew: that's a good example. On Debian Lenny avahi-browse-domains -a -t -r -d dns-sd.org gives lots of resolved Internet-wide host names while on the Ubuntu Jaunty system it gives no output at all (resolving .local addresses works fine, though). Maybe it's a setup problem in my LAN or on the Jaunty system - will do some more checking. Thanks for your pointers!
I've been doing this for a while and it does indeed work with Safari. However safari only picks up services with type _http._tcp, while epiphany also picks up _https._tcp services.