Vector Linux 5.9
Printing with VectorLinux 5.9
1. Printing with VectorLinux 5.9 2. Pre-Installation check 3. Installation 4. Configure your printer using CUPS 5. Printing to Windows server via SAMBA 6. Sharing Your Printer with Windows via SAMBA 6.1. Setting up SAMBA 6.2. CUPS configuration 7. Credits
This document discusses several aspects of printing with VectorLinux 5.9 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.
Before purchasing or enabling a printer please check that it is supported by Linux at the following sites:
If you have a parallel port printer you should have enabled the parallel port during the install process. If you did not do this go to VASM, SUPER, HARDWARE, HWSET, enable parallel. If you have a newer HP printer you should probably install either the hpijs and/or hplip packages (using gslapt) depending what the above websites tell you concerning the required printer driver (you may have auto selected these packages to be loaded at install time, but it doesn't hurt to ensure they are installed). If you have a printer which requires a special driver you must install this driverprior to launching the CUPS configuration steps (below). The websites above will point you in the right direction. Please ensure you follow the driver install directions exactly or it is unlikely you will magically get your printer to work.
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:
If that does not work try /dev/lp1 or for usb it would be /dev/usb/lp0 or lp1 or whichever 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, so even a printer reaction is a good indication!
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").
You need to have CUPS installed and the CUPS service daemon enabled for it to work. If you are using the VectorLinux 5.9 then CUPS is pre-installed and the service will be started during boot-up.
If for some strange reason the CUPS service is not started at boot time, then you must enable it. To do this use VASM. In the VASM menu system navigate to SERVICE, SRVSET, LEVEL 4, then enable CUPS, and then reboot the system. 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.
Open your graphical web browser of choice (not Dillo, because it does not support passwords) and type:
Choose "Do Administration Tasks" and then enter "root" as username and root´s password at the prompt.
To add a printer, select "Add Printer" and
answer questions as required. If your printer is a USB printer you should see the USB device and the printer name in the drop down devices list. For a parallel port printer you normally select "#LPT1" from the device list.
(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 the base install of VectorLinux v5.
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:
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
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 preceeding instructions the link should exist). If it is not there, you will need to create it by running the following command:
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 it with:
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:
NOTE: The user/pass must match an existing, active account on the server.
(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.
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:
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:
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:
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.
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:
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:
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.
Copyright 2008 Vector