CUPS Printing

I set up my FreeBSD system to print to a Brother HL-2040 laser printer via usb cable using the "Common Unix Printing System" or CUPS. After I did everything below in basically the order it's listed, printing from my Inspiron 1100 laptop to the printer is no problem. Everything below was done with root access except actual printing.

1. First I installed 'cups-base', 'foomatic-filters', 'ghostscript-gnu-nox11', 'a2ps-letter', and 'cups-pstoraster' as well just in case. All of these have there own directory inside the '/usr/ports/print' directory. I use 'cd' to enter the directories and then typed 'make install' to install the program.

2. I went to the Linux Foundations Open Printing website and looked up the make and model of my printer. Then I downloaded ppd file for my printer and saved it in a directory called print.

3. In the 'etc/rc.conf' file I added the line below.

cupsd_enable="YES"

If there is an lpd_enable line, make it read as follows.

lpd_enable="NO"

4. Then I ran 'cupsd' (typed 'cupsd' and pressed enter) in '/usr/local/etc/rc.d'.

5. I opened a browser and logged on to "http://localhost:631". I set up the printer making sure to use the usb connection and navigating to the 'print' directory to use the ppd file I downloaded, and giving the printer a name like "br2040"..

6. I know that FreeBSD likes to print by finding and using lp and lpr in the '/usr/bin' directory so in '/usr/bin' I did the following at the command line.

mv lp lp.bak
mv lpr lpr.bak


and

ln -s /usr/local/bin/lp /usr/bin/lp
ln -s /usr/local/bin/lpr /usr/bin/lpr


7. CUPS must have permission to use the usb port so I did the following from the command line. (You may want 'ulpt0' or some other device name instead of 'unlpt0'.)

chmod 777 /dev/unlpt0
chown cups /dev/unlpt0


8. I set the default printer

'loptions -d br2040'

9. I rebooted, connected the printer, started the physical printer then did #5 again just to be sure.

10. Finally I printed.