CUPS - Print Server: Installation
CUPS - Print Server: Installation
The primary mechanism for Ubuntu printing and print services is the Common UNIX Printing System (CUPS). This printing system is a freely available, portable printing layer hich has become the ne standard for printing in most !inu" distributions. CUPS manages print #obs and $ueues and provides net or% printing using the standard &nternet Printing Protocol (&PP), hile offering support for a very large range of printers, from dot-matri" to laser and many in bet een. CUPS also supports PostScript Printer 'escription (PP') and auto-detection of net or% printers, and features a simple eb-based configuration and administration tool. (. ). *. ,. &nstallation Configuration +eb &nterface -eferences
&nstallation
To install CUPS on your Ubuntu computer, simply use sudo ith the apt-get command and give the pac%ages to install as the first parameter. . complete CUPS install has many pac%age dependencies, but they may all be specified on the same command line. /nter the follo ing at a terminal prompt to install CUPS0 sudo apt-get install cups Upon authenticating ith your user pass ord, the pac%ages should be do nloaded and installed ithout error. Upon the conclusion of installation, the CUPS server ill be started automatically. 1or troubleshooting purposes, you can access CUPS server errors via the error log file at0 /var/log/cups/error_log. &f the error log does not sho enough information to troubleshoot any problems you encounter, the verbosity of the CUPS log can be increased by changing the LogLeveldirective in the configuration file (discussed belo ) to 2debug2 or even 2debug)2, hich logs everything, from the default of 2info2. &f you ma%e this change, remember to change it bac% once you3ve solved your problem, to prevent the log file from becoming overly large.
Configuration
The Common U4&5 Printing System server3s behavior is configured through the directives contained in the file /etc/cups/cupsd.conf. The CUPS configuration file follo s the same synta" as the primary configuration file for the .pache 6TTP server, so users familiar ith editing .pache3s configuration file should feel at ease hen editing the CUPS configuration file. Some e"amples of settings you may ish to change initially ill be presented here. Prior to editing the configuration file, you should ma%e a copy of the original file and protect it from riting, so you ill have the original settings as a reference, and to reuse as necessary. Copy the /etc/cups/cupsd.conf file and protect it from riting ith the follo ing commands, issued at a terminal prompt0 sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original sudo chmod a-w /etc/cups/cupsd.conf.original 1. ServerAdmin0 To configure the email address of the designated administrator of the CUPS server, simply edit the/etc/cups/cupsd.conf configuration file ith your preferred te"t editor, and add or modify the ServerAdmin line accordingly. 1or e"ample, if you are the .dministrator for the CUPS server, and your e-mail address is 3b#oy7somebigco.com3, then you ould modify the Server.dmin line to appear as such0 ServerAdmin [email protected] Listen0 8y default on Ubuntu, the CUPS server installation listens only on the loopbac% interface at &P address 127.0.0.1. &n order to instruct the CUPS server to listen on an actual net or% adapter3s &P address, you must specify either a hostname, the &P address, or optionally, an &P address9port pairing via the addition
2. 3.
of a !isten directive. 1or e"ample, if your CUPS server resides on a local net or% at the &P address192.168.10.250 and you3d li%e to ma%e it accessible to the other systems on this subnet or%, you ould edit the /etc/cups/cupsd.confand add a !isten directive, as such0 4. 5. 6. Listen 127.0.0.1:631 # existing loopback Listen
Listen /var/run/cups/cups.sock # existing socket Listen Listen 192.168.10.250:631 (IPP) # Listen on the LAN interface, Port 631
&n the e"ample above, you may comment out or remove the reference to the !oopbac% address (():.;.;.() if you do not ish cupsd to listen on that interface, but ould rather have it only listen on the /thernet interfaces of the !ocal .rea 4et or% (!.4). To enable listening for all net or% interfaces for hich a certain hostname is bound, including the !oopbac%, you could create a !isten entry for the hostname socratesas such0 Listen socrates:631 'socrates' # Listen on all interfaces for the hostname
or by omitting the !isten directive and using Port instead, as in0 Port 631 # Listen on port 631 on all interfaces
1or more e"amples of configuration directives in the CUPS server configuration file, vie the associated system manual page by entering the follo ing command at a terminal prompt0 man cupsd.conf +henever you ma%e changes to the /etc/cups/cupsd.conf configuration file, you3ll need to restart the CUPS server by typing the follo ing command at a terminal prompt0 sudo /etc/init.d/cups restart
+eb &nterface
CUPS can be configured and monitored using a eb interface, hich by default is available at http099localhost0<*(9admin. The eb interface can be used to perform all printer management tas%s. &n order to perform administrative tas%s via the eb interface, you must either have the root account enabled on your server, or authenticate as a user in the lpadmin group. 1or security reasons, CUPS on3t authenticate a user that doesn3t have a pass ord. To add a user to the lpadmin group, run at the terminal prompt0 sudo usermod -aG lpadmin username 1urther documentation is available in the Documentation !elp tab of the eb interface
https://www.youtube.com/watch?v=glndIybfwMQ
I will explain how to set up a headless Ubuntu CUPS print-server which allows printing, and can be administered, over a network (without having to install the gui)
irst we have to download cups ! sudo apt-get install cupsys cupsys-client make a backup o" #our cups con"ig "ile sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original sudo chmod a-w /etc/cups/cupsd.conf.original
Install Cups Print server in ubuntu
make sure that #ou have this in #our cups "ile ! $ Show shared printers on the local network% &rowsing '"" &rowse'rder allow,den# &rowse(llow all &rowse)ocalProtocols CUPS dnssd &rowse(ddress *)'C() Allow CUPS to read the password file +o do admin tasks remotel# using the web inter"ace, it will ask #ou "or a password% In order to check this password CUPS needs to be able to read the password shadow "ile% +o do this ,cups#s- needs to be a member o" the group ,shadow-% adduser cups#s shadow .ow check the port o" the the print server with ! http!//print-server-hostname!012 or http!//ip!01 3ownload some extra good printers drivers apt-get install cups#s-driver-gutenprint
.ow Connect the printers to the print-server and use the web inter"ace to add them% rom +he client 4orkstation add the new printer "rom S#stem5(dministartion5Printing
&elow is a topolog# o" normal network and taken as example in this guidance%
+he 3e"ault IP o" the print server is 2><,20?%=%2=% &e"ore doing the settings, please prepare the IP o" the router% .ormall#, it-s the gatewa# o" #our computer%
In this guidance, 2><%20?%2%2 is assumed as the IP o" the router% I" #our router@s IP is 2><%20?%=%x (x is between 2A<B8), #ou can start with step 4%
Step
Connect #our PC to the print server with an :thernet cable directl#% 'n #our Ubuntu PC, click !etwor"
Step $ Co to %P&4 Settings and select the 'ethod as 'anual, t#pe in the IP parameters% Dou can t#pe the address like the picture show below%
to Setup-5)CP/%Ppage, change the IP to *$. +,. . - and click Sa&e . /estart button%
Step 4 Connect the printer to Print Server and Print Server to one )(. port o" #our router% Connect #our Ubuntu PC to #our router with wire or wireless% Co to #dit Connections again, change the %P&4 Settings back to Automatic012CP3%
Dou can tr# to open the web page http!//2><%20?%2%2= to check whether the# can communicate each other% I" #ou can open it success"ull#, please do the con"igurations below%
Step 4 (t the le"t side o" the window, click All Applications % In the coming black window, please search "or Printing%
Step + Choose !etwor" Printer-5 5P1/5P/ 2ost or Printer at the le"t side and con"igure the options as the "ollowing, then click6orward% E 2ost: 2><,20?%2%2= (+he IP o" printer server) E 7ueue: lp2
Step , :nter the in"ormation o" the new printer and click Apply%
Until now, #ou have "inished the installation on Ubuntu 'S success"ull#% Please print a test page to check whether it can work properl#% (n# problem, please "eel "ree to contact us support*tp-link%com %
/elated articles: