个人工具

UbuntuHelp:HOWTO-enable-cups-browsing

来自Ubuntu中文

跳转至: 导航, 搜索

This is quick and dirty HOWTO for CUPS browsing on server via mdns/avahi/bonjour. This HOWTO is for some specific issues, ~+it should NOT be used+~ unless you are testing those issues. ~+It leaves CUPS unprotected+~. Moreover, anyone can print on printers on that server, there is no page counting, etc... Original from: http://www.grad.hr/~ivoks/ubuntu/cups/HOWTO-enable-browsing Wikibot So, um... what's the correct way to do this, then? Wikibot

I. Server is Ubuntu Breezy

Open terminal and type:

sudo /usr/share/cups/enable_browsing 1
cat /etc/cups/cupsd-browsing.conf

(it should print Browsing On; if not, open that file and edit it)

gksudo gedit /etc/cups/cupsd.conf

When file opens in gedit, search for line "Listen". It should be:

Listen 631

or

Listen IP_ADDRESS_OF_SERVER:631

There shouldn't be any other Listen or Port directive (at least not uncommented). Next is:

BrowseAddress 

it should be:

BrowseAddress @LOCAL

Comment out all BrowseOrder directives, at least for now. Make sure BrowseInterval is 30. Next is:

<Location />
Order Deny,Allow
Allow From @LOCAL
Deny From All
</Location>

This is how "/" location should look like. Restart cups:

sudo /etc/init.d/cupsys restart

II. Server is Ubuntu Dapper

Open terminal and run:

sudo /usr/share/cups/enable_browsing 1

sudo /usr/share/cups/enable_sharing 1

cat /etc/cups/cups.d/ports.conf

You should see:

Listen 631
Listen /var/run/cups/cups.sock

Now do

cat /etc/cups/cups.d/browse.conf

You should see:

Browsing on

Restart cups:

sudo /etc/init.d/cupsys restart

III. Other Linux distribution or Mac OSX

On other operating systems, you should mostly follow instructions for Breezy. Only thing that's different is that there is no /etc/cups/cupsd-browsing.conf or /usr/share/cups/enable_browsing. It's important to make sure there is a line with Browsing On in /etc/cups/cupsd.conf and other relevant directives (see Ubuntu Breezy instructions). Restart cups.