公司有多台存放在各地打印机需要从总部连接推送打印机文件,经过测评采用Linux +CUPS方案进行管理推送打印。后发现网上少有较高版本的CUPS安装教程,简单记录以备不时之需:
环境:Centos7.X 最小化安装
CUPS: v2.3.3
地址:https://github.com/apple/cups/releases/download/v2.3.3/cups-2.3.3-source.tar.gz
最新地址:https://github.com/apple/cups/releases
1.安装所需编译及下载工具
Bash
#yum install gcc gcc-c++ wget lrzsz
#systemctl stop firewalld #关闭防火墙
#systemctl disable firewalld #禁用防火墙
2.下载文件,下面需要使用普通用户操作。
Bash
$wget https://github.com/apple/cups/releases/download/v2.3.3/cups-2.3.3-source.tar.gz
3.解压并编译文件
Bash
$tar zxvf cups-2.3.3-source.tar.gz
$cd cups-2.3.3
$unset LANG LANGUAGE #如果是中文环境需要切换到英文环境
$ ./configure
$make
$make check
#检测通过后需要使用root用户安装
$su
#make install
4.修改vi /etc/cups/cupsd.conf
Bash
vi /etc/cups/cupsd.conf
# Only listen for connections from the local machine.
Listen 0.0.0.0:631
Listen /var/run/cups/cups.sock
# Show shared printers on the local network.
Browsing On
BrowseLocalProtocols
# Default authentication type, when authentication is required...
DefaultAuthType Basic
# Web interface setting...
WebInterface Yes
# Restrict access to the server...
<Location />
Allow 192.168.152.0/24
</Location>
# Restrict access to the admin pages...
<Location /admin>
Allow 192.168.152.0/24
</Location>
5.启动CUPS
Bash
#/etc/init.d/cups start
#/etc/init.d/cups status
#/etc/init.d/cups stop
#/etc/init.d/cups restart
6.验证CUPS安装
http://192.168.152.133:631 此处IP地址为安装CUPS服务器的IP地址