The following steps can be used to enable CUPS (Common UNIX Printing System) on FreeBSD.
Notes:If X11 is not installed:
Make sure that WITHOUT_X11=yes is in /etc/make.conf
# cd /usr/ports/print/ghostscript-gnu-nox11 # make install
Install CUPS from /usr/ports/print/cups:
# cd /usr/ports/print/cups # make install
Enable cups:
# cd /usr/local/etc/rc.d # ln -s cups.sh.sample cups.sh
(Optional) Enable digest authentication for /admin
Change the following in /usr/local/etc/cups/cupsd.conf:
AuthType Basic AuthClass Systemto
AuthType Digest AuthClass Group AuthGroupName cupsadminThis should be around line 812.
Create the cupsadmin group:
# pw groupadd cupsadmin
Create the cupsadmin user:
# lppasswd -a -g cupsadmin cupsadminlppasswd prompts for a password.
NOTE:
Not all browsers support digest authentication. A text-mode browser that does is w3m (available in /usr/ports/www/w3m/).
lppasswd stores the user record in /usr/local/etc/cups/passwd.md5. The cupsadmin user is not a valid user on the system and the password for cupsadmin can only be used to authenticate accesses to /admin.
(Optional) Allow only local connections by changing the following in /usr/local/etc/cups/cupsd.conf:
Port 631to
Port 127.0.0.1:631This should be around line 408.
(Optional) Replace lp* commands with CUPS versions:
Add CUPS_OVERWRITE_BASE=yes and NO_LPR=true to /etc/make.conf
Link CUPS lp* commands in /usr/local/bin to /usr/bin:
# cd /usr/bin # for i in lp* ; do mv $i $i.default ; ln -s /usr/local/bin/$i $i ; done
Start CUPS:
# /usr/local/etc/rc.d/cups.sh start
(Optional) Check to see if CUPS is running:
$ ps -auwxx | grep cupsd root 482 0.0 1.2 6924 6136 ?? Ss 11:11PM 0:00.22 /usr/local/sbin/cupsd
(Optional) Install the gimp-print printer drivers from /usr/ports/print/gimp-print:
# cd /usr/ports/print/gimp-print # make install