Difference between revisions of "Set up a print server using cups"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
Modify /etc/cups/cupsd.conf:
+
= Quickstart =
 +
* Make sure your printer prints as a local printer
 +
* Find out your printer's name using the [[command]] lpstat
 +
lpstat -p -d
 +
printer Brother_DCP-J140W disabled since Fri 14 Dec 2012 03:13:10 PM UTC -
 +
        Unplugged or turned off
  
<pre>
+
* Modify /etc/cups/cupsd.conf:
Listen *:631
 
Listen /var/run/cups/cups.sock
 
  
<Location />
+
Listen *:631
Order Deny,Allow
+
Listen /var/run/cups/cups.sock
Allow From 127.0.0.1
+
Allow From All
+
<Location />
</Location>
+
Order Deny,Allow
 +
Allow From 127.0.0.1
 +
Allow From All
 +
</Location>
 +
 +
<Location /printers/Brother_DCP-J140W>
 +
Order Deny,Allow
 +
Allow From 127.0.0.1
 +
AuthType None
 +
Allow from All
 +
</Location>
  
<Location /printers/ThePrinter>
+
The (re)start the cups printing service:
Order Deny,Allow
+
/etc/init.d/cups restart
Allow From 127.0.0.1
 
AuthType None
 
Allow from All
 
</Location>
 
</pre>
 
  
 
= TroubleShooting =
 
= TroubleShooting =
Line 26: Line 34:
 
  Allow from 192.168.0.1
 
  Allow from 192.168.0.1
 
Do the same for the section /admin.
 
Do the same for the section /admin.
 +
 +
== no printer found ==
 +
;Symptom: No printer is displayed in a KDE application so you cannot select a printer. You are using (e.g.) 192.168.0.1 as print server.
 +
;Reason: When CUPS listens to 127.0.0.1 it does not listen to the computer's public IP address.
 +
;Solution: In the KDE print dialog, select "System Options" -> "Cups Server" and enter 127.0.0.1 instead of e.g. 192.168.0.1.
 +
 +
== printers.conf ==
 +
set shared to yes
 +
 +
= See also =
 +
* [[printing]]

Latest revision as of 05:48, 3 April 2020

Quickstart

  • Make sure your printer prints as a local printer
  • Find out your printer's name using the command lpstat
lpstat -p -d
printer Brother_DCP-J140W disabled since Fri 14 Dec 2012 03:13:10 PM UTC -
        Unplugged or turned off
  • Modify /etc/cups/cupsd.conf:
Listen *:631
Listen /var/run/cups/cups.sock

<Location />
Order Deny,Allow
Allow From 127.0.0.1
Allow From All
</Location>

<Location /printers/Brother_DCP-J140W>
Order Deny,Allow
Allow From 127.0.0.1
AuthType None
Allow from All
</Location>

The (re)start the cups printing service:

/etc/init.d/cups restart

TroubleShooting

forbidden

Solution: In /etc/cups/cupsd.conf, add under

<Location />
Allow from 192.168.0.1

Do the same for the section /admin.

no printer found

Symptom
No printer is displayed in a KDE application so you cannot select a printer. You are using (e.g.) 192.168.0.1 as print server.
Reason
When CUPS listens to 127.0.0.1 it does not listen to the computer's public IP address.
Solution
In the KDE print dialog, select "System Options" -> "Cups Server" and enter 127.0.0.1 instead of e.g. 192.168.0.1.

printers.conf

set shared to yes

See also