{"id":860,"date":"2015-06-24T20:11:40","date_gmt":"2015-06-25T00:11:40","guid":{"rendered":"http:\/\/jonesling.us\/blog\/?p=860"},"modified":"2015-06-28T16:04:00","modified_gmt":"2015-06-28T20:04:00","slug":"airprint-woes","status":"publish","type":"post","link":"https:\/\/blog.jonesling.us\/?p=860","title":{"rendered":"Airprint woes"},"content":{"rendered":"<p>It&#8217;s all my fault, really.\u00a0 This wouldn&#8217;t have been an issue if I had just let Xtina use my computer to print her boarding pass, but in my defense I didn&#8217;t know that she was doing that.\u00a0 So I gave her our iPad to use.<\/p>\n<p>When it came time to print, she quite logically asked me how she would do that.\u00a0 I, of course, did not know how &#8212; I&#8217;ve never tried printing from iPad or smartphone, though I vaguely knew it was possible.\u00a0 The issue just never came up and I hate printers.<\/p>\n<p>I knew that it would require avahi, so I started installing that on our printserver while I hit <a href=\"https:\/\/www.google.com\/search?q=linux+cups+airprint&amp;ie=utf-8&amp;oe=utf-8\" target=\"_blank\">Google<\/a> to see what else I would need.<\/p>\n<p>The first hit was a very fine article by <a href=\"http:\/\/www.linux-magazine.com\/Online\/Features\/AirPrint\" target=\"_blank\">Linux Magazine<\/a>, and it explained pretty much everything.\u00a0 But it&#8217;s never that simple, because nothing printed and cups started using 100% of a CPU.<\/p>\n<p>Repeated in the <code>\/var\/log\/cups\/error_log<\/code> a billion times were messages like these:<\/p>\n<pre>Request from \"192.168.1.32\" using invalid Host: field \"dandelion.local:631\"<\/pre>\n<p>That took a little more detective work because I didn&#8217;t read the Linux Magazine article carefully enough.\u00a0 The solution was to add an additional directive to the cups config:<\/p>\n<pre>--- \/backup\/snapshots\/dandelion.0\/etc\/cups\/cupsd.conf\u00a0\u00a0 2015-06-08 08:33:31.000000000 -0400\n+++ \/etc\/cups\/cupsd.conf\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2015-06-24 19:29:34.410488191 -0400\n@@ -1,6 +1,7 @@\n\u00a0LogLevel warn\n\u00a0PageLogFormat\n\u00a0# Allow remote access\n+ServerAlias *\n\u00a0Port 631\n\u00a0Listen \/run\/cups\/cups.sock\n\u00a0# Share local printers on the local network.<\/pre>\n<h1>Summary:<\/h1>\n<p>Gentoo packages required:<\/p>\n<ul>\n<li>net-print\/cups<\/li>\n<li>net-dns\/avahi<\/li>\n<\/ul>\n<p>Also download and run <a href=\"https:\/\/github.com\/tjfontaine\/airprint-generate\" target=\"_blank\">airprint-generate<\/a> after cups is configured and running.<\/p>\n<p>If you have iOS 6+, which is pretty much a given nowadays, make sure you have the correct MIME types available, and add them if not:<\/p>\n<pre>echo\u2008'image\/urf\u2008urf\u2008string(0,UNIRAST&lt;00&gt;)'\u2008&gt;\u2008\\\n    \/usr\/share\/cups\/mime\/airprint.types\necho\u2008'image\/urf\u2008application\/pdf\u2008100\u2008pdftoraster'\u2008&gt;\u2008\\\n    \/usr\/share\/cups\/mime\/airprint.convs<\/pre>\n<p>Add the appropriate services to your default runlevel, and start them as well:<\/p>\n<pre># rc-update add cupsd default\n# rc-update add cups-browsed default\n# rc-update add avahi-daemon default<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s all my fault, really.\u00a0 This wouldn&#8217;t have been an issue if I had just let Xtina use my computer to print her boarding pass, but in my defense I didn&#8217;t know that she was doing that.\u00a0 So I gave her our iPad to use. When it came time to print, she quite logically asked &hellip; <a href=\"https:\/\/blog.jonesling.us\/?p=860\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Airprint woes&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","wprm-recipe-roundup-name":"","wprm-recipe-roundup-description":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[144,146,145,91,83,147,148],"class_list":["post-860","post","type-post","status-publish","format-standard","hentry","category-linux","tag-airprint","tag-cups","tag-gentoo","tag-ios","tag-linux","tag-tech-support","tag-xtina"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4o3FW-dS","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.jonesling.us\/index.php?rest_route=\/wp\/v2\/posts\/860","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.jonesling.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jonesling.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jonesling.us\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jonesling.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=860"}],"version-history":[{"count":2,"href":"https:\/\/blog.jonesling.us\/index.php?rest_route=\/wp\/v2\/posts\/860\/revisions"}],"predecessor-version":[{"id":863,"href":"https:\/\/blog.jonesling.us\/index.php?rest_route=\/wp\/v2\/posts\/860\/revisions\/863"}],"wp:attachment":[{"href":"https:\/\/blog.jonesling.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jonesling.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jonesling.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}