Index
Index
Disclaimer
Introduction
Main features
Limitations
Setting
up your LPSW environment
Setting
up the spooling server basics
Setting
up a LPSW
Setting
up a shared printer
An example
To do
Disclaimer
Welcome to
LPSW “The Linux Printer Server for Windows networks (on a single floppy)”
LPSW is
free software and is supplied on an as is basis in the hope that it will be
useful to other people. The author offers no warranty of its fitness for any
purpose whatsoever, and accepts no liability whatsoever for any loss or damage
incurred by its use.
LPSW is not
a supported product. The author accepts no commitment or liability to address
any problems that may be encountered in using it; however, the author is
interested to hear about any bugs or deficiencies.
LPSW is
licensed under the GNU General
Public License (GPL 2.0).
Windows 95,
Windows 98, Windows ME, Windows NT, Windows 2000 and Windows XP are trademarks
of Microsoft Corporation, Winzip is a
trademark of Winzip Computing Incorporated,
Winrar is a trademark of Eugene Roshal,
Rawwritewin is a trademark of John
Newbigin.
Index
What is LPSW?
LPSW means
Linux Printer Server for Windows networks.
It is a
single floppy Linux distribution that will help you configuring one to many
Windows printer servers hopefully reusing old PCs.
You only
need a 486 or later PC with 16MB of RAM and a floppy drive. You can also throw
away its mouse and keyboard ad use its monitor and its HD somewhere else.
Do you have
an unused obsolete PC? Or is your company plenty of obsolete PCs?
Do you need
a printer server for your Windows network? Or do you need many printer server?
You do not
want to use Windows? Because, perhaps, you want use its precious and expensive
license on another PC, not wasting it on a stupid printer server.
Ok, take
the old PCs, throw away the keyboards, the mice, use the monitors on for other
uses, remove also hard disks and CDROM drives. The only things you will need
are the PC itself, a network interface card (if the main board does not have
one included) and a diskette drive!
Well,
needing some shared printers in my company, when I realized that I had three
identical old PCs (all with the hard disk missing, maybe some of them died,
maybe some were used on other PCs), I decided to transform them in printer
servers.
The problem
was finding the hard disks for them without having to waste money in buying
them new.
I also
wanted not to waste precious and expensive Windows licenses on them, so I
decided to investigate the possible use of Linux (many thanks to Linus
Torwalds, without him nothing of this would have been possible).
I searched
the Internet looking for something already configured (or easy to do), but I
did not succeed.
Anyway I found
some interesting Linux distributions like Coyote
Linux, Linux Router Project (LRP)
and Giotto, just to mention
some of them (but you can find others) running on a single diskette.
None of
them was easily adaptable to act as Windows network printer servers.
I found
that Giotto, thanks to the
author Wolfgang Zekoll, was very easy to configure anyway.
So I
adopted it to develop my Linux Printer Server for Windows networks (LPSW).
I took some
months to do the job (I do not have much free time to spend), but finally I did
it!
My idea was
to make a printer server without any hard disk, using some other PC’s disk
space as spooling area.
In order to
reach my target I had to Giotto
both Samba client and server, and
then to add the printer daemon (lpd).
Adding the Samba client was easy enough (because
it was one of the Giotto
options), but adding the Samba
server was very hard: the server was not working properly (even if it was not
giving any particular error into the log files), only after a long testing
period, I realized that it needed a more recent shared library, the problem was
then finding the space on the floppy for it (the new library was lot greater
than the original) and the Samba
daemons that were very big.
This was
not enough because I had to add also the printer daemon, here I found that it
was not able to use symbolic links on Samba
mounted shares, to solve this problem I had to patch the lpd code recompiling
it.
I also
ported the printer information file translator from Linux to Windows (with the
help of DJGPP by DJ Delorie) in
order to be able to add any new printer without even having the need to access
the LPSW console at all, doing everything on a Windows PC.
Then I
added some additional features in order to configure one to many printer
servers on the same network in a very simple and straightforward way.
Index
Main features
Here are
some of these interesting features:
- All important configuration
files are on a single Windows PC named spooling server, you usually do not
have to access the LPSW console to do common configuration changes.
- Every time you do a change on
one or more configuration files on the Windows PC you simply need to
reboot the LPSW PCs.
- And to reboot them, if you did
not changed anything in their internal configuration files you just have
to switch them OFF and ON again, without doing anything else because the
LPSW PCs run on their local RAM (the floppy disks can also be protected
against unwanted writings).
- When rebooting, the LPSW PC
clears all its printing queues, so, if something goes wrong when printing,
simply switch OFF the LPSW and the printer which had problems and switch
them back ON, in 1 or 2 minutes they will be ready to print again.
- LPSW PCs reboot automatically
at midnight in order to automatically clear all the printing queues or hang up
status.
- LPSW PCs can also automatically
supply the needed drivers to Windows 95, Windows 98 and Windows ME PCs at
printer installation time.
- A single spooling server can be
used for many LPSWs.
- When adding or changing a
printer you do not have to change anything on the corresponding LPSW PC,
printer servers are transparent, so no specific printer driver is present
on it, you just have to modify the Windows spooling server settings (also
adding or replacing the existent drivers), to setup the Windows client PCs
accordingly and to reboot the corresponding LPSW.
Index
Limitations
And now some
limitations:
- The floppy space is really
limited: it is very difficult add more than one network driver module and
more than one keyboard map.
- No USB support is included, so
no USB printer can be used.
- Printer ports are limited to
lp1 and lp2.
- Linux kernel is 2.0.37 and C
library is libc5, so the most recent devices and features are not
supported by LPSW.
Index
Setting up your LPSW
environment
All you
need is:
- Any number of old PCs with at
least a diskette drive, a network connection and 16MB of memory to
transform them in printer servers. I will call them LPSWs from now on.
- A PC, on your network, running
any release of Windows, to use it as the spooling area for all the printer
servers, since the printer servers will not use any hard disks. I will
call them spooling servers from now on.
- A floppy disk for each LPSW and
an additional floppy disk for additional drivers and tools.
Now do the
job. You can setup everything dividing it in three procedures (it would take
you no more than 15 minutes each, lot less than setting up a single Windows
based printer server from scratch):
In the
following description I will give just a configuration example, obviously
change everything you need to fit your situation.
Index
Setting up the spooling
server basics
Setting up
the spooling server basics (you will need administrator rights if it runs
Windows NT, Windows 2000 or Windows XP):
- On the selected spooling server
create a new directory and share it with full permissions for everyone.
- With your favourite Windows
text editor create a file named servers.ini into the shared
directory with the following section and parameters (section and parameter
names cannot be changed, all the values must reflect your specific
configuration):
[drivers] # this section gives definitions for storing
the drivers for the used printers.
dir = <drivers directory> # the directory where the printer
drivers will be stored.
file = <printers definitions file> # the file that lists the drivers
needed by each printer.
- Now create a new directory for
storing printer drivers inside this shared directory (this can be useful
if you have Windows 95, Windows 98 or Windows ME based PCs in your network
and you wish your LPSWs to supply the needed drivers for all the printers
you use on first access to the printers).
- Using winzip or winrar
extract the files from LPSW-1.0.0.tar.gz into a temporary
directory.
- Copy the mkprdef.exe file
into the drivers directory.
- Using rawwritewin open
the file LPSWadd.img and create the LPSWadd floppy disk.
- You can also protect the LPSWadd
floppy against unwanted writings, you will need it just when creating a
new LPSW PC.
Index
Setting up a LPSW
Setting up
a LPSW:
- On the spooling server, using rawwritewin,
open the file LPSW.img and create the LPSW floppy disk.
- Inside the shared directory
create a new server directory.
- Inside the server directory
create a printers.ini file and add the following a section to it
(section name and parameter names cannot be changed, the values can be
just true or false in order to enable or disable the respective printer
port):
[printers] # this section list and enables or disables
the printer ports of the LPSW.
lp1 = false # disable the lp1 printer port.
lp2 = false # disable the lp2 printer port.
- Now edit the servers.ini
file into the shared directory to add the following a section for the new
LPSW (section name is the printer server IP, parameter names cannot be
changed, all the values must reflect your specific configuration):
[<printer server IP>] # the IP address of the specific
LPSW.
name = <printer server name> # the NetBios name of this LPSW.
dir = <server directory> # the name given to the server
directory assigned to this LPSW.
comment = <server comment> # the comment that will appear
browsing this LPSW.
workgroup = <server workgroup> # the name of the workgroup this
LPSW is assigned to.
- On the new LPSW PC check the
BIOS settings in order to enable booting from the floppy drive (and
setting it as the first in the boot order).
- Insert the LPSW floppy into the
printer server drive and boot it.
- Just after the LILO boot
prompt, before the boot timeout will expire, type LPSW 5 to enter
in configuration mode.
- At the login prompt type root
to login the LPSW PC.
- Insert the LPSWadd
floppy and type mount /dev/fd0 /disk to mount it.
- Change directory to / with cd
/.
- Extract the addon files from it
by typing tar xvzf /disk/add.tgz.
- If you are not in the United
States or do not like the US keyboard, identify the file of your keyboard
and type gzip –dc /x/keymaps/<country code>.map.gz |
/bin/loadkeys to load your keyboard mapping immediately.
- Type umount /disk to
unmount the LPSWadd floppy.
- Now insert again the LPSW
floppy and type mount /dev/fd0 /disk to mount it.
- Type rm /disk/etc/us.map.gz
to remove the US keyboard map (and save precious floppy disk space).
- Type cp
/x/keymaps/<country code>.map.gz /disk/etc to copy the map of
your keyboard onto the floppy.
- Type ln -sf
/disk/etc/<country code>.map.gz /disk/etc/keymap.gz to link it
to the one used by default.
- Identify the correct network
interface card driver for your LPSW PC and copy its module by typing cp
/x/netmodules/<module name>.o.gz /disk/modules/net.
- Now type jpico
/etc/lpsw.config to edit the main LPSW configuration file, change all
the parameters in order to fit your situation:
[host] # this section configures the LPSW fixed
settings.
modules = smbfs lp # do not modify this line, these modules are
needed.
nicmodule = <module name> # driver module name (without
.o.gz) of NIC in this LPSW.
ip = <printer server IP> # IP address of this LPSW.
[spool] # this section configures the spooling server
fixed settings.
name = <spooling server name> # NetBios name of the spooling
server.
share = <share name> # name assigned to the shared
directory.
user = <user name> # user name used to access the
share.
password = <password> # password used to access the share
(if any).
ip = <spooling server IP> # spooling server IP address.
- You can replace the root
password by typing passwd and then typing your new password twice.
- Type sync to flush data
onto the floppy and reboot the LPSW PC.
- You can also protect the LPSW
floppy against unwanted writings, you should not need to modify anything
on it any more (except for replacing the network interface card, IP
address redistributing in your network or similar things).
Index
Setting up a shared
printer
Setting up
a shared printer:
- On the spooling server, inside
the server directory the printer is connected to, create a new spooling
directory for this printer.
- Now edit the printers.ini
file into the server directory to add the following section for the new printer
(section name is the Linux printer port the printer is connected to,
parameter names cannot be changed, all the values must reflect your
specific configuration):
[<printer port>] # the Linux printer port the
printer is connected to.
name = <printer name> # the NetBios name of this printer.
dir = <spooling directory> # the name of the spooling directory
assigned to this printer.
comment = <printer comment> # the comment that will appear
browsing this printer.
driver = <printer driver> # the exact name of the driver as it
appears into configuration file.
- In the same file enable the
corresponding printer port in the printers section:
lp1 = true # to enable the lp1 printer port or.
lp2 = true # to enable the lp2 printer port.
- If you have Windows 95, Windows
98 or Windows ME PCs in your network and would like your LPSW to be able
to supply them the correct printer drivers at the first access to the
printer through the network (when installing the printer on them), you
need to create a printer definition file and to copy all the required
driver files, so get the most recent drivers for the printer (you can find
them in the most recent of these PCs or on the Internet from the printer
producer site).
- Now, if you will use the
drivers coming from a Windows based PC, copy the msprint*.inf
files, or if you will use the drivers coming from the printer producer
Internet site, copy the <specific printer information file> (.inf)
file, into the drivers directory
- Open a DOS box on the spooling
server and go to the drivers directory by typing cd <shared
directory>\<drivers directory>.
- Here add a new record to the
printers definitions file by typing mkprdef <printer information
file> “printer name” <printers definitions file> (the first
argument is the file that contains the original information for Windows
based PCs, the second argument is the exact name of the printer as it
appears inside the printer information file, the third argument is the
file that carries the same information for Samba) for the this printer, if
the printer definitions file does not exist it will be created, if it
already exists simply a new record will be appended. You can edit the
printer definitions file and modify the first field (the printer name),
the best idea is to copy exactly the name that the same printer has on a
Windows NT, Windows 2000 or Windows XP PC, doing this, the same printer
should have the same name for all Windows based PCs.
- Now copy all the files that mkprdef.exe
listed on the DOS box to the drivers directory (you can find them inside
the Windows .cab files where the msprint*.inf file used was
or together with the <specific printer information file>, do
not care if they are compressed (with a trailing _ underscore) or not.
Notice that if some files have been listed inside a directory, unless you
modify the printer definitions file accordingly, you need to create this
directory inside the drivers directory and put those files in it.
- Now, if you do not need them
for other printers, you can also remove the .inf files from the drivers
directory.
- Connect the printer to the LPSW
PC and reboot it.
- Finally, after LPSW PC reboot,
on all the Windows based PCs, install this printer (the printer should be
recognized and all the PCs should be able to install the required drivers
automatically).
Index
An example
This the
most simple example where we have two PCs (on a workgroup named pcgroup), a
Windows based PC (named spooler with IP address 192.168.1.240) and a Linux based
PC or LPSW (named server1 with IP address 192.168.1.241) which has a 3com
EtherLink III network interface card on the PCI bus and HP LaserJet 1100
connected to LPT1, this is the initial situation of the interested explorer
trees (as seen from the Windows network):
\\spooler
\driversdir
\mkprdef.exe
\spooldir
\servers.ini
\serverdir1
\printers.ini
\printerdir1
\\server1
\printer1
Here is
what we would have into the servers.ini file:
[drivers]
dir = driversdir
file = printers.def
[192.168.1.241]
name = server1
dir = serverdir1
comment = Printer Server 1
workgroup = pcgroup
Here is
what we would have into the printers.ini file:
[printers]
lp1 = true
lp2 = false
[lp1]
name = printer1
dir = printerdir1
comment = Laser printer 1
driver = HP LaserJet 1100
Now what we
would have into the lpsw.config file:
[host]
modules = smbfs lp
nicmodule = 3c509
ip = 192.168.1.241
[spool]
name = spooler
share = spool
user = root
password =
ip = 192.168.1.240
And finally
this is the command we would execute in this case (inside the \\spooler\driversdir
directory) in order to create the printers.def file (inside the same
directory):
mkprdef hp2010p5.inf “HP LaserJet 1100”
printers.def
Note that :
- hp2010p5.inf is the .inf file included into
the driver distribution downloaded from the HP internet site.
- As printed out by mkprdef,
you will have to copy in the same directory the following files included
in the same driver distribution in order to have the printer automatically
configured on all the Windows 95, 98 and ME PCs:
- HPBF2010.DRV.
- HPBF2010.PMD.
- HPBF2010.HLP.
- HPBF2010.DRV.
- HPBF2011.DLL.
- HPBF2010.PMD.
- HPBF2010.HLP.
- HPBFAB16.DLL.
- HPBFAB32.DLL.
- HPBAFD16.DLL.
- HPBFTM16.DLL.
- HPBFTM32.DLL.
- HPBFAB.DDU.
- HPDCMON.DLL.
- HP1100_5.EXE.
- UPWININI.DLL.
- HPBF2010.PMD.
Index
To do
Now what I
could do to improve further LPSW (if I find time and if I feel like) in the
future:
- Add network boot to allow LPSW
have dynamic IP addresses and specific boot codes.
- Upgrade to a more recent Linux
kernel and C library (both floppy and network boot space limitation could
be a problem for this) in order to have more recent hardware devices
supported.
- Add (optional) USB and serial
port support.
- Support for more printer ports.
- Support for Fax service.
Index