如何在Ubuntu上使用网络打印出自Ubuntu中文
[编辑] 如何在Ubuntu上使用网络打印原文出处:官方Wiki 原文作者: 授权许可: 翻译人员:lightyears 校正人员: 贡献人员: 适用版本: 文章状态:等待校正
[编辑] Overview(概览)Ubuntu 5.10 (Breezy Badger)支持网络打印,所以你可以从你的Ubuntu或Windows之类的电脑到另一台带有打印机的Ubuntu电脑(例如一台“打印服务器”)上打印。本页仅包括这些特定情形。 本页不包括从Ubuntu到带有打印机的Windows电脑上打印,例如一台Windows打印服务器。WindowsXP打印机页请访问这里。 [编辑] Background(背景)Ubuntu使用通用UNIX打印系统(缩写“CUPS”)处理打印事务。CUPS使用Internet打印协议(缩写“IPP”) 作为管理打印作业和队列的基础。通过简化的功能也支持行式打印机服务、服务器消息块和AppSocket(a.k.a. JetDirect)协议。本页用CUPS和IPP描述网络打印。 CUPS打印机的配置和管理可以通过Gnome菜单系统 -> 管理 -> 打印下的打印机管理工具进行处理。另外,CUPS还提供了类似老的伯克利和SystemV的lpq、lpstat等打印命令的命令行指令。 当定义了一个本地打印机(例如使用打印管理工具),按照服务器上CUPS配置文件的指示,这个“打印服务器”主机自动向网络发布该打印机。 远程Ubuntu“客户端”主机就可以看到和使用安装在该服务器上的打印机。网络打印机自动出现在客户端的打印管理工具上。如果CUPS启动并配置正确它 就会出现,如果你在打印服务器或本地计算机上停止CUPS它就会消失。
目前,在Ubuntu 5.10 (Breezy Badger)上你需要使用编辑器修改CUPS配置文件 /etc/cups/cupsd.conf 来实现网络打印。以下是让服务器和客户端计算机工作的完整实例。 [编辑] Ubuntu Print Server(Ubuntu 打印服务器)
# /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 # 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 <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>
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(Ubuntu 客户端计算机)
# /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 # 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 <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>
sudo /etc/init.d/cupsys restart CUPS重新启动後,文件服务器上的(按照上面打印服务器一节进行配置的)打印机将被你的计算机自动发现。他们将出现在你的“打印机”屏幕上。虽然这可能要花费30秒的时间。 如果你希望你的计算机能打印到另一台装有打印机的Ubuntu主机(也是其他计算机的打印服务器),你需要创建将上述两个cupsd.conf 结合在一起的文件。 [编辑] Windows Client Machine(Windows 客户端计算机)
[编辑] Common Problems(常见问题)
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
|
|