混合环境下的打印方法的选择。

So we share our printer via IPP using CUPS. What the heck is IPP? It's just printing over HTTP. Why use IPP versus, say, Windows Printer Sharing? Simple: we've got a mixed environment of Windows XP, Windows 7, OS X 10.6, OS X 10.7, Fedora, Ubuntu, and CentOS workstations. IPP is supported by all of them. Plus, I could get AirPrint to work on it, which means you can add iOS in that list of Operating Systems above.

CUPS

So obviously you need to get CUPS to work first.

yum install cups ghostscript usbutils

So there's the cups package, ghostscript, and usbutils. Since most printers these days are connected via USB, it's always nice to have usbutils installed. Ghostscript is needed since most printers don't really support PostScript so I install it just in case.

So once you've got those installed, you need printer drivers. With so many different printer manufacturers, I leave that up to you, dear reader, as to how to install it. You'll usually need a PPD file. NOTE: if you're printer is supported via foomatic or gutenprint, you can install drivers via:

yum install foomatic gutenprint-foomatic

This should install most drivers available. For example, we have an old Samsung ML-1510 that is supported by foomatic. We do have a newer Samsung ML-1860 that isn't. That required me to download and install Samsung's Unified Printer Driver (ugh). Its install script installed a bunch of .desktop files for every account on our server. So I had to search the entire server and remove all of these useless files. To Samsung: sheesh. This also installed an initscript called smfpd, which is a daemon for parallel port printers. Again, sheesh. You can't disable this from startup via chkconfig. There is a commented out "exit 0" near the start. Uncomment that and the daemon should stop running on startup. Make sure you stop the daemon first as it consumes a bit of CPU and memory. Sheesh. Sorry for the semi-rant.

Anyway, the default CUPS configuration only allows access to localhost. Since I don't worry too much about security, and you can secure it after, I change the following in /etc/cupsd.conf:

I add the following:

ServerAlias *
Port 631

which makes the server listen to any hostname (our server has a CNAME to it calling it 'printer01') on port 631.

Then I make sure to change all "Order deny,allow" to "Order allow,deny" and add an "Allow all" to everything after. This way, I can now remotely access the web GUI at:

http://hostname:631/

Change hostname for whatever you call your print server. If at anytime you're asked for a username and password, use your server's root account. So now that you have access to the web GUI, simply add your printer here.

Now you should be able to start CUPS:

service cups start && chkconfig cups on

Test your printer

So you should be able to add your printer to your workstations. The whole URL to your printer is:

http://hostname:631/printers/PRINTERNAME

or:

ipp://hostname/printers/PRINTERNAME

Special note for Mac users: for the "Queue" setting, make sure you include the "printers" portion. So 'Address' would be the hostname. 'Queue' would be "printers/PRINTERNAME".

Once you've added the printer and selected/installed the correct driver, you should be good to go.

If not, there is a setting called 'LogLevel'. By default it's set as follows:

LogLevel warn

Change it to:

LogLevel debug

and monitor the log files in /var/logs/cups/error_log for any problems.

AirPrint

So now for the fun part: getting AirPrint to work so users can print from their iPhones and iPads. There are some great references online, plus a great script to automatically generate the configuration files needed to get your printer advertised by Avahi.

So, Timothy J. Fontaine of Ataraxia Consulting created a python script that automatically generates a .service file for the printers connected via CUPS. You can read hisblog postabout it. The GitHub repository is available here:

https://github.com/tjfontaine/airprint-generate

Anyway, you can (hopefully) download the file directly here:

https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py

First you'll need to install Avahi:

yum install avahi avahi-compat-libdns_sd

Then you need to install the Python cups module. For CentOS 6.2, this is, strangely, in the "system-config-printer-libs" package. So:

yum install system-config-printer-libs

Then you can run the airprint-generate.py script. Copy the generated .service files into /etc/avahi/services. Then you can start the service:

service avahi-daemon start && chkconfig avahi-daemon on

I had some trouble with printers not being advertised. Since my local network is on br1 instead of eth1 (a KVM thing), I had to add the following to /etc/avahi-daemon.conf:

allow-interfaces=br1

If you had to add that, restart avahi-daemon.

And that's it. Printers should start showing up on your iOS devices.

本文转自 h2appy  51CTO博客,原文链接:http://blog.51cto.com/h2appy/1611391,如需转载请自行联系原作者

