Printer Server Setup
- Henry has a printer connected to it and provides printing services for the local network in addition to all its other tasks. It server both Unix clients using remote printing, and MS Windows clients using Samba.
References
- Printing Usage Howto
- Samba (SMB) Howto
- RedHat Getting Started Manual
- Samba's smb.conf man page
Setting Up the Printer
- This job involves creating a /etc/printcap file. The syntax of this file is rather cryptic and terse. RedHat's printtool, does a fine job in making this file creation simple. As root simply run up printtool, and follow the instructions in the Getting Started guide. We create three logical printers for the one physical printer installed. (This is analogous to printer drivers in the MS Windows world). The Logical Printers are:
- hp850c - normal draft printing
- hp850c-2up - prints to pages side by side on one sheet of paper.
- hp850c-hi - higher quality output.
- The resulting /etc/printcap file should look something like:
- >>>>>>>>>>>>>>>>>>/etc/printcap
# /etc/printcap # # Please don't edit this file directly unless you know what you are doing! # Be warned that the control-panel printtool requires a very strict format! # Look at the printcap(5) man page for more info. # # This file can be edited with the printtool in the control-panel. ##PRINTTOOL3## LOCAL cdj550 300x300 letter {} DeskJet550 3 1 hp850c:\ :sd=/var/spool/lpd/hp850c:\ :mx#0:\ :sh:\ :lp=/dev/lp0:\ :if=/var/spool/lpd/hp850c/filter: ##PRINTTOOL3## LOCAL cdj550 300x300 letter {} DeskJet550 24 1 hp850c-high:\ :sd=/var/spool/lpd/hp850c-high:\ :mx#0:\ :sh:\ :lp=/dev/lp0:\ :if=/var/spool/lpd/hp850c-high/filter: ##PRINTTOOL3## LOCAL cdj550 300x300 letter {} DeskJet550 3 1 hp850c-2up:\ :sd=/var/spool/lpd/hp850c-2up:\ :mx#0:\ :sh:\ :lp=/dev/lp0:\ :if=/var/spool/lpd/hp850c-2up/filter:- <<<<<<<<<<<<<<<<<</etc/printcap
- We choose to make hp850c our default printer. I use bash as my shell program. I add the following lines to my bash initialization file /etc/bashrc:
- PRINTER=hp850c
- export PRINTER
- You can use printtool to restart lpd, the line printer daemon, or you could do it manually with:
- /etc/rc.d/init.d/lpd restart
- Finally we can print a test page, use printtool, or pipe a file such as /etc/passwd through lpr.
- lpr /etc/passwd
- For other Unix boxes to be able to spool to this print server, we need to advise this print server of the hosts that can spool here. We do this by entering the names of all permitted Unix hosts, one per line, in a file /etc/hosts.lpd.
- >>>>>>>>>>>>>>>>>>/etc/hosts.lpd
hercules homer henry hal-9000 beatroot hershel- <<<<<<<<<<<<<<<<<</etc/printcap
Setting up Samba
- This is not a serious samba setup, this configuration sets up a Unix printer for "MS Windows printer sharing" as a bonus, if one MS Window's login matches a unix login, the home directory of that unix login is visable to "MS Windows file sharing", and readonly access to the whole unix directory structure (that permits access, can't see files that you do not have rights to see).
- Ensure you have samba installed (rpm -qi smb). If not you can retrieve it from rpmfind.net.
- The following is the config file I use, it is not rocket science, however a read of the smb.conf man page will not hurt.
- >>>>>>>>>>>>>>>>/etc/smb.conf
[global] workgroup = Novatek server string = Henry Resource Sharing security = share guest only = yes hosts allow = 192.168.0. localhost log file = /var/log/samba/log.%m max log size = 50 socket options = TCP_NODELAY printcap name = /etc/printcap printing = bsd load printers = yes case sensitive = no short preserve case = yes preserve case yes [homes] comment = Home Directories read only = No create mask = 0750 browseable = No [printers] comment = All Printers path = /var/spool/samba public = Yes printable = Yes browseable = No writeable = No create mode = 700 [root] comment = Henry root path = / read only = yes public = yes- <<<<<<<<<<<<<<<< /etc/smb.conf
Checking things out
- Windwows Clients
- If TCP/IP Networking is installed correctly, and DNS points to Henry's IP address, Henry should appear as a folder in the Explorer's Network Neighborhood. Opening this folder should show the root directory, the user directory if the MS Windows user matches, and a printer icon for each of the printers configured on Henry.
- Unix Hosts
- This is covered in the common configurations.
Last modified: Tue Feb 8 22:00:00 PST 2000
Copyright © Jonathan Marks, 1999, 2000. All rights
reserved.
http://jon.novatek.co.nz/linux/config/henry-prn.html.