Linus
Posts: 23
Joined: Sat Mar 03, 2012 9:49 am

Announcing CUPS admin-website on Bonjour/avahi

Fri Jan 18, 2013 8:09 pm

Hello,

I'm having some problems announcing the CUPS-Admin Webpage over Bonjour (So that everyone in the network can look at current jobs that are running and so on).
I've pieced together a new .service file from some tutorials doing similar things but my Browser still doesn't like the address it's given from the avahi service.

Here's my .service file:

Code: Select all

/etc/avahi/services 
<?xml version="1.0"?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
        <name replace-wildcards="yes">HP DeskJet 970C @ %h</name>
        <service>
                <type>_http._tcp</type>
                 <port>631</port>
        </service>
</service-group>
And the address the browser gets is:
raspberrypi.local.:631/
and it in turn spits out "Bad Request". The dot after the raspberrypi.local is what causes the problem but I can't find a way to change that.

Has somebody had the same problem? Help would be greatly appreciated. :)

efflandt
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA

Re: Announcing CUPS admin-website on Bonjour/avahi

Tue Jan 22, 2013 5:18 am

Where does that address with the strange character after local come from? Assuming you have /etc/cups/cupsd.conf properly configured to allow LAN access:

Code: Select all

# Restrict access to the server...
<Location />
  Order allow,deny
  Allow @LOCAL
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow @LOCAL
</Location>
I did not add anything to default avahi services

Code: Select all

[email protected] ~ $ ls -l /etc/avahi/services
total 4
-rw-r--r-- 1 root root 299 Aug  1 13:41 udisks.service
But I can access cups web interface on the Raspberry Pi from Ubuntu Linux or Win7 (Bonjour). Although, in Windows even though I can ping the Pi as raspberrypi.local, Windows web browsers can never find it with the .local, but can find it as http://raspberrypi:631/ once you fix them to NOT think something is missing or search for something else.

For Internet Explorer you have to go to Tools > Internet Options > Search [Settings] and uncheck "Search in the address bar".

For Firefox you need to add the DNSSD extension to work with Bonjour. Then in location bar enter
about:config
filter: fixup
Then double click on following so it is false (to not assume www. prefix or .com suffix):
browser.fixup.alternate.enabled

Then http://raspberrypi:631/ should work in either Windows browser (not very quickly) and http://raspberrypi.local:631/ works in Linux Firefox.

Return to “Networking and servers”