為了假裝學(xué)習(xí),在某寶上剁了一臺HP打印機,用了一陣子后發(fā)現(xiàn)個,每次打印都要開臺式機(USB打印機連在臺式機上),很麻煩,如果能把打印機連在NAS服務(wù)器上,就好多了。事不宜遲,馬上開搞,以下是搞機的記錄:
準(zhǔn)備
- 一臺nas服務(wù)器
- 一臺hp打印機
在nas上安裝打印機驅(qū)動
ubuntu上打印機的驅(qū)動安裝,與具體的型號和品牌有關(guān),hp的是通過hplip工具來實現(xiàn)。具體安裝很簡單,一路確認(rèn)就可以。不確定的簡單搜索就可以了,以下是參考:
hplip地址: https://developers.hp.com/hp-linux-imaging-and-printing/gethplip
安裝詳細(xì)過程: http://blog.csdn.net/ws_20100/article/details/49120509
安裝好后本地打印一張紙試試,看看是否正常。
配置打印服務(wù)器
ubnntu下的打印服務(wù)器可以通過cups來實現(xiàn)。
具體的安裝和配置:
- 安裝cups
sudo apt-get install cups cups-client
- 備份cups配置文件
sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.bak
- 用以下內(nèi)容代替/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 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>
- 重啟cups
sudo service cups restart
參考資料:
如何在Ubuntu上使用網(wǎng)絡(luò)打印-ubuntu-wiki
CUPS-wiki (簡體中文)
如何在Ubuntu服務(wù)器上設(shè)置Web配置的打印服務(wù)器使用SWAT,CUPS和SAMBA
配置windows客戶端
在http://localhost:631/admin頁面中找到Server Settings,選擇"Share printers connected to this system"及其子項"Allow printing from the Internet",點擊"Change Setting"按鈕保存設(shè)置。
進入http://localhost:631/printers/頁面點擊自己打印機的名字,復(fù)制跳轉(zhuǎn)到的頁面的URL,即打印機的地址。然后,就可以在Windows上添加使用Ubuntu共享的打印機了。
(來自 http://www.qingpingshan.com/pc/fwq/324056.html)