云网牛站
所在位置:首页 > Linux教程 > Ubuntu 18.04打印服务器惠普P1106配置

Ubuntu 18.04打印服务器惠普P1106配置

2018-06-23 16:25:16作者:大熊猫稿源:linux站

打印机放身边对身体是不好的,所以放在客厅的NAS旁边了,打印机连接NAS,NAS作为打印服务器。操作系统是Ubuntu Server 18.04,打印机是惠普P1106。

 

安装hplip(惠普打印机开源驱动),会同时安装cups(苹果为类UNIX开发的开源打印系统,可以从cups页面下载)。此外,还需要安装hp-plugin,原因后面解释。

# apt install hplip

Reading package lists... Done

Building dependency tree       

Reading state information... Done

The following additional packages will be installed:

avahi-daemon colord colord-data cups cups-browsed cups-client cups-common cups-core-drivers cups-daemon

cups-filters cups-filters-core-drivers cups-ipp-utils cups-ppdc cups-server-common

dconf-gsettings-backend dconf-service fontconfig fontconfig-config fonts-dejavu-core fonts-droid-fallback

fonts-noto-mono ghostscript gsfonts hicolor-icon-theme hplip-data imagemagick imagemagick-6-common

imagemagick-6.q16 libart-2.0-2 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-core7

libavahi-glib1 libcairo2 libcolord2 libcolorhug2 libcups2 libcupscgi1 libcupsfilters1 libcupsimage2

libcupsmime1 libcupsppdc1 libdaemon0 libdatrie1 libdconf1 libdjvulibre-text libdjvulibre21 libexif12

libfftw3-double3 libfile-copy-recursive-perl libfontconfig1 libfontembed1 libgd3 libgomp1 libgphoto2-6

libgphoto2-l10n libgphoto2-port12 libgraphite2-3 libgs9 libgs9-common libgudev-1.0-0 libgusb2

libgutenprint2 libharfbuzz0b libhpmud0 libieee1284-3 libijs-0.35 libilmbase12 libjbig0 libjbig2dec0

libjpeg-turbo8 libjpeg8 liblcms2-2 liblouis-data liblouis14 liblouisutdml-bin liblouisutdml-data

liblouisutdml8 liblqr-1-0 libmagickcore-6.q16-3 libmagickcore-6.q16-3-extra libmagickwand-6.q16-3

libnetpbm10 libnspr4 libnss-mdns libnss3 libopenexr22 libpango-1.0-0 libpangocairo-1.0-0

libpangoft2-1.0-0 libpaper-utils libpaper1 libpixman-1-0 libpoppler73 libqpdf21 libsane-common

libsane-hpaio libsane1 libsensors4 libsnmp-base libsnmp30 libthai-data libthai0 libtiff5 libwebp6

libwebpdemux2 libwebpmux3 libwmf0.2-7 libxcb-render0 libxcb-shm0 libxpm4 libxrender1 netpbm poppler-data

poppler-utils printer-driver-gutenprint printer-driver-hpcups printer-driver-postscript-hp

python3-olefile python3-pexpect python3-pil python3-ptyprocess python3-renderpm python3-reportlab

python3-reportlab-accel qpdf sane-utils update-inetd

Suggested packages:

avahi-autoipd colord-sensor-argyll cups-bsd foomatic-db-compressed-ppds | foomatic-db cups-pdf smbclient

xpp antiword docx2txt fonts-noto ghostscript-x hplip-doc hplip-gui python3-notify2 system-config-printer

imagemagick-doc autotrace cups-bsd | lpr | lprng enscript ffmpeg gimp gnuplot grads graphviz hp2xx

html2ps libwmf-bin mplayer povray radiance texlive-base-bin transfig ufraw-batch xdg-utils libfftw3-bin

libfftw3-dev libgd-tools gphoto2 gutenprint-locales liblcms2-utils ooo2dbk rtf2xml inkscape libjxr-tools

avahi-autoipd | zeroconf lm-sensors snmp-mibs-downloader libwmf0.2-7-gtk fonts-japanese-mincho | fonts-ipafont-mincho fonts-japanese-gothic | fonts-ipafont-gothic fonts-arphic-ukai fonts-arphic-uming

fonts-nanum gutenprint-doc python-pexpect-doc python-pil-doc python3-pil-dbg python3-renderpm-dbg

pdf-viewer python3-egenix-mxtexttools python-reportlab-doc unpaper

The following NEW packages will be installed:

avahi-daemon colord colord-data cups cups-browsed cups-client cups-common cups-core-drivers cups-daemon

cups-filters cups-filters-core-drivers cups-ipp-utils cups-ppdc cups-server-common

dconf-gsettings-backend dconf-service fontconfig fontconfig-config fonts-dejavu-core fonts-droid-fallback

fonts-noto-mono ghostscript gsfonts hicolor-icon-theme hplip hplip-data imagemagick imagemagick-6-common

imagemagick-6.q16 libart-2.0-2 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-core7

libavahi-glib1 libcairo2 libcolord2 libcolorhug2 libcups2 libcupscgi1 libcupsfilters1 libcupsimage2

libcupsmime1 libcupsppdc1 libdaemon0 libdatrie1 libdconf1 libdjvulibre-text libdjvulibre21 libexif12

libfftw3-double3 libfile-copy-recursive-perl libfontconfig1 libfontembed1 libgd3 libgomp1 libgphoto2-6

libgphoto2-l10n libgphoto2-port12 libgraphite2-3 libgs9 libgs9-common libgudev-1.0-0 libgusb2

libgutenprint2 libharfbuzz0b libhpmud0 libieee1284-3 libijs-0.35 libilmbase12 libjbig0 libjbig2dec0

