全部博文(2005)
分类: LINUX
2008-04-16 13:15:00
目录[] |
原文出处:官方Wiki
原文作者:
授权许可:
翻译人员:
校正人员:
贡献人员:
适用版本: 文章状态:
Ubuntu 5.10 (Breezy Badger) 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 5.10 (Breezy Badger)支持网络打印,所以你可以从你的Ubuntu或Windows之类的电脑到另一台带有打印机的Ubuntu电脑(例如一台“打印服务器”)上打印。本页仅包括这些特定情形。
This page does not cover printing from Ubuntu to a printer attached to a Windows machine, ie a Windows print server. The page addresses this.
本页不包括从Ubuntu到带有打印机的Windows电脑上打印,例如一台Windows打印服务器。。
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.
Ubuntu使用通用UNIX打印系统(缩写“CUPS”)处理打印事务。CUPS使用Internet打印协议(缩写 “IPP”)作为管理打印作业和队列的基础。通过简化的功能也支持行式打印机服务、服务器消息块和AppSocket(a.k.a. JetDirect)协议。本页用CUPS和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.
CUPS打印机的配置和管理可以通过Gnome菜单系统 -> 管理 -> 打印下的打印机管理工具进行处理。另外,CUPS还提供了类似老的伯克利和SystemV的lpq、lpstat等打印命令的命令行指令。
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.
当定义了一个本地打印机(例如使用打印管理工具),按照服务器上CUPS配置文件的指示,这个“打印服务器”主机自动向网络发布该打印 机。远程Ubuntu“客户端”主机就可以看到和使用安装在该服务器上的打印机。网络打印机自动出现在客户端的打印管理工具上。如果CUPS启动并配置正 确它就会出现,如果你在打印服务器或本地计算机上停止CUPS它就会消失。
How To .. . .. 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 5.10 (Breezy Badger)上你需要使用编辑器修改CUPS配置文件 /etc/cups/cupsd.conf 来实现网络打印。以下是让服务器和客户端计算机工作的完整实例。
# /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
# File based on Ubuntu 5.10 (Breezy Badger) (Linux version 2.6.12-10-386)
# Server Directives are explained in /sam.html
# 25/04/2006
# DavidTangye@netscape.net
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
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
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
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
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
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.
# /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
#
# File based on Ubuntu 5.10 (Breezy Badger) (Linux version 2.6.12-10-386)
# Server Directives are explained in /sam.html
# 25/04/2006
# DavidTangye@netscape.net
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
AuthType None
Order Deny,Allow
Deny From All
Allow From @LOCAL
AuthType None
Order Deny,Allow
Deny From All
Allow From @LOCAL
AuthType None
Order Deny,Allow
Deny From All
Allow From @LOCAL
AuthType None
Order Deny,Allow
Deny From All
Allow From @LOCAL
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.
CUPS重新启动后,文件服务器上的(按照上面打印服务器一节进行配置的)打印机将被你的计算机自动发现。他们将出现在你的“打印机”屏幕上。虽然这可能要花费30秒的时间。
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.
如果你希望你的计算机能打印到另一台装有打印机的Ubuntu主机(也是其他计算机的打印服务器),你需要创建将上述两个cupsd.conf 结合在一起的文件。
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 OfficeJet-D155@10.0.0.40 is idle. enabled since Jan 01 00:00
Unable to get printer status (client-error-forbidden)!
system default destination: OfficeJet-D155@10.0.0.40