How to set up a CUPS server

From LQWiki
Jump to navigation Jump to search

This describes how to set up a print-server in the network. We will use cups as printing system. Perform the following steps:

Set up your printer locally

See set up a local printer.

Add networking to CUPS

You need to edit /etc/cups/cupsd.conf to either allow all computers to print, or a specific computer. For each queue,and for the base CUPS system, you need to specify the permissions. Here is a working example:

Listen *:631
Listen /var/run/cups/cups.sock

<Location />
Order Deny,Allow
Allow From 127.0.0.1
# either this line
Allow From All
# or a line like this
# Allow From 192.168.0.37
</Location>

<Location /printers/ThePrinter>
Order Deny,Allow
Allow From 127.0.0.1
AuthType None
# either this line
Allow from All
# or this line
# Allow from 192.168.0.37
</Location>

In this example, we assume you want to allow all your LAN's printers to print on your server. You will have to adjust ThePrinter to your printing queue's name, you can find it if you surf to http://localhost:631. If you are using a firewall, you will need to open holes for the CUPS communication (tcp) and data (udp) packages on both the client and server. On my system, these look like:

iptables -A INPUT -p udp -m udp --dport 631 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 631 -j ACCEPT

Of course, you can add a "-s 192.168.0.37" flag for a more restrictive hole in your firewall.

Don't forget to restart the CUPS service on your systems!

See also