CentOS6.2+CUPS+AirPrintforiOS-創(chuàng)新互聯(lián)

我們提供的服務(wù)有:成都網(wǎng)站設(shè)計(jì)、做網(wǎng)站、微信公眾號(hào)開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、南陵ssl等。為數(shù)千家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的南陵網(wǎng)站制作公司

混合環(huán)境下的打印方法的選擇。

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 eth2 (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.

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

新聞名稱:CentOS6.2+CUPS+AirPrintforiOS-創(chuàng)新互聯(lián)
文章分享:http://bm7419.com/article44/dichhe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制開發(fā)、品牌網(wǎng)站建設(shè)關(guān)鍵詞優(yōu)化、手機(jī)網(wǎng)站建設(shè)、小程序開發(fā)標(biāo)簽優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)