libjpeg-turbo8 libjpeg8 liblcms2-2 liblouis-data liblouis14 liblouisutdml-bin liblouisutdml-data

liblouisutdml8 liblqr-1-0 libmagickcore-6.q16-3 libmagickcore-6.q16-3-extra libmagickwand-6.q16-3

libnetpbm10 libnspr4 libnss-mdns libnss3 libopenexr22 libpango-1.0-0 libpangocairo-1.0-0

libpangoft2-1.0-0 libpaper-utils libpaper1 libpixman-1-0 libpoppler73 libqpdf21 libsane-common

libsane-hpaio libsane1 libsensors4 libsnmp-base libsnmp30 libthai-data libthai0 libtiff5 libwebp6

libwebpdemux2 libwebpmux3 libwmf0.2-7 libxcb-render0 libxcb-shm0 libxpm4 libxrender1 netpbm poppler-data

poppler-utils printer-driver-gutenprint printer-driver-hpcups printer-driver-postscript-hp

python3-olefile python3-pexpect python3-pil python3-ptyprocess python3-renderpm python3-reportlab

python3-reportlab-accel qpdf sane-utils update-inetd

0 upgraded, 130 newly installed, 0 to remove and 45 not upgraded.

Need to get 48.1 MB of archives.

After this operation, 173 MB of additional disk space will be used.

Do you want to continue? [Y/n] 

 

修改配置文件(/etc/cups/cupsd.conf)以便能够在局域网内其它电脑上访问cups的配置页面(先备份):

# Only listen for connections from the local machine.

-Listen localhost:631

+Port 631

Listen /run/cups/cups.sock

# Show shared printers on the local network.

@@ -29,11 +30,13 @@ WebInterface Yes

# Restrict access to the server...

<Location />

Order allow,deny

+  Allow @LOCAL

</Location>

# Restrict access to the admin pages...

<Location /admin>

Order allow,deny

+  Allow @LOCAL

</Location>

# Restrict access to configuration files...

@@ -41,6 +44,7 @@ WebInterface Yes

AuthType Default

Require user @SYSTEM

Order allow,deny

+  Allow @LOCAL

</Location>

 

重启cups:

# service cups restart

浏览器访问:IP:631

Ubuntu 18.04打印服务器惠普P1106配置

进入Administration页面,勾选“Share printers connected to this system”和“Allow remote administration”。

Ubuntu 18.04打印服务器惠普P1106配置

 

然后Add Printer,然后会提示需要使用https访问,且几秒后会自动跳转。

需要升级:

你必须通过此 URL 访问此页面:https://IP:631/admin/.

Firefox会提示连接不安全,点击 高级  -> 添加例外,然后继续Add Printer,在弹出的提示框中输入root及密码。

选择Local Printer中带USB的那项,然后Continue。

Ubuntu 18.04打印服务器惠普P1106配置

Name可以设短点,因为其会作为网络打印机路径的一部分;Description也可以设短点。

勾选Share This Printer,再Continue。

Ubuntu 18.04打印服务器惠普P1106配置

 

接下来是选择打印机驱动,选择对应型号带hpcups的那个。再Add Printer。

hpijs是老的驱动,最开始选的这个,结果打印不了,然后又换成hpcups,还是用不了,最后通过在终端里执行"hp-setup -i"来进行配置,居然可以打印了,发现其用的是hpcups的驱动,然后我又通过浏览器重新使用hpcups来配置了一遍,莫名其妙的有可以打印了,后来发现是执行"hp-setup -i"时安装了hp-plugin。

Ubuntu 18.04打印服务器惠普P1106配置

设置打印机选项,Set Default Options。

Ubuntu 18.04打印服务器惠普P1106配置

然后打印测试页,OK。

 

接下来就是在局域网中其它电脑上使用此打印机的配置了。

Windows 7:

先安装打印机驱动,先别接打印机,安装过程中会提示接入打印机,这时再接入。

进入控制面板->设备和打印机->添加打印机->添加网络、无线或Bluetooth打印机->我需要的打印机不在列表中->按名称选择共享打印机->输入:http://IP:631/printers/HP_LaserJet_Professional_P1106->选择对应的厂商及驱动。

 

MacOS(10.13.5):

步骤记不清楚了,好像连接打印机后会自动提示安装驱动(貌似没要驱动光盘),网络打印机配置好后,在打印界面貌似可以自动搜索到。反正就是步骤很简单。

 

Linux(Ubuntu 16.04):

貌似系统已经默认包含hplip了,反正在我的印象中并没有手动安装过,所以啥都不用配置了,进入系统设置->打印机,它就在那里了。

Ubuntu 18.04打印服务器惠普P1106配置

 

Android(魅族Pro6s):

需要安装打印机服务,试了无数个app,在app内直接选择文件打印都不成功,而且通过wps打印时要么搜不到打印机,要么搜到了也无法打印,最后只发现Print Hammermill可以在app内选择文件进行打印,不过仍无法通过wps打印。

Ubuntu 18.04打印服务器惠普P1106配置

打开app->添加打印机->附近的WiFi打印机,然后就能自动搜索到打印服务器,点击后会提示未找到打印机驱动,然后手动选择驱动,在搜索框内输入打印机型号,然后选择,会提示下载驱动,然后下载就是了。不过选择打印机型号后很可能连不上,那就重启路由器/手机多试几次。

设置打印机也可以手动设置,协议选IPP,队列为printers/HP_LaserJet_Professional_P1106,即http://IP:631/printers/HP_LaserJet_Professional_P1106后面的部分。

在打印word文档时还会提示需要下载染色库和字体集,不过后来发现在设置->辅助程序库中可以手动下载。

Ubuntu 18.04打印服务器惠普P1106配置

 

相关主题

ubuntu kylin 18.04安装惠普打印机图解

精选文章
热门文章