Jump to content

GSTN - Cups documentation: Difference between revisions

From TetraWiki
Praveen (talk | contribs)
No edit summary
Praveen (talk | contribs)
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 4: Line 4:




<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;"></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;"></div>


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


<div style="color:#00000a;"></div>
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 33: Line 33:




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:image-GSTNCUPS1]]


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.png]]


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.png]]




Line 67: Line 65:




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.png]]
 
4. Restart cups service.
 
''<nowiki># systemctl restart cups.service </nowiki>''
 
 
<div style="color:#00000a;">[[Image:GSTNCUPS4.png]]</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.png]]
 
<div style="color:#00000a;">2. Click and “'''''Add Printer”''''' and type root username and password of the cups server:</div>
 
 
[[Image:GSTNCUPS6.png]]
 
 
<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.png]]
 
<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.png]]
 
 
 
 
<div style="color:#00000a;">5. Fill the required information and click on “'''''Share This Printer''''' “ and click on “'''''Continue'''''”.</div>
 
[[Image:GSTNCUPS9.png]]
 
<div style="color:#00000a;">6. Select the '''“''Generic''”''' print driver and click on '''''“continue”'''''.</div>
 
[[Image:GSTNCUPS10.png]]
 
 
 
 
 
 
 
 
<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.png]]
 
== 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.png]]
 
 
<div style="color:#00000a;">2. Click on''''' “Maintenance” '''''and select “'''''Print Test Page'''''”.</div>
 
[[Image:GSTNCUPS13.png]]
 
 
<div style="color:#00000a;">3. Page will say that “''Test page sent:''”</div>
 
 
[[Image:GSTNCUPS14.png]]
 
 
 
 
 
 
 
 
 
 
== 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.png]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<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.png]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<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.png]]
 
 
<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.png]]
 
 
<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.png]]
 
 
 
 
<div style="color:#00000a;">''<nowiki># systemctl start samba4.service</nowiki>'' </div>
 
 
[[Image:GSTNCUPS20.png]]

Latest revision as of 05:33, 1 February 2019



CUPS (Common Unix Printing System)

Installation and configuration for CUPS

Date : 25.08.2016

Document Version : 1.0




Table of Contents:Configure CUPS Printing3

:CUPS Web interface (Adding printers).6

:Testing printer (Print test page).9

:CUPS Integration with Samba.11

== Configure CUPS Printing ==

1. Login to server, using root user and install CUPS.

# yum install cups*



2. Edit cupsd.conf file.

# vi /etc/cups/cupsd.conf






3. Make below entries and save file.


MaxLogSize 1m

LogLevel debug

# Allow remote access

Listen localhost:631

Listen 172.18.101.14:631

Listen 2404:a800:1000:d:7800::e:631

Listen /var/run/cups/cups.sock

Browsing On

BrowseLocalProtocols dnssd

DefaultAuthType Basic

WebInterface Yes

<Location />

# Allow remote administration...
Order allow,deny
Allow localhost
Allow 172.18.5.0/24

</Location>

<Location /admin>

# Allow remote administration...
Order allow,deny
Allow localhost
Allow 172.18.5.0/24

</Location>

<Location /admin/conf>

AuthType Default
Require user @SYSTEM
# Allow remote access to the configuration files...
Order allow,deny
Allow localhost
Allow 172.18.5.0/24

















4. Restart cups service.

# systemctl restart cups.service



== CUPS Web interface (Adding printers). ==

1. Now open the web browser and open link https://172.18.101.14:631.

From here we can add and manage printers. to add a new printer click “Administration”.

2. Click and “Add Printer” and type root username and password of the cups server:



3. Select AppSocket/HP JetDirect (here i have Hp Laserjet Pro m202dw printers) and click Continue.


4. In connection tab type the ipp://172.18.5.67:631/ipp (172.18.5.67 is printer IP) and click Continue.




5. Fill the required information and click on “Share This Printer “ and click on “Continue”.

6. Select the Generic print driver and click on “continue”.





7. Select the model Generic PCL Laser Printer(en)and click on “Add Printer”.

Now printer configuration has been done.

== Testing printer (Print test page). ==

1. Click on Printerstab. Here we can see the installed printers click on printer which we want to test.


2. Click on “Maintenance” and select “Print Test Page”.


3. Page will say that “Test page sent:







== CUPS Integration with Samba. ==

To integrate cups with samba we can follow below steps.
1. Open “/usr/local/samba/etc/smb.conf” file.

# vi /usr/local/samba/etc/smb.conf









2. Make below entry in smb.conf file in Global section.
rpc_server:spoolss = external
rpc_daemon:spoolssd = fork
spoolss: architecture = Windows x64









3. Create the Samba spool directory and set permission.

# mkdir -p /var/spool/samba4/ ; chmod 1777 /var/spool/samba4/



4. Open again /usr/local/samba/etc/smb.conf file and make below entries.


[ProLaserJet]

comment = ProLaserJet
path = /var/spool/samba4/
browseable = yes
printable = yes
printer name = ProLaserJet


[ProLaserJet2]

comment = ProLaserJet2
path = /var/spool/samba4/
browseable = yes
printable = yes
printer name = ProLaserJet2



5. Restart samba service.
# systemctl stop samba4.service



# systemctl start samba4.service