VectorLinux 4.0 Printing Guide (ver. 3.1)

 

CONTENTS

1. Printing with VectorLinux
2. Pre-Instalation check
3. Installation
4. Starting CUPS 
5. Configuring CUPS to print locally
6. Printing to Windows server via SAMBA
7. Sharing Your Printer with Windows via SAMBA
  7.1. Setting up SAMBA
  7.2. CUPS configuration 
8. Credits

1. Printing with VectorLinux

This document discusses several aspects of printing with VectorLinux 4.0 using CUPS, the Common Unix Printing System. "CUPS" is a cross-platform printing solution for all UNIX environments. It is based on the "Internet Printing Protocol" and provides complete printing services to most PostScript and raster printers.


2. Pre-Installation Check

Check to see if your printer is supported at the following 2 sites
http://www.linuxprinting.org/printer_list.cgi
http://gimp-print.sourceforge.net/p_Supported_Printers.php3

If your printer accepts raw text you can test if your parallel port or usb port is working by sending some raw text to the printer. For example if the printer is connected to a parallel port enter:
date > /dev/lp0

If that does not work try /dev/lp1 or for usb it would be /dev/usb/lp0 or lp1 or which ever port you have it on. Note: my printer does not accept raw text, but because it automatically turns on when text is sent, it reacts to text being sent.

If you are going to use a printer on a Windows server you should check if the printer is available (see the section “Printing to Windows Servers via Samba”).


3. Installation

Get the Required Printing Packages
If you are using SOHO v4.0 the required packages are on the CD and installed by default.

If you are using the VectorLinux 4.0 standard version go to the following site:
http://www.ibiblio.org/pub/linux/distributions/vectorlinux/veclinux-4.0/packages/
and download the following packages, or if you have the Deluxe CD, then you can use these from the CD:

gnu-gs-fonts-6.0-i386-1.tgz
espgs-7.05.6-i386-1.tgz
ijs-0.30-i386-1.tgz
ijs-devel-0.30-i386-1.tgz
iip-1.2-dev1-i686-1.tgz
gimp-print-4.2.5-i386-1.tgz

The packages below have updated and must be downloaded from above site, don't use those on the deluxe CD:
hpijs-1.4.1-i486-2.tgz
cups-1.1.20-i586-1.tgz
foomatic-db-20040105-i586-1.tgz
foomatic-db-hpijs-1.4-1-i586-1.tgz
foomatic-filters-3.0.0-i586-1.tgz
foomatic-db-engine-3.0.0-i586-1.tgz
foomatic-filters-ppds-1.i586-1.tgz
Special Note: Foomatic Packages
The package foomatic-filters-ppds-i586-1.tgz, includes all of the ppds files that linuxprinting.org makes available. Many people with hp-printers or anyone who has a printer that works with gimp-print, probably does not need these. Check linuxprinting.org to see what you need or just try installing every thing but these packages and see if your printer works. If it does you don't need that package.

If you require a Foomatic PPD file, you can also download only the required PPD file from . http://www.linuxprinting.org/printer_list.cgi

1.First find your printer and go to the printer’s page (hit Show button on the page)
2.Look for "download PPD" links near the driver names on your printer's page.
If a driver has no "download PPD" link, there is insufficient data to generate a PPD for the entry; in that case, see the text of the driver entry.
3.Save the PPD file in the directory /usr/share/cups/model/.
The PPD file does not need to be executable, but it should be world-readable and should have the file name extension ".ppd".
Install the Packages
Install the packages in the order given above, or at least ensure the last three are done in order. Following is a quick how to install using Midnight Commander.

As root open a console and type mc, navigate to the directory that has your packages. To install them move the cursor over the package you want to install and press the F2 key, in the drop down menu chose install current slackware package. Repeat until you have installed all required packages. When finished hit the F10 key to leave midnight commander.


4. Starting CUPS

As root or su, restart the cups daemon, by opening a console and enter the following
killall -HUP cupsd
cupsd
or
/etc/rc.d/init.d/cups restart
Which should restart the cups daemon. It takes a while to restart because the foomatic data gets updated so give it a good long while to do the update.

Or if you prefer you could just reboot. But if you do this be patient, you'll think it’s hung up when in fact its just updating all the data.

If CUPS does not start at boot ensure that /etc/rc.d/init.d/cups is executable by root and that links to this exist in /etc/rc.d/rc2.d if you boot to console (text mode) and /etc/rc.d/rc5.d if you boot to a GUI.


5. Configuring CUPS to print locally

After that open a browser of your choice (not Dillo which does not support the passwords) and type
http://localhost:631/
or http://localhost:631/admin

Enter root and root-password at prompt. If you did the first select “Do Administration Tasks”. To add a printer, select “Add Printer” and answer questions as required.

When this is complete you should test the printer. (Select Printers and then select Print Test Page).

If you are going to use a printer on a Windows server (or a Linux Server which supports SAMBA) see the section “Printing to Windows Servers via SAMBA”.


6. Printing to Windows Servers via SAMBA

(Adapted From CUPS Software Admin Manual)
One way to print to a printer on a Windows Server is through the Microsoft Server Message Block ("SMB") protocol. Support for this protocol is provided with the free SAMBA software package. This is included in base install of VectorLinux v4.0 and VectorLinux Soho v4.0
If you are going to use a printer on a Windows server ensure that you can access the server with the printer and determine share name via smbclient:
/usr/bin/smbclient -L server -U user
where server is name of the server and user is a login name on the server.