CentOS 6.2 + CUPS + AirPrint for iOS相关推荐

  1. CentOS下安装cups实现局域网共享HP1020打印机

    前言 老式打印机+旧电脑=局域网打印机 准备工作 HP1020打印机:CentOS主机,并接入局域网,分配固定IP:Windows或Mac.Linux电脑一台. 将打印机usb连入CentOS主机. ...

  2. centOS 7 安装 CUPS 打印服务器,安装映美 FP-730K打印机共享

    注:映美 FP-730K 与 EPSON LQ-24 针式打印机的通讯是兼容的,所以在 linux 主机添加打印机时,使用此驱动.(https://www.openprinting.org/print ...

  3. CentOS7 通过 cups 与 Windows 共享 HP 1020 打印机

    准备工作 HP1020 打印机:CentOS 主机,并接入局域网,分配固定 IP:Windows 或 Mac.Linux 电脑一台. 将打印机 usb 连入 CentOS 主机. 安装打印机驱动 在 ...

  4. 在VMware虚拟机中安装CentOS 7

    背景: 阅读新闻 [日期:2015-09-22] 来源:Linux社区 作者:Linux [字体:大 中 小] [正文] 一. VMware简介: VMware是一个虚拟PC的软件,可以在现有的操纵系 ...

  5. cups共享linux打印机_Linux学习之CUPS实现网络打印机

    一.设备 家有老式笔记本一台 HP F2288打印机一台(无网卡模块) 能上网的路由器 二.准备 笔记本安装CentOS 6.4 x64系统(linux适合老式机子,开机比windows快多了) 三. ...

  6. 在虚拟机下安装Linux

    此安装版本Linux镜像为CentOS7,虚拟机为VMware15 首先我们去官网下载CentOS7 https://www.centos.org/download/ 点击DEV IOS后有如下界面 ...

  7. LNMP环境搭建 centos7 nginx1.12 mysql5.6 php7

    经过一番折腾,终于将LNMP环境搭建完成了.本文介绍的LNMP环境是在windows的Oracle VM VirtualBox中的Centos虚拟机上搭建的,各个软件的版本为:Centos7 + Ng ...

  8. Linux下安装佳能网络打印机cacon imageclass4010

    2014年公司的一台cacon imageclass4010 的小型打印机, 原先单独在行政同事的电脑上驱动 , 该打印机本身没有带网络功能, 于是找了一些相关的驱动成功搭建到局域网共享 .  这个是 ...

  9. Java之第一行代码

    目录 Java第一行代码 1. 什么是计算机 1.1 生活中你关注的计算机 1.2 Java开发者所关注的计算机 2. 计算机操作方式 2.1 操作系统 2.2 操作方式 2.3 DOS命令[了解] ...

  10. android seetaface6_中科视拓宣布开源SeetaFace6人脸识别算法(附相关课程)

    3月31日,中科视拓宣布开放SeetaFace6人脸识别算法. 2016年9月和2019年8月,中科视拓分别开源了SeetaFace1.0人脸识别引擎.SeetaFace2.0商用级人脸识别算法.Se ...

最新文章

  1. BIND日志相关(二)
  2. (1)虚拟机管理——在微软云Azure新门户创建虚拟机
  3. windows server 2008 如何取消禁ping
  4. Linux内核社区是数字军火商、斯拉夫兵工厂甚至NSA的最爱
  5. P1081 开车旅行 倍增 洛谷
  6. 获取Spring的ApplicationContext的几种方式
  7. CentOS7中挂载U盘
  8. JAVA 语言如何进行异常处理,关键字: throws,throw,try,catch,finally分别代表什么意义? 在try块中可以抛 出异常吗?...
  9. 最强NLP模型BERT喜迎PyTorch版!谷歌官方推荐,也会支持中文
  10. springboot建筑造价师资格考试应试网站设计与实现毕业设计源码260839
  11. 利用计算机本地文档重装系统,本地模式怎么进入PE系统对电脑进行重装
  12. mysql实现pr曲线_如何画PR curve (PR曲线)基于COCO格式数据集 在maskrcnn_benchmark中
  13. 共享文件夹加密专家_文件加密_公司如何防止员工内部泄密?
  14. 【openGL2021版】天空盒
  15. linux 查看vcf文件,VCF格式文件的shell小练习
  16. python mysql插入数据报错:TypeError: %d format: a number is required, not str
  17. BaseAdataer基本设配器
  18. OpenCV3之——图像修补inpaint()函数
  19. Bootstrap4使用教程
  20. 你可能不知道你已经被运营商劫持了

热门文章

  1. SVN下载新的项目文件
  2. 调试器---镜像劫持
  3. 潜力环保类元宇宙项目地球超人解析
  4. win32实现两个透明窗口联动
  5. Delphi基础教程图文版之语句(选择语句)
  6. 计算机应用第四单元,计算机应用基础基础模块教案 第四单元 Word 2010文字处理软件.docx...
  7. 几种将网站设为首页的代码
  8. 制作U盘免疫病毒文件夹
  9. Win7主题制作修改教程
  10. html wap加载优化,移动版Wap网页针对百度进行SEO优化的一些要点总结