如何在Ubuntu上使用網(wǎng)絡(luò)打印出自Ubuntu中文
[編輯] 如何在Ubuntu上使用網(wǎng)絡(luò)打印原文出處:官方Wiki 原文作者: 授權(quán)許可: 翻譯人員:lightyears 校正人員: 貢獻人員: 適用版本: 文章狀態(tài):等待校正
[編輯] Overview(概覽)Ubuntu 5.10 (Breezy Badger)支持網(wǎng)絡(luò)打印,所以你可以從你的Ubuntu或Windows之類的電腦到另一臺帶有打印機的Ubuntu電腦(例如一臺“打印服務(wù)器”)上打印。本頁僅包括這些特定情形。 本頁不包括從Ubuntu到帶有打印機的Windows電腦上打印,例如一臺Windows打印服務(wù)器。WindowsXP打印機頁請訪問這里。 [編輯] Background(背景)Ubuntu使用通用UNIX打印系統(tǒng)(縮寫“CUPS”)處理打印事務(wù)。CUPS使用Internet打印協(xié)議(縮寫“IPP”) 作為管理打印作業(yè)和隊列的基礎(chǔ)。通過簡化的功能也支持行式打印機服務(wù)、服務(wù)器消息塊和AppSocket(a.k.a. JetDirect)協(xié)議。本頁用CUPS和IPP描述網(wǎng)絡(luò)打印。 CUPS打印機的配置和管理可以通過Gnome菜單系統(tǒng) -> 管理 -> 打印下的打印機管理工具進行處理。另外,CUPS還提供了類似老的伯克利和SystemV的lpq、lpstat等打印命令的命令行指令。 當(dāng)定義了一個本地打印機(例如使用打印管理工具),按照服務(wù)器上CUPS配置文件的指示,這個“打印服務(wù)器”主機自動向網(wǎng)絡(luò)發(fā)布該打印機。 遠程Ubuntu“客戶端”主機就可以看到和使用安裝在該服務(wù)器上的打印機。網(wǎng)絡(luò)打印機自動出現(xiàn)在客戶端的打印管理工具上。如果CUPS啟動并配置正確它 就會出現(xiàn),如果你在打印服務(wù)器或本地計算機上停止CUPS它就會消失。
目前,在Ubuntu 5.10 (Breezy Badger)上你需要使用編輯器修改CUPS配置文件 /etc/cups/cupsd.conf 來實現(xiàn)網(wǎng)絡(luò)打印。以下是讓服務(wù)器和客戶端計算機工作的完整實例。 [編輯] Ubuntu Print Server(Ubuntu 打印服務(wù)器)
# /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重新啟動後,文件服務(wù)器上的(按照上面打印服務(wù)器一節(jié)進行配置的)打印機將被你的計算機自動發(fā)現(xiàn)。他們將出現(xiàn)在你的“打印機”屏幕上。雖然這可能要花費30秒的時間。 如果你希望你的計算機能打印到另一臺裝有打印機的Ubuntu主機(也是其他計算機的打印服務(wù)器),你需要創(chuàng)建將上述兩個cupsd.conf 結(jié)合在一起的文件。 [編輯] Windows Client Machine(Windows 客戶端計算機)
[編輯] Common Problems(常見問題)
lpstat -p -d If it reports something like ... 如果它出現(xiàn)象下面這樣的報告 printer HP-OfficeJet-D155 is idle. enabled since Jan 01 00:00 Network host ‘a(chǎn)lice‘ 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
|
|