Setting up a network printer isn’t as difficult as it once
used to be. Just plug it into a free network socket, assign
an IP address, and it’s ready for action. However, instead of allowing clients
to send print commands to it directly, it’s advisable to use a print server.
This has a lot of advantages. The biggest one is that the administrator doesn’t
have to go to each machine to install the printer drivers. They can be installed
in one central location on the server, and will automatically get distributed to
the clients. A lot of security and auditing features also get added, so you can
keep a close watch on the usage of your printer. Most network operating systems
have this facility built in. Here, we’ll cover how to set up print servers
using Win NT 4 server and NetWare 5.x. We’ll also look at network printing
under Linux.
Print services in NetWare
Setting up network printing services under NetWare 4.x or
earlier used to be a very tedious task. It involved setting up a print server,
print object, and a print queue. Then, you had to link these objects with each
other. Managing these for each printer on the network was equally difficult. To
print, you had to install the printer drivers on each machine, capture a port of
that printer, and then wait for their print jobs to be sent and queued to the
printer. This was not only time-consuming to set up, but troubleshooting was
also no bed of roses. Well, things have changed.
In NetWare 5, Novell Distributed Print Services (NDPS) was
introduced. This is a great improvement over the previous print services. With
NDPS, everything–printer, print queue, and print server functions–is
combined into a single entity called a printer agent. The need to create print
queues has been removed, and users send print jobs directly to printers.
First, ensure that NDPS is installed on the server. This can
be done when installing NetWare or later on. Now, NDPS objects can be created
from any workstation by using NetWare administrator. You have to create two
objects–the NDPS manager and a print agent.
You first need to create an NDPS manager in your organization’s
NDS (Novell Directory Services) tree. One NDPS manager can control multiple
printer agents, and you can perform some configuration and management tasks
directly through the NDPS Manager console interface.
Coming to print agents, a single print agent can represent
only one printer. You have to specify the gateway and the printer when setting
up an agent. Gateways are of two types–Novell Print Gateway and third party
gateways. The latter are developed by printer manufacturers to support their
printers on the network. You get them along with the printer drivers when you
buy the printer. In most cases, the Novell Print Gateway would work. Once you’ve
selected a gateway, you need to specify the port handler to identify the
printer. Options here are local printer (parallel, serial port), queue-based
printer, and remote printers (IPX, TCP/IP). As most printers nowadays can be
assigned an IP address and connected directly to the network, choose remote
printer. It’ll then prompt you to specify the IP address of the printer. Your
agent is now set up.
In NDPS, you can select drivers that you want automatically
installed on client workstations.
All users logging into this network will be able to see the
printer. They just have to double-click on it, and the appropriate drivers will
be automatically installed. So, no hassle of going to each machine to install
the drivers.
Print services under Win NT
Setting up a print server on Win NT is simple, and is similar
to adding a new printer in Win 9x.
The first step here is to go to the "Add printer"
wizard and click on "Add new printer". This brings up a screen where
you have two options–My Computer or Network Printer Server. Choose the former
to control and manage all settings from the computer you are working on, and the
latter if the printer is set up on a different server on the network. We choose
My Computer here.
The next screen displays the ports available for setting up
the printer. You can choose a local port (if the printer is attached to the
server) or set up a new port by clicking on "Add port".
You’ll then be shown various types of printer ports. Choose
Network Printer and click New Port. This will search for all the printers on
your network and display them along with their IP addresses. You can also
specify an IP address manually for a printer, because the server might take a
long time to search the network. Now, just provide the correct printer drivers
and give the printer a name.
The next screen you will see is the Printer sharing screen.
You can choose to share the printer on your network so that anybody can use it.
Click on "Shared" and give it a Share name. Here you can also choose
printer drivers for different operating systems. The advantage of this is that
whenever a user on the network double clicks on this printer, the correct
drivers will automatically get installed. Click next and your printer is ready
to go.
This printer will now be visible on the network and users are
free to install and use it.
Print services in Win 2k
Fire up the "Add printer" wizard from the Control
Panel.
Click on "Next" and you’ll get a screen with two
options–local printer and network printer. Choose Local printer if you want
that machine to become the print server. If the printer is already set up on
some computer on your network or somewhere on the Internet, choose the latter
option. We’ll choose Local printer, since we want this machine to become the
print server.
Uncheck the option for auto detection. This is required only
if you’ve connected the printer directly to your computer and you want Windows
to auto detect it.
The next screen shows various ports (parallel, serial or
file) for your printer. You’ll also find an option for creating a new port
here. Choosing this option shows a list of ports–TCP/IP, AppleTalk, LPR.
Choose TCP/IP and click on Next.
You’ll see a TCP/IP printer port wizard pop up. Type the IP
address of your printer. You can also give it a port name, otherwise it gets one
by default.
Click Finish to complete the operation. Now, you need to
provide the drivers for the printer. If your printer is not present in the list
of printers, click on Have disk and give the correct path to the drivers.
Give the printer a name and click Next.
This brings us to the sharing screen. You can share the
printer with others on the network by choosing "Share as" and giving
it an appropriate name.
You can also provide additional information about the printer–like
location and description–in the sharing screen. This can help users locate the
printer if your network is spread out. A new feature in Win 2k lets you search
for printers based on this location. You can also add drivers for other
operating systems and platforms here, if they’re available with the printer.
The printer should now be available to users. Windows-based
clients can go to the Start menu and use the "Find computer" option to
search for the print server, or use the "Add printer wizard" and go
the standard way.
Advanced printer settings
You can also set security and other features through printer
properties. You’ll see six tabs here for managing different aspects of the
printer. The General tab lets you change things like resolution, paper size,
paper quality, etc. There’s a Sharing tab, where you can add drivers for the
printer and change the printer name. The Advanced tab is where you set a time
period during which the printer would be available for printing. You can update
the printer drivers from here, or specify different spool settings. A separator
page can be added to help you find your document among others. This is very
useful if many people are using the same printer.
The Security tab is where you decide who can do what with the
printer. You can allow specific users or groups on your network to use the
printer, or assign different rights to each group or individual. For example,
the Guests group can be allowed only to print, while the Administrator group can
be given permissions to manage documents, manage printers, change permissions,
etc.
Network printing through Linux
To use Linux as your print server, you first need to
configure your network printer on Linux. Edit the /etc/hosts file to add your
printer’s IP address and name as follows:
IP Address Printer_name
If you have a running DNS, make these changes in the related
files and if you are running DHCP, block the IP address used for the printer.
Now fire up X, open a terminal window and type:
printtool &
This is the printtool program. Click on the Add button, and
from the Printer Type, select Remote Unix (lpd) Queue. Subsequently, enter the
printer name–that you specified in /etc/hosts–in the Remote Host field and
the name of your print queue in Remote Queue. Now, click the Select button and
choose a printer model that matches your printer. We were able to run an Epson
laser printer by selecting HP LaserJet. Leave the rest to defaults. Now, print
using the lpr command. If everything goes well, you can see the network printer
at work.
Configuring Samba for Windows clients
To allow Windows clients to print through Linux, you must
configure Samba. For this, edit your smb.conf file and add or modify the
following lines in the global section. If you already have a working Samba
configuration, you can skip to Adding printer share.
workgroup = workgroup_name
netbios name = LPS
server string = Linux Print Server
guest account = pcguest
security = user
The pcguest must be a valid user account with no password. If
this is a fresh Samba configuration, then give your Linux box a netbios name,
and a workgroup.
Adding printer share
The next step is to add a printer share by adding the
following lines:
comment = Network Printer
path = /var/spool/samba
printable = yes
printer = lp
guest ok = yes
Now, restart Samba by typing /etc/rc.d/init.d/smb restart
Configuring a Windows client
Open up Network Neighborhood on a Windows machine (or do a
"Find computer" from the Start menu), and search for the Linux
machine. It will have the same netbios name that you specified in the smb.conf
file. Double clicking on the Linux box brings up the printer share icon, which
is "EPSON" in our case. Click on that, and Windows will take you
through the printer driver installation–you’ll need your Windows
installation CD for this.
Automatic driver installation
You don’t have to go to each Windows machine to install
drivers for the printer. Windows can be made to fetch the printer drivers from
the Linux print server. This is, however, a long process, as you have to know
which are the driver files, and copy them to your Linux server. However, if you
have a large number of clients on your network, this method could be a time
saver.
Add the following two lines to the printer share section in
smb.conf, which in our case is labelled "EPSON":
Printer driver = HP LaserJet 4 Plus
Printer driver location = \\LPS\printer$
In the first line, you need to put the name of your printer
as recognized by Windows. In the second line, substitute LPS with your Linux
machine’s netbios name. Create two directories called pdrivers and printdef in
/usr/local/samba directory. Share the first one through smb.conf as follows:
comment = Printer Drivers
path = /usr/local/samba/pdrivers
writable = no
browsable = yes
public = yes
Now add the following line in the
printer driver file = /usr/local/samba/printdef/printers.def
You now have to create a printer definition file. To do this,
first look for files called msprint.inf, msprint2.inf, msprint3.inf, etc, on a
Win 9x machine on which you’ve installed the printer. Search for the name of
your printer in these files. In our case, we found the printer in msprint3.inf.
Copy this file to your Linux system and construct the printer definition file
as:
make_printerdef msprint3.inf "HP LaserJet 4 Plus"
>> printers.def
The make_printerdef utility is part of the Samba
distribution. You’ll see a message like:
Copy the following files to your printer$ share location.
–list of files–––-
You’ll see a list of files here. Find these files on the
Windows machine where the printer has already been installed. These are most
likely to be located in the Windows>System directory. Copy these files to the
/usr/local/samba/pdrivers directory. In our case, the files were hppcl5ms.drv,
pjlmon.dll, unidrv.dll, unidrv.hlp, iconlib.dll, finstall.dll, finstall.hlp. Now
copy printers.def to /usr/local/samba/printdef.
Now, try adding a printer on a Windows machine. It should
automatically be able to install your printer.
Sachin Makhija and Shekhar Govindarajan