个人工具

“UbuntuHelp:NetworkPrintingWithUbuntu”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/NetworkPrintingWithUbuntu}}
 
{{From|https://help.ubuntu.com/community/NetworkPrintingWithUbuntu}}
 
{{Languages|UbuntuHelp:NetworkPrintingWithUbuntu}}
 
{{Languages|UbuntuHelp:NetworkPrintingWithUbuntu}}
 +
<<Include(Tag/Unsupported)>>
 +
<<Include(Tag/Duplicate)>>
 
== Overview ==
 
== Overview ==
Ubuntu supports network printing, so you can print from either your Ubuntu machine or a Windows machine etc, to another Ubuntu machine that has a printer attached (ie a "print server"). This page covers these scenarios only.  
+
Ubuntu supports network printing, so you can print from either your Ubuntu machine or a Windows machine etc, to another Ubuntu machine that has a printer attached (ie a "print server"). This page covers these scenarios only.
 
This page does not cover printing from Ubuntu to a printer attached to a Windows machine, ie a Windows print server. The [[UbuntuHelp:WindowsXPPrinter|WindowsXPPrinter]] page addresses this.
 
This page does not cover printing from Ubuntu to a printer attached to a Windows machine, ie a Windows print server. The [[UbuntuHelp:WindowsXPPrinter|WindowsXPPrinter]] page addresses this.
 
== Background ==
 
== Background ==
第20行: 第22行:
 
* Show printers shared by other systems
 
* Show printers shared by other systems
 
* Publish shared printers connected to this system
 
* Publish shared printers connected to this system
<ol><li>Select the '''OK''' button.</li></ol>
+
<ol><li>Select the '''OK''' button.
 +
</li><li>Right click on the printer you want to share and select '''properties'''
 +
</li><li>Click on Policies.
 +
</li><li>Check the '''Shared''' box then click Apply and OK.</li></ol>
  
 
=== Ubuntu Client Computer ===
 
=== Ubuntu Client Computer ===
第42行: 第47行:
 
<ol><li>On the server machine (the one the printer is attached to) open up printer manager with</li></ol>
 
<ol><li>On the server machine (the one the printer is attached to) open up printer manager with</li></ol>
  
<pre><nowiki>  
+
<pre><nowiki>
sudo system-config-printer  
+
sudo system-config-printer
 
     </nowiki></pre>
 
     </nowiki></pre>
 
Or '''System->Administration->Printing'''.
 
Or '''System->Administration->Printing'''.
第49行: 第54行:
 
</li><li>Click on the Apply button;</li></ol>
 
</li><li>Click on the Apply button;</li></ol>
  
If the ubuntu print server has a dynamic ip, you can solve it by replacing the numbers in the ipp address with the network name. On a local network, you can add the ".local" suffix, for example if your server is called "newton":  
+
If the ubuntu print server has a dynamic ip, you can solve it by replacing the numbers in the ipp address with the network name. On a local network, you can add the ".local" suffix, for example if your server is called "newton":
 
<pre><nowiki>
 
<pre><nowiki>
 
       ipp://newton.local
 
       ipp://newton.local
第57行: 第62行:
 
1.Open up the printer manager '''System->Administration->Printing'''
 
1.Open up the printer manager '''System->Administration->Printing'''
 
Or open the Terminal:
 
Or open the Terminal:
<pre><nowiki>  
+
<pre><nowiki>
sudo system-config-printer  
+
sudo system-config-printer
 
     </nowiki></pre>
 
     </nowiki></pre>
 
2.Under the '''Server Settings''' check the '''Show Printers shared by others systems''' option.
 
2.Under the '''Server Settings''' check the '''Show Printers shared by others systems''' option.
第69行: 第74行:
 
<ol><li>On the server machine (the one the printer is attached to) open up printer manager with</li></ol>
 
<ol><li>On the server machine (the one the printer is attached to) open up printer manager with</li></ol>
  
<pre><nowiki>  
+
<pre><nowiki>
sudo gnome-cups-manager  
+
sudo gnome-cups-manager
 
     </nowiki></pre>
 
     </nowiki></pre>
 
or '''System->Administration->Printing'''.
 
or '''System->Administration->Printing'''.
第76行: 第81行:
  
 
=== Ubuntu Client Machine ===
 
=== Ubuntu Client Machine ===
Now on the client(s) open up the printer manager '''System->Administration->Printing''' and under the '''Global Settings''' check the '''Detect LAN Printers''' option.Then go to '''Printer->Add Printer''' check the '''Network Printer''' option and in the area marked '''URI''' write something like  
+
Now on the client(s) open up the printer manager '''System->Administration->Printing''' and under the '''Global Settings''' check the '''Detect LAN Printers''' option.Then go to '''Printer->Add Printer''' check the '''Network Printer''' option and in the area marked '''URI''' write something like
 
ipp://192.168.0.1/printers/<name of printer>
 
ipp://192.168.0.1/printers/<name of printer>
 
where 192.168.0.1 is your servers ip address and <name of printer> is the name you gave the printer when you set  it up (usually the model of the printer). Click '''Next''' and select the brand,model, and driver just like you did when setting up the printer on the server. Click '''Next''' and fill in the name and description like on the server's printer then click '''Next'''.
 
where 192.168.0.1 is your servers ip address and <name of printer> is the name you gave the printer when you set  it up (usually the model of the printer). Click '''Next''' and select the brand,model, and driver just like you did when setting up the printer on the server. Click '''Next''' and fill in the name and description like on the server's printer then click '''Next'''.
There you should now have a networked printer.  
+
There you should now have a networked printer.
 
=== WindowsXP Client Machine ===
 
=== WindowsXP Client Machine ===
 
<ol><li>Open the Control Panel
 
<ol><li>Open the Control Panel
第108行: 第113行:
 
Listen 192.168.0.1:631
 
Listen 192.168.0.1:631
 
Assuming 192.168.0.1 is your servers ip address.
 
Assuming 192.168.0.1 is your servers ip address.
Restart cups with  
+
Restart cups with
 
sudo /etc/init.d/cupsys restart
 
sudo /etc/init.d/cupsys restart
 
=== Ubuntu Client Machine ===
 
=== Ubuntu Client Machine ===
Now on the client(s) open up the printer manager '''System->Administration->Printing''' and under the '''Global Settings''' check the '''Detect LAN Printers''' option.Then go to '''Printer->Add Printer''' check the '''Network Printer''' option and in the area marked '''URI''' write something like  
+
Now on the client(s) open up the printer manager '''System->Administration->Printing''' and under the '''Global Settings''' check the '''Detect LAN Printers''' option.Then go to '''Printer->Add Printer''' check the '''Network Printer''' option and in the area marked '''URI''' write something like
 
ipp://192.168.0.1/printers/<name of printer>
 
ipp://192.168.0.1/printers/<name of printer>
 
where 192.168.0.1 is your servers ip address and <name of printer> is the name you gave the printer when you set  it up usually the model of the printer.Click '''Next''' and select the brand,model, and driver just like you did when setting up the printer on the server.Click '''Next''' and fill in the name and description like on the server's printer then click '''Next'''.
 
where 192.168.0.1 is your servers ip address and <name of printer> is the name you gave the printer when you set  it up usually the model of the printer.Click '''Next''' and select the brand,model, and driver just like you did when setting up the printer on the server.Click '''Next''' and fill in the name and description like on the server's printer then click '''Next'''.
There you should now have a networked printer.  
+
There you should now have a networked printer.
 
== Ubuntu 5.10 ==
 
== Ubuntu 5.10 ==
 
... print from one Ubuntu desktop ("client") machine to another Ubuntu ("print server") machine that has a printer connected to it.
 
... print from one Ubuntu desktop ("client") machine to another Ubuntu ("print server") machine that has a printer connected to it.
第130行: 第135行:
 
     # which serves printers within a private local area network.
 
     # which serves printers within a private local area network.
 
     # - There is no need for additional security within the print server, ie only authorises people can access the machine.
 
     # - There is no need for additional security within the print server, ie only authorises people can access the machine.
   
+
 
 
     # This setup also allows access to the CUPS "Administrative tasks" system
 
     # This setup also allows access to the CUPS "Administrative tasks" system
 
     # via your web browser to http://localhost:631
 
     # via your web browser to http://localhost:631
 
     # File based on Ubuntu 5.10 (Breezy Badger) (Linux version 2.6.12-10-386)
 
     # File based on Ubuntu 5.10 (Breezy Badger) (Linux version 2.6.12-10-386)
 
     # Server Directives are explained in http://localhost:631/sam.html
 
     # Server Directives are explained in http://localhost:631/sam.html
   
+
 
 
     # 25/04/2006
 
     # 25/04/2006
  
   
+
 
 
     ConfigFilePerm 0600
 
     ConfigFilePerm 0600
 
     LogLevel info
 
     LogLevel info
第149行: 第154行:
 
     BrowseAddress 172.16.0.0/12
 
     BrowseAddress 172.16.0.0/12
 
     BrowseAddress 192.168.0.0/16
 
     BrowseAddress 192.168.0.0/16
   
+
 
 
     <Location />
 
     <Location />
 
     AuthType None
 
     AuthType None
第159行: 第164行:
 
     Allow From 192.168.0.0/16
 
     Allow From 192.168.0.0/16
 
     </Location>
 
     </Location>
   
+
 
 
     <Location /jobs>
 
     <Location /jobs>
 
     AuthType None
 
     AuthType None
第169行: 第174行:
 
     Allow From 192.168.0.0/16
 
     Allow From 192.168.0.0/16
 
     </Location>
 
     </Location>
   
+
 
 
     <Location /printers>
 
     <Location /printers>
 
     AuthType None
 
     AuthType None
第179行: 第184行:
 
     Allow From 192.168.0.0/16
 
     Allow From 192.168.0.0/16
 
     </Location>
 
     </Location>
   
+
 
 
     <Location /admin>
 
     <Location /admin>
 
     AuthType None
 
     AuthType None
第213行: 第218行:
 
     # - no need for security within the machine, ie a personal workstation
 
     # - no need for security within the machine, ie a personal workstation
 
     # - a network connection to a local network, where it will find CUPS-controlled printer servers
 
     # - a network connection to a local network, where it will find CUPS-controlled printer servers
   
+
 
 
     # This setup also allows access to the "Administrative tasks" system at
 
     # This setup also allows access to the "Administrative tasks" system at
 
     # http://localhost:631
 
     # http://localhost:631
 
     # File based on Ubuntu 5.10 (Breezy Badger) (Linux version 2.6.12-10-386)
 
     # File based on Ubuntu 5.10 (Breezy Badger) (Linux version 2.6.12-10-386)
 
     # Server Directives are explained in http://localhost:631/sam.html
 
     # Server Directives are explained in http://localhost:631/sam.html
   
+
 
 
     # 25/04/2006
 
     # 25/04/2006
  
   
+
 
 
     ConfigFilePerm 0600
 
     ConfigFilePerm 0600
 
     LogLevel info
 
     LogLevel info
第232行: 第237行:
 
     #Listen 192.168.0.0/24:631
 
     #Listen 192.168.0.0/24:631
 
     Port 631
 
     Port 631
   
+
 
 
     ### Which print servers to use
 
     ### Which print servers to use
 
     Include cupsd-browsing.conf
 
     Include cupsd-browsing.conf
第241行: 第246行:
 
     BrowseAllow from 172.16.0.0/12
 
     BrowseAllow from 172.16.0.0/12
 
     BrowseAllow from 192.168.0.0/16
 
     BrowseAllow from 192.168.0.0/16
   
+
 
 
     <Location />
 
     <Location />
 
     AuthType None
 
     AuthType None
第248行: 第253行:
 
     Allow From @LOCAL
 
     Allow From @LOCAL
 
     </Location>
 
     </Location>
   
+
 
 
     <Location /jobs>
 
     <Location /jobs>
 
     AuthType None
 
     AuthType None
第255行: 第260行:
 
     Allow From @LOCAL
 
     Allow From @LOCAL
 
     </Location>
 
     </Location>
   
+
 
 
     <Location /printers>
 
     <Location /printers>
 
     AuthType None
 
     AuthType None
第262行: 第267行:
 
     Allow From @LOCAL
 
     Allow From @LOCAL
 
     </Location>
 
     </Location>
   
+
 
 
     <Location /admin>
 
     <Location /admin>
 
     AuthType None
 
     AuthType None
第275行: 第280行:
 
       sudo /etc/init.d/cupsys restart</nowiki></pre>
 
       sudo /etc/init.d/cupsys restart</nowiki></pre>
 
or use the '''Services''' tool under Gnome menu '''System -> Administration'''.
 
or use the '''Services''' tool under Gnome menu '''System -> Administration'''.
After CUPS is restarted, the printers on file servers, (eg, set up in the Print Servers section above) will be found automatically by your machine. They will pop up in your "Printers" screen. This might take up to 30 seconds though.th  
+
After CUPS is restarted, the printers on file servers, (eg, set up in the Print Servers section above) will be found automatically by your machine. They will pop up in your "Printers" screen. This might take up to 30 seconds though.th
If you want your machine to print to printers on other Ubuntu hosts, and also to be a print server for other machines, you need to create a combination of the above two cupsd.conf files.  
+
If you want your machine to print to printers on other Ubuntu hosts, and also to be a print server for other machines, you need to create a combination of the above two cupsd.conf files.
 
=== Windows Client Machine ===
 
=== Windows Client Machine ===
 
Add the printer to the Windows client by using the Windows "Add Printer" Wizard. Type in the following in the printer URL:
 
Add the printer to the Windows client by using the Windows "Add Printer" Wizard. Type in the following in the printer URL:
第302行: 第307行:
 
----
 
----
 
''This info is current for Ubuntu 5.10 (Breezy Badger)''
 
''This info is current for Ubuntu 5.10 (Breezy Badger)''
 +
----
 +
[[category:CategoryNetworking]]
 +
== Troubleshooting ==
 +
'''Bypassing firewall.'''
 +
If there is an firewall either on print server or the client side, there might appear a communications problem. Use this command to update the firewall to get through.
 +
<pre><nowiki>
 +
iptables -A INPUT -p tcp --dport 631 -j ACCEPT
 +
</nowiki></pre>
 +
* This rule is used for IPP only. If you're using other protocol, such as SAMBA, you have to adapt.
 +
* You might need to use this rule on both sides (server & client) if the firewall is being used on both of them.
 +
* To apply this rule after each start/restart of the system, use [[UbuntuHelp:RcLocalHowto|/etc/rc.local]] .
 
----
 
----
 
[[category:CategoryNetworking]]
 
[[category:CategoryNetworking]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月19日 (三) 23:44的最新版本

<<Include(Tag/Unsupported)>> <<Include(Tag/Duplicate)>>

Overview

Ubuntu supports network printing, so you can print from either your Ubuntu machine or a Windows machine etc, to another Ubuntu machine that has a printer attached (ie a "print server"). This page covers these scenarios only. This page does not cover printing from Ubuntu to a printer attached to a Windows machine, ie a Windows print server. The WindowsXPPrinter page addresses this.

Background

Ubuntu uses the Common UNIX Printing System ("CUPS") to handle printing. CUPS uses the Internet Printing Protocol ("IPP") as the basis for managing print jobs and queues. The Line Printer Daemon ("LPD") Server Message Block ("SMB"), and AppSocket (a.k.a. JetDirect) protocols are also supported with reduced functionality. This page describes network printing with CUPS and IPP. CUPS printer configuration and management is handled by the Printer Admin utility launched from the Gnome menu - System -> Administration -> Printing. In addition CUPS provides command-line commands that are similar to old Berkley and SystemV print commands such as lpq, lpstat etc. Also IPP provides web services so after you have configured CUPS appropriately, you can access the printers and jobs via your web browser. When a locally attached printer is defined, eg using the Printer Admin utility, that printer is automatically published from this "print server" host to the network, depending on the server directives in the CUPS configuration file. A remote Ubuntu "client" host can then be able to see and use the printer attached to the server. The network printer automatically appears in the client's Printer Admin utility. It simply pops up if CUPS is up and configured correctly and disappears if you stop CUPS at either the Print Server or your local machine.

Ubuntu 9.04

Printer sharing in Ubuntu 9.04 Jaunty is a very similar process as in previous versions, but some of the front-end wording for options has been changed.

Ubuntu Print Server

The Print Server is the Ubuntu computer that is directly connected to the printers.

  1. On the server machine (the one the printer is attached to) open up printer manager with by going to System in the top toolbar panel, then Administration and Printing. This will open the Printer Configuration window.
  2. Select Server in the menu bar, and then Settings.
  3. This will open the Basic Server Settings window. If this computer only serves as a Print Server and does not need access to a printer connected to another computer select the second box.
  • Publish shared printers connected to this server

If this computer acts as both a Print Server and a client (it does need access to a printer connected to another computer), select the first two boxes

  • Show printers shared by other systems
  • Publish shared printers connected to this system
  1. Select the OK button.
  2. Right click on the printer you want to share and select properties
  3. Click on Policies.
  4. Check the Shared box then click Apply and OK.

Ubuntu Client Computer

The Client Computer is the Ubuntu computer that is not directly connected to the printer, but is connected to the same network as the Print Server. If both computers are receiving an internet connection from the same router then these two computers are networked.

  1. Enter the same menu

Systems > Administration > Printing Server > Settings

  1. If this computer only acts as a Client (it has no printers attached that need to be shared), select the first box.
  • Show printers shared by other systems

If this computer acts as both a Client and a Server select the first two boxes.

  • Show printers shared by other systems
  • Publish shared printers connected to this server
  1. Select the OK button.

In a few seconds the Printer Configuration window will update and icons for the printer/s attached to the Server will be shown.

Ubuntu 7.10

Printer sharing in Ubuntu 7.10 Gutsy is very simple. It no longer requires manual editing of config files. I will assume there is a working printer installed and printing on the Ubuntu computer that will be used as the print server.

Ubuntu Print Server

  1. On the server machine (the one the printer is attached to) open up printer manager with
sudo system-config-printer
    

Or System->Administration->Printing.

  1. Under Server Settings check, i.e, turn on, the Share published printers connected to this system.
  2. Click on the Apply button;

If the ubuntu print server has a dynamic ip, you can solve it by replacing the numbers in the ipp address with the network name. On a local network, you can add the ".local" suffix, for example if your server is called "newton":

       ipp://newton.local
    

Ubuntu Client Machine

Now on the client(s) (the one that you want to link to the shared printer that is in server machine): 1.Open up the printer manager System->Administration->Printing Or open the Terminal:

sudo system-config-printer
    

2.Under the Server Settings check the Show Printers shared by others systems option.

  1. Click on the Apply button;

Then you can open any document, and try to print it. It should appear in the printer dialogs box the name of the shared Printer.

Ubuntu 7.04

Printer sharing in Ubuntu 7.04 Feisty is very simple. It no longer requires manual editing of config files. I will assume there is a working printer installed and printing on the Ubuntu computer that will be used as the print server.

Ubuntu Print Server

  1. On the server machine (the one the printer is attached to) open up printer manager with
sudo gnome-cups-manager
    

or System->Administration->Printing.

  1. Under Global Settings click on the share printers.

Ubuntu Client Machine

Now on the client(s) open up the printer manager System->Administration->Printing and under the Global Settings check the Detect LAN Printers option.Then go to Printer->Add Printer check the Network Printer option and in the area marked URI write something like ipp://192.168.0.1/printers/<name of printer> where 192.168.0.1 is your servers ip address and <name of printer> is the name you gave the printer when you set it up (usually the model of the printer). Click Next and select the brand,model, and driver just like you did when setting up the printer on the server. Click Next and fill in the name and description like on the server's printer then click Next. There you should now have a networked printer.

WindowsXP Client Machine

  1. Open the Control Panel
  2. Click Printers and Faxes
  3. Click Add a Printer
  4. On the first page of the Add Printer Wizard, click Next
  5. Choose Add a network Printer
  6. Choose Connect to a printer on the internet and type http://SERVER_NAME:631/printers/PRINTER_NAME in the text box and then click next
  7. On the next screen, Choose the correct driver for your printer
  8. Click ok to finish
  9. Right click the printer, choose properties, and then try to print a test page

Ubuntu 6.10

Printer sharing in Edgy is fairly simple ,although it does require opening one .conf file.I will assume there is a working printer connected and printing.

Ubuntu Print Server

First on the server machine (the one the printer is attached to) open up printer manager with gnome-cups-manager or System->Administration->Printing.Under Global Settings click on the share printers. Next we must edit the cups config file like this sudo vim /etc/cups/cupsd.conf You will probably see a section like this:

 # Only listen for connections from the local machine.
 Listen localhost:631
 Listen /var/run/cups/cups.sock
 

Add this line to it: Listen 192.168.0.1:631 Assuming 192.168.0.1 is your servers ip address. Restart cups with sudo /etc/init.d/cupsys restart

Ubuntu Client Machine

Now on the client(s) open up the printer manager System->Administration->Printing and under the Global Settings check the Detect LAN Printers option.Then go to Printer->Add Printer check the Network Printer option and in the area marked URI write something like ipp://192.168.0.1/printers/<name of printer> where 192.168.0.1 is your servers ip address and <name of printer> is the name you gave the printer when you set it up usually the model of the printer.Click Next and select the brand,model, and driver just like you did when setting up the printer on the server.Click Next and fill in the name and description like on the server's printer then click Next. There you should now have a networked printer.

Ubuntu 5.10

... print from one Ubuntu desktop ("client") machine to another Ubuntu ("print server") machine that has a printer connected to it. Currently, with Ubuntu 5.10 (Breezy Badger) you need to make changes with an editor to the CUPS configuration file /etc/cups/cupsd.conf for network printing to work. The following are complete working replacement examples that work for a Print Server and for a Client Machine.

Ubuntu Print Server

This is the machine that has a printer attached to it, that you want to send print jobs to.

  1. Add a local printer definition, using the Printer Admin utility (Gnome menu System -> Administration -> Printing).
  2. Reconfigure the CUPS server

Cups Server: /etc/cups/cupsd.conf This file is based on that supplied with Ubuntu 5.10. Comment lines have been removed. Copy it onto your system.

    # /etc/cups/cupsd.conf
    # Simple CUPS configuration file for a print server
    # which serves printers within a private local area network.
    # - There is no need for additional security within the print server, ie only authorises people can access the machine.

    # This setup also allows access to the CUPS "Administrative tasks" system
    # via your web browser to http://localhost:631
    # File based on Ubuntu 5.10 (Breezy Badger) (Linux version 2.6.12-10-386)
    # Server Directives are explained in http://localhost:631/sam.html

    # 25/04/2006
    # [email protected]

    ConfigFilePerm 0600
    LogLevel info
    Printcap /var/run/cups/printcap
    RunAsUser Yes
    Port 631
    Include cupsd-browsing.conf
    BrowseAddress @LOCAL
    BrowseAddress 10.0.0.0/8
    BrowseAddress 172.16.0.0/12
    BrowseAddress 192.168.0.0/16

    <Location />
    AuthType None
    Order Deny,Allow
    Deny From All
    Allow From @LOCAL
    Allow From 10.0.0.0/8
    Allow From 172.16.0.0/12
    Allow From 192.168.0.0/16
    </Location>

    <Location /jobs>
    AuthType None
    Order Deny,Allow
    Deny From All
    Allow From @LOCAL
    Allow From 10.0.0.0/8
    Allow From 172.16.0.0/12
    Allow From 192.168.0.0/16
    </Location>

    <Location /printers>
    AuthType None
    Order Deny,Allow
    Deny From All
    Allow From @LOCAL
    Allow From 10.0.0.0/8
    Allow From 172.16.0.0/12
    Allow From 192.168.0.0/16
    </Location>

    <Location /admin>
    AuthType None
    Order Deny,Allow
    Deny From All
    Allow From @LOCAL
    Allow From 10.0.0.0/8
    Allow From 172.16.0.0/12
    Allow From 192.168.0.0/16
    </Location>
    
  • This config file should be altered if security within your local network is an issue for you. E.g. if you use a poorly-secured wireless network, this could allow access to anyone nearby.
  • Change the network addresses if you are part of a different network, eg on the real internet, and remove unnecessary ones.
  • This config allows you to use a web browser to manage CUPS, eg set up printers, manage jobs, via "http://PRINTSERVERNAME:631/".
  1. Restart CUPS

After changing this file, restart CUPS by running ...

      sudo /etc/init.d/cupsys restart

or use the Services tool under Gnome menu System -> Administration. After CUPS is restarted the printers will immediately be found automatically by machines that are set up as per the next sections.

Ubuntu Client Machine

This is the machine you want to work on and send print jobs from.

  1. Reconfigure CUPS

CUPS Client: /etc/cups/cupsd.conf Use the following file. Its features are contained in its comments.

    # /etc/cups/cupsd.conf
    # Simple CUPS configuration file for a pure client machine:
    # which has:
    # - no printers of its own, (or any local printers will not be shared?)
    # - no need for security within the machine, ie a personal workstation
    # - a network connection to a local network, where it will find CUPS-controlled printer servers

    # This setup also allows access to the "Administrative tasks" system at
    # http://localhost:631
    # File based on Ubuntu 5.10 (Breezy Badger) (Linux version 2.6.12-10-386)
    # Server Directives are explained in http://localhost:631/sam.html

    # 25/04/2006
    # [email protected]

    ConfigFilePerm 0600
    LogLevel info
    Printcap /var/run/cups/printcap
    RunAsUser Yes
    ### Listen fails. Use Port
    #Listen 127.0.0.1:631
    #Listen 10.0.0.0/8:631
    #Listen 128.0.0.0/16:631
    #Listen 192.168.0.0/24:631
    Port 631

    ### Which print servers to use
    Include cupsd-browsing.conf
    BrowseOrder deny,allow
    BrowseDeny from All
    BrowseAllow from @LOCAL
    BrowseAllow from 10.0.0.0/8
    BrowseAllow from 172.16.0.0/12
    BrowseAllow from 192.168.0.0/16

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

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

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

    <Location /admin>
    AuthType None
    Order Deny,Allow
    Deny From All
    Allow From @LOCAL
    </Location>
    
  1. Restart CUPS
After making any alterations you wish to this file, restart CUPS by running ...
      sudo /etc/init.d/cupsys restart

or use the Services tool under Gnome menu System -> Administration. After CUPS is restarted, the printers on file servers, (eg, set up in the Print Servers section above) will be found automatically by your machine. They will pop up in your "Printers" screen. This might take up to 30 seconds though.th If you want your machine to print to printers on other Ubuntu hosts, and also to be a print server for other machines, you need to create a combination of the above two cupsd.conf files.

Windows Client Machine

Add the printer to the Windows client by using the Windows "Add Printer" Wizard. Type in the following in the printer URL:

    http://PRINTSERVERNAME:631/printers/PRINTERNAME
  • PRINTSERVERNAME is the name or ip address of the print server,
  • PRINTERNAME is the name given to the printer on the print server.

Common Problems

  1. Print jobs stay on the client machine and do not print.

Run the command

     lpstat -p -d

If it reports something like ...

printer HP-OfficeJet-D155 is idle.  enabled since Jan 01 00:00
        Network host 'alice' is busy; will retry in 30 seconds...

or it reports something like ...

printer [email protected] is idle.  enabled since Jan 01 00:00
        Unable to get printer status (client-error-forbidden)!
system default destination: [email protected]

... your client computer cannot obtain printer information from the server. In either case use the "/etc/cups/cupsd.conf" files as above and restart CUPS.


This info is current for Ubuntu 5.10 (Breezy Badger)


Troubleshooting

Bypassing firewall. If there is an firewall either on print server or the client side, there might appear a communications problem. Use this command to update the firewall to get through.

iptables -A INPUT -p tcp --dport 631 -j ACCEPT
  • This rule is used for IPP only. If you're using other protocol, such as SAMBA, you have to adapt.
  • You might need to use this rule on both sides (server & client) if the firewall is being used on both of them.
  • To apply this rule after each start/restart of the system, use /etc/rc.local .