You should get something like:

added interface ip=192.168.0.4 bcast=192.168.0.255 nmask=255.255.255.0
Got a positive name query response from 192.168.0.4 ( 192.168.0.4 )
Password: (not shown)

Sharename Type Comment
PRINTER$ Disk
INKJET Printer
DOWNLOAD Disk
IPC$ IPC Remote Inter Process Communication

In this case the sharename is INKJET.

Before you proceed with the printer installation, check to see if there exists a symbolic link smb in the directory /usr/lib/cups/backend/. (If you installed CUPS using the preceding instructions the link should exist). If it is not there you will need to create it by running the following command:

ln -s `which smbspool` /usr/lib/cups/backend/smb

Notice that which smbspool is enclosed in back ticks, not single quotes!
The back ticks will execute the command within and use the result in the ln command.

or ln -s /usr/bin/smbspool /usr/lib/cups/backend/smb

The latter works for the default installation of all versions of VectorLinux 4.0. Alternatively, you can create this link using Midnight Commander.

Once you have made the link you can configure your printer as in section 3. When prompted for device, choose “Windows Printer via SAMBA” which is near the bottom of the list of devices. When prompted for device URI set the with:

smb://user:pass@workgroup/server/sharename

The workgroup name need only be specified if your system is using a different workgroup. The user:pass strings are required when printing to Windows NT, 2K or XP servers or to shares with passwords enabled under Windows 95 and 98.

In these cases the entry could be simplified to one of:
smb://workgroup/server/sharename
smb://server/sharename
smb://user:pass@server/sharename

NOTE: The user/pass must match an existent, active account on the server.


7. Sharing Your Printer with Windows via SAMBA

(Adapted from Debian and Windows Shared Printing mini-HOWTO by Ian Ward)
http://www.tldp.org/HOWTO/Debian-and-Windows-Shared-Printing/

In this section we discuss how to set up VectorLinux to act as a print server for other printers on our network via SAMBA. It is assumed that you have your printer working locally using CUPS. We will need to make several changes to both CUPS and SAMBA configuration files.

Each of the Windows clients must have the appropriate printer drivers.

7.1. Setting up SAMBA

If you are allowing anonymous access to your printer you will need to create a user account for remote print jobs. As root (or su) do the following:
useradd -d /home/smbprint –s -m /bin/false smbprint

This command adds a user called "smbprint" to your system. Make sure there is enough disk space in /home/smbprint, the "smbprint" user's home directory, to spool files. Since we have no password for the account “smbprint” we include “–s /bin/false” This causes an error if someone tries to access the system using this account. If you have configured CUPS to restrict printing to certain users on your system, you must allow the "smbprint" user to access printers you want to share.

The Samba configuration file is /etc/samba/smb.conf. The following is an example configuration file set up to use CUPS with the "smbprint" user:

[global]
workgroup = WORKGROUP
printcap name = cups
printing = cups
security = share
guest account = smbprint
[printers]
comment = all printers
printable = yes
guest ok = yes
create mode = 0700
guest only = yes
use client driver = yes
path = /home/smbprint
browseable = yes

The last line allows the Windows (and other SMB) clients to see the share when browsing.

Please note that this configuration will allow printing by anyone that can make a network connection to your computer and is not recommended for computers on untrusted networks, such as computers with direct Internet connections. If you need to implement access control, set security = user or security = domain and read the Samba man pages for further information. In addition you can refer to “The Unofficial Samba HOWTO” at http://hr.uoregon.edu/davidrl/samba/ for further pointers.

Once you have added the above settings to your Samba configuration file you must restart Samba with the command:
/etc/rc.d/init.d/samba restart

Notes:
The above assumes that script /etc/rc.d/init.d/samba exists and is executable. A copy of the script is available in the directory /etc/rc.d/init.d/sample-scripts. If you have set up SAMBA to start as part of RC.M

If SAMBA does not start at boot, one method to do this is to create symbolic links, S44samba and K55samba, to the above script in /etc/rc.d/rc2.d if you boot to text mode and /etc/rc.d/rc5.d if you boot to a GUI.

7.2. CUPS Configuration

Windows printer drivers format their output for the printer before sending it across the network. You must configure CUPS to accept the pre-formatted output by uncommenting the following line from /etc/cups/mime.convs:

application/octet-stream application/vnd.cups-raw 0 -

Also uncomment the following line from /etc/cups/mime.types:

application/octet-stream

Now CUPS must be told to allow connections from other machines on the network. Add these lines to /etc/cups/cupsd.conf:

<Location /printers>
AuthType None
Order Deny,Allow
Deny From None
Allow From All
</Location>

As in the Samba configuration, this configuration allows any computer to connect to your printers and is not recommended for computers on untrusted networks. For example, if you want restrict printing to the subnet 192.168.0.* replace "Allow From All" with "Allow From 192.168.0.0/24".

For information about tightening access control to your printers, see the cupsd.conf man page and the CUPS documentation.

Finally, restart cups with the following command:
/etc/rc.d/init.d/cups restart

Your Linux printers should now be accessible to Windows PCs on the LAN. Follow the usual steps for adding a network printer to your Windows PCs, and remember to print a test page.


8. Credits:

Copyright 2004 Vector Linux
Released under [GNU Free Document License | http://www.gnu.org/licenses/fdl.html]
Contributed By: Johnvan, UKBill.