为了假装学习,在某宝上剁了一台HP打印机,用了一阵子后发现个,每次打印都要开台式机(USB打印机连在台式机上),很麻烦,如果能把打印机连在NAS服务器上,就好多了。事不宜迟,马上开搞,以下是搞机的记录:
准备
- 一台nas服务器
- 一台hp打印机
在nas上安装打印机驱动
ubuntu上打印机的驱动安装,与具体的型号和品牌有关,hp的是通过hplip工具来实现。具体安装很简单,一路确认就可以。不确定的简单搜索就可以了,以下是参考:
hplip地址: https://developers.hp.com/hp-linux-imaging-and-printing/gethplip
安装详细过程: http://blog.csdn.net/ws_20100/article/details/49120509
安装好后本地打印一张纸试试,看看是否正常。
配置打印服务器
ubnntu下的打印服务器可以通过cups来实现。
具体的安装和配置:
安装cups
1sudo apt-get install cups cups-client备份cups配置文件
1sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.bak用以下内容代替/etc/cups/cupsd.conf:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263# /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.netConfigFilePerm 0600LogLevel infoPrintcap /var/run/cups/printcapRunAsUser YesPort 631Include cupsd-browsing.confBrowseAddress @LOCALBrowseAddress 10.0.0.0/8BrowseAddress 172.16.0.0/12BrowseAddress 192.168.0.0/16<Location />AuthType NoneOrder Deny,AllowDeny From AllAllow From @LOCALAllow From 10.0.0.0/8Allow From 172.16.0.0/12Allow From 192.168.0.0/16</Location><Location /jobs>AuthType NoneOrder Deny,AllowDeny From AllAllow From @LOCALAllow From 10.0.0.0/8Allow From 172.16.0.0/12Allow From 192.168.0.0/16</Location><Location /printers>AuthType NoneOrder Deny,AllowDeny From AllAllow From @LOCALAllow From 10.0.0.0/8Allow From 172.16.0.0/12Allow From 192.168.0.0/16</Location><Location /admin>AuthType NoneOrder Deny,AllowDeny From AllAllow From @LOCALAllow From 10.0.0.0/8Allow From 172.16.0.0/12Allow From 192.168.0.0/16</Location>重启cups
1sudo service cups restart
参考资料:
如何在Ubuntu上使用网络打印-ubuntu-wiki
CUPS-wiki (简体中文)#mw-head)
如何在Ubuntu服务器上设置Web配置的打印服务器使用SWAT,CUPS和SAMBA
配置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)