Jump to content

GSTN - Cups documentation: Difference between revisions

From TetraWiki
Praveen (talk | contribs)
No edit summary
Praveen (talk | contribs)
No edit summary
Line 23: Line 23:
CUPS (Common Unix Printing System)
CUPS (Common Unix Printing System)


Installation and configuration for CUPS  
As is Build for CUPS


Date : 25.08.2016
Date : 27.08.2016


Document Version : 1.0
Document Version : 1.0
Line 34: Line 34:




Table of Contents:[[#RefHeading3061179521510|Configure CUPS Printing3]]
Table of Contents:[[#RefHeading2831893905196|1. SAMBA integrated CUPS ( Print Server )3]]


:[[#RefHeading3091179521510|CUPS Web interface (Adding printers).6]]
:[[#RefHeading2832093905196|2. SMB.CONF Configuration.4]]


:[[#RefHeading96093905196|Testing printer (Print test page).9]]
:[[#RefHeading2832293905196|3. CUPS web-based administration interface4]]


:[[#RefHeading96293905196|CUPS Integration with Samba.11]]
:[[#RefHeading2832493905196|4. CUPS quotas5]]


== Configure CUPS Printing ==
:[[#RefHeading2833093905196|5. CUPS Access Control.6]]


1. Login to server, using root user and install CUPS.
== 1. SAMBA integrated CUPS ( Print Server )[[Image:]] ==


''<nowiki># yum install cups*</nowiki>''
[[Image:]]


A print server accepts print jobs from network computers, queues them locally and then sends them to the appropriate printers. As well as having domain and file service capabilities, Samba can also act as a MS Windows compatible print server. While Samba provides the interface to Windows/SMB machines, CUPS or LDP is used by Samba to send print jobs to the devices.


[[Image:GSTNCUPS1]]
CUPS provides a mechanism that allows print jobs to be sent to printers in a standard fashion. The print-data goes to a scheduler which sends jobs to a filter system that converts the print job into a format the printer will understand. The filter system then passes the data on to a backend—a special filter that sends print data to a device or network connection. The system makes extensive use of PostScript and rasterization of data to convert the data into a format suitable for the destination printer.


The CUPS scheduler implements Internet Printing Protocol (IPP) over HTTP/1.1. A helper application (cups-lpd) converts Line Printer Daemon protocol (LPD) requests to IPP. The scheduler also provides a web-based interface for managing print jobs, the configuration of the server, and for documentation about CUPS itself.


2. Edit cupsd.conf file.
CUPS can process a variety of data formats on the print server. It converts the print-job data into the final language/format of the printer via a series of filters. It uses MIME types for identifying file formats.


''<nowiki># vi /etc/cups/cupsd.conf</nowiki>''
The backends are the ways in which CUPS sends data to printers. There are several backends available for CUPS: parallel, serial, and USB ports, cups-pdf PDF Virtual Printing, as well as network backends that operate via the IPP, JetDirect (AppSocket), Line Printer Daemon ("LPD"), and SMB protocols.


CUPS integrated with SAMBA supports multiple end user operating systems – e.g. Linux all flavors (Desktop OS and Server OS, Windows 7 and higher, Windows server 2003 and higher, Mac OS.






[[Image:GSTNCUPS2]]




Line 66: Line 68:




3. Make below entries and save file.




''MaxLogSize 1m''


''LogLevel debug''


''<nowiki># Allow remote access</nowiki>''


''Listen localhost:631''


''Listen 172.18.101.14:631''


''Listen 2404:a800:1000:d:7800::e:631''
== 2. SMB.CONF Configuration. ==


''Listen /var/run/cups/cups.sock''
To integrated CUPS with samba i made below entries in '''smb.conf.'''


''Browsing On''
<div style="color:#00000a;">[[Image:]]</div>


''BrowseLocalProtocols dnssd''
== 3. CUPS web-based administration interface ==


''DefaultAuthType Basic''
On all platforms, CUPS has a web-based administration interface that runs on port 631. It particularly helps the need to monitor print jobs and add print queues and printers remotely. This interface is with an enhanced administration interface that allows users to add, modify, delete, configure, and control classes, jobs, and printers. It Supports reports/ monitoring, Auditing and tracking of print queues . It will also do the centralized allocation /DE-allocation of Network printers to the users.


''WebInterface Yes''


''<Location />''
'''3.1 CUPS Web interface Home page'''


<div style="color:#00000a;">''<nowiki># Allow remote administration...</nowiki>''</div>
<div style="color:#00000a;">[[Image:]]</div>


<div style="color:#00000a;">''Order allow,deny''</div>


<div style="color:#00000a;">''Allow localhost''</div>


<div style="color:#00000a;">''Allow 172.18.5.0/24''</div>


''</Location>''


''<Location /admin>''


<div style="color:#00000a;">''<nowiki># Allow remote administration...</nowiki>''</div>
'''3.2 CUPS Web interface Administration page'''


<div style="color:#00000a;">''Order allow,deny''</div>


<div style="color:#00000a;">''Allow localhost''</div>
== [[Image:]] ==


<div style="color:#00000a;">''Allow 172.18.5.0/24''</div>
== 4. CUPS quotas ==


''</Location>''
CUPS supports page and size-based '''quotas''' for each printer. The quotas are tracked individually for each user, but a single set of limits applies to all users for a particular printer. CUPS '''logsevery page''' that is printed on a system to the ''page_log'' file. Page logging is only available for drivers that provide page accounting information, typically all PostScript and CUPS raster devices. Raw queues and queues using third-party solutions such as Foomatic generally do not have useful page accounting information available.


''<Location /admin/conf>''
Structure at GSTN : The HP Laserjet Pro M202dw printers act as print servers and authenticate against the Samba AD.


<div style="color:#00000a;">''AuthType Default''</div>
<div style="color:#00000a;">[[Image:|top]]</div>


<div style="color:#00000a;">''Require user @SYSTEM''</div>
== 5. CUPS Access Control. ==


<div style="color:#00000a;">''<nowiki># Allow remote access to the configuration files...</nowiki>''</div>
CUPS allows to create a new or modify an existing printer in such a way that there is a user-based access-control in place. Thus we can allow or deny access to a certain printer based on the user name.  


<div style="color:#00000a;">''Order allow,deny''</div>


<div style="color:#00000a;">''Allow localhost''</div>
<div style="color:#00000a;">[[Image:]]</div>
 
<div style="color:#00000a;">''Allow 172.18.5.0/24''</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
[[Image:GSTNCUPS3]]
 
4. Restart cups service.
 
''<nowiki># systemctl restart cups.service </nowiki>''
 
 
<div style="color:#00000a;">[[Image:GSTNCUPS4]]</div>
 
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;"></div>
 
== CUPS Web interface (Adding printers). ==
 
<div style="color:#00000a;">1. Now open the web browser and open link <span style="color:#3333ff;">''https://172.18.101.14:631</span>.''</div>
 
From here we can add and manage printers. to add a new printer click '''''“Administration”'''''.
 
[[Image:GSTNCUPS5]]
 
<div style="color:#00000a;">2. Click and “'''''Add Printer”''''' and type root username and password of the cups server:</div>
 
 
[[Image:GSTNCUPS6]]
 
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;">3. Select '''“''AppSocket/HP JetDirect''”''' (here i have Hp Laserjet Pro m202dw printers) and click '''''Continue''. '''</div>
 
 
[[Image:GSTNCUPS7]]
 
<div style="color:#00000a;">4. In connection tab type the '''''ipp://172.18.5.67:631/ipp''''' (172.18.5.67 is printer IP) and click ''Continue''.</div>
 
 
[[Image:GSTNCUPS8]]
 
 
 
 
<div style="color:#00000a;">5. Fill the required information and click on “'''''Share This Printer''''' “ and click on “'''''Continue'''''”.</div>
 
[[Image:GSTNCUPS9]]
 
<div style="color:#00000a;">6. Select the '''“''Generic''”''' print driver and click on '''''“continue”'''''.</div>
 
[[Image:GSTNCUPS10]]
 
 
 
 
 
 
 
 
<div style="color:#00000a;">7. Select the model '''“''Generic PCL Laser Printer(en)''” '''and click on '''''“Add Printer”.'''''</div>
 
Now printer configuration has been done.
 
[[Image:GSTNCUPS11]]
 
== Testing printer (Print test page). ==
 
<div style="color:#00000a;">1. Click on ''“'''Printers'''” ''tab''. ''Here we can see the installed printers click on printer which we want to test.</div>
 
[[Image:GSTNCUPS12]]
 
 
<div style="color:#00000a;">2. Click on''''' “Maintenance” '''''and select “'''''Print Test Page'''''”.</div>
 
[[Image:GSTNCUPS13]]
 
 
<div style="color:#00000a;">3. Page will say that “''Test page sent:''”</div>
 
 
[[Image:GSTNCUPS14]]
 
 
 
 
 
 
 
 
 
 
== CUPS Integration with Samba. ==
 
<div style="color:#00000a;">To integrate cups with samba we can follow below steps.</div>
 
<div style="color:#00000a;">1. Open “'''''/usr/local/samba/etc/smb.conf'''''” file.</div>
 
''<nowiki># vi /usr/local/samba/etc/smb.conf</nowiki>''
 
[[Image:GSTNCUPS15]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<div style="color:#00000a;">2. Make below entry in '''''smb.conf''''' file in Global section.</div>
 
<div style="color:#00000a;">''rpc_server:spoolss = external''</div>
 
<div style="color:#00000a;">''rpc_daemon:spoolssd = fork''</div>
 
<div style="color:#00000a;">''spoolss: architecture = Windows x64''</div>
 
 
[[Image:GSTNCUPS16]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;">3. Create the Samba spool directory and set permission. </div>
 
''<nowiki># mkdir -p /var/spool/samba4/ ; chmod 1777 /var/spool/samba4/</nowiki>''
 
 
[[Image:GSTNCUPS17]]
 
 
<div style="color:#00000a;">4. Open again '''''/usr/local/samba/etc/smb.conf '''''file and make below entries.</div>
 
 
''[ProLaserJet]''
 
<div style="color:#00000a;">''comment = ProLaserJet''</div>
 
<div style="color:#00000a;">''path = /var/spool/samba4/''</div>
 
<div style="color:#00000a;">''browseable = yes''</div>
 
<div style="color:#00000a;">''printable = yes''</div>
 
<div style="color:#00000a;">''printer name = ProLaserJet''</div>
 
 
''[ProLaserJet2]''
 
<div style="color:#00000a;">''comment = ProLaserJet2''</div>
 
<div style="color:#00000a;">''path = /var/spool/samba4/''</div>
 
<div style="color:#00000a;">''browseable = yes''</div>
 
<div style="color:#00000a;">''printable = yes''</div>
 
<div style="color:#00000a;">''printer name = ProLaserJet2''</div>
 
 
[[Image:GSTNCUPS18]]
 
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;"></div>
 
<div style="color:#00000a;">5. Restart samba service.</div>
 
<div style="color:#00000a;">''<nowiki># systemctl stop samba4.service</nowiki>'' </div>
 
[[Image:GSTNCUPS19]]
 
 
 
 
<div style="color:#00000a;">''<nowiki># systemctl start samba4.service</nowiki>'' </div>
 
 
[[Image:GSTNCUPS20]]

Revision as of 12:18, 31 January 2019




CUPS (Common Unix Printing System)

As is Build for CUPS

Date : 27.08.2016

Document Version : 1.0




Table of Contents:1. SAMBA integrated CUPS ( Print Server )3

2. SMB.CONF Configuration.4
3. CUPS web-based administration interface4
4. CUPS quotas5
5. CUPS Access Control.6

1. SAMBA integrated CUPS ( Print Server )[[Image:]]

[[Image:]]

A print server accepts print jobs from network computers, queues them locally and then sends them to the appropriate printers. As well as having domain and file service capabilities, Samba can also act as a MS Windows compatible print server. While Samba provides the interface to Windows/SMB machines, CUPS or LDP is used by Samba to send print jobs to the devices.

CUPS provides a mechanism that allows print jobs to be sent to printers in a standard fashion. The print-data goes to a scheduler which sends jobs to a filter system that converts the print job into a format the printer will understand. The filter system then passes the data on to a backend—a special filter that sends print data to a device or network connection. The system makes extensive use of PostScript and rasterization of data to convert the data into a format suitable for the destination printer.

The CUPS scheduler implements Internet Printing Protocol (IPP) over HTTP/1.1. A helper application (cups-lpd) converts Line Printer Daemon protocol (LPD) requests to IPP. The scheduler also provides a web-based interface for managing print jobs, the configuration of the server, and for documentation about CUPS itself.

CUPS can process a variety of data formats on the print server. It converts the print-job data into the final language/format of the printer via a series of filters. It uses MIME types for identifying file formats.

The backends are the ways in which CUPS sends data to printers. There are several backends available for CUPS: parallel, serial, and USB ports, cups-pdf PDF Virtual Printing, as well as network backends that operate via the IPP, JetDirect (AppSocket), Line Printer Daemon ("LPD"), and SMB protocols.

CUPS integrated with SAMBA supports multiple end user operating systems – e.g. Linux all flavors (Desktop OS and Server OS, Windows 7 and higher, Windows server 2003 and higher, Mac OS.









2. SMB.CONF Configuration.

To integrated CUPS with samba i made below entries in smb.conf.

[[Image:]]

3. CUPS web-based administration interface

On all platforms, CUPS has a web-based administration interface that runs on port 631. It particularly helps the need to monitor print jobs and add print queues and printers remotely. This interface is with an enhanced administration interface that allows users to add, modify, delete, configure, and control classes, jobs, and printers. It Supports reports/ monitoring, Auditing and tracking of print queues . It will also do the centralized allocation /DE-allocation of Network printers to the users.


3.1 CUPS Web interface Home page

[[Image:]]




3.2 CUPS Web interface Administration page


[[Image:]]

4. CUPS quotas

CUPS supports page and size-based quotas for each printer. The quotas are tracked individually for each user, but a single set of limits applies to all users for a particular printer. CUPS logsevery page that is printed on a system to the page_log file. Page logging is only available for drivers that provide page accounting information, typically all PostScript and CUPS raster devices. Raw queues and queues using third-party solutions such as Foomatic generally do not have useful page accounting information available.

Structure at GSTN : The HP Laserjet Pro M202dw printers act as print servers and authenticate against the Samba AD.

[[Image:|top]]

5. CUPS Access Control.

CUPS allows to create a new or modify an existing printer in such a way that there is a user-based access-control in place. Thus we can allow or deny access to a certain printer based on the user name.


[[Image:]]