为了假装学习,在某宝上剁了一台HP打印机,用了一阵子后发现个,每次打印都要开台式机(USB打印机连在台式机上),很麻烦,如果能把打印机连在NAS服务器上,就好多了。事不宜迟,马上开搞,以下是搞机的记录:
准备
一台nas服务器
一台hp打印机
在nas上安装打印机驱动
ubuntu上打印机的驱动安装,与具体的型号和品牌有关,hp的是通过hplip工具来实现。具体安装很简单,一路确认就可以。不确定的简单搜索就可以了,以下是参考:
安装好后本地打印一张纸试试,看看是否正常。
配置打印服务器
ubnntu下的打印服务器可以通过cups来实现。
具体的安装和配置:
安装cups
sudo apt-get install cups cups-client
备份cups配置文件
sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.bak
用以下内容代替/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
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
重启cups
sudo service cups restart
配置windows客户端
在http://localhost:631/admin页面中找到Server Settings,选择"Share printers connected to this system"及其子项"Allow printing from the Internet",点击"Change Setting"按钮保存设置。
进入http://localhost:631/printers/页面点击自己打印机的名字,复制跳转到的页面的URL,即打印机的地址。然后,就可以在Windows上添加使用Ubuntu共享的打印机了。
(来自 http://www.qingpingshan.com/pc/fwq/324056.html)