通过基于 Web 的界面管理和管理 CUPS 服务器的主要手段是通过 Web 浏览器进入 http://localhost:631。如果 CUPS 服务器位于网络上的另一台机器上,请在浏览器的 URL 栏中输入服务器的本地 IP 地址代替 localhost 。CUPS Web 界面相当简单明了,有用于管理打印机和打印作业、授权用户等部分。此外,在管理屏幕的右侧有几个复选框,允许轻松访问常见更改的设置,例如是否共享连接到系统的已发布打印机、是否允许远程管理 CUPS 服务器,以及是否允许用户对打印机和打印作业获得额外访问和特权。
添加打印机通常只需在 CUPS Web 界面的管理屏幕上单击“添加打印机”,或者也可以单击管理屏幕上的“找到新打印机”按钮之一。在呈现“设备”下拉框时,只需选择所需的本地连接打印机,然后继续整个过程。如果已添加了打印/gutenprint-cups 或打印/hplip ports或上述的软件包,则在随后的屏幕上将提供额外的打印驱动程序,这些驱动程序可能提供更稳定或更多功能。
# Log general information in error_log - change "info" to "debug" for
# troubleshooting...
LogLevel info
# Administrator user group...
SystemGroup wheel
# Listen for connections on Port 631.
Port 631
#Listen localhost:631
Listen /var/run/cups.sock
# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
#BrowseAllow @LOCAL
BrowseAllow 192.168.1.* # change to local LAN settings
BrowseAddress 192.168.1.* # change to local LAN settings
# Default authentication type, when authentication is required...
DefaultAuthType Basic
DefaultEncryption Never # comment this line to allow encryption
# Allow access to the server from any machine on the LAN
<Location />
Order allow,deny
#Allow localhost
Allow 192.168.1.* # change to local LAN settings
</Location>
# Allow access to the admin pages from any machine on the LAN
<Location /admin>
#Encryption Required
Order allow,deny
#Allow localhost
Allow 192.168.1.* # change to local LAN settings
</Location>
# Allow access to configuration files from any machine on the LAN
<Location /admin/conf>
AuthType Basic
Require user @SYSTEM
Order allow,deny
#Allow localhost
Allow 192.168.1.* # change to local LAN settings
</Location>
# Set the default printer/job policies...
<Policy default>
# Job-related operations must be done by the owner or an administrator...
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs
Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription
Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job
CUPS-Move-Job>
Require user @OWNER @SYSTEM
Order deny,allow
</Limit>
# All administration operations require an administrator to authenticate...
<Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer
Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs
Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer
Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class
CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>
AuthType Basic
Require user @SYSTEM
Order deny,allow
</Limit>
# Only the owner or an administrator can cancel or authenticate a job...
<Limit Cancel-Job CUPS-Authenticate-Job>
Require user @OWNER @SYSTEM
Order deny,allow
</Limit>
<Limit All>
Order deny,allow
</Limit>
</Policy>