[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: why cups so rarely works "out of the box"



On Wednesday 26 January 2005 22:22, Richard Lyons wrote:
> Perhaps there is something basic that I have missed, but I do not
> understand why cups fails to work when first installed in most cases.
>  I have done this several times on various boxes now, and well over
> half the times, cups sends raw postscript to the printer.  Can anyone
> explain why the installation of bog-standard epson or hp printers
> should be so unreliable?
>
> Sometimes I have solved the problem with a few hours of work,
> googling and trial-and-error.  Sometimes it takes months. 
> Occasionally it just works.  But I have never identified the item
> that trips it up.  I thought once it was not having cups-bsd. 
> Another time it might have been foomatic database (I forget the exact
> package name). I have tried -- and abandoned -- writing my own ppd
> files (though that should not be necessary for an epson c62 or c64,
> surely). Someone else said remove xprint, and once that seemed to
> work.  Eventually it always starts working, usually after a reboot
> occasioned by something else.  And I never really know what I did to
> get it working.
>
> So here I am, stuck again with a sid install on a slow old thinkpad
> 570 and an epson c62 printing postscript by the ream.  I do have
> cups-bsd. I have killed xprint and removed it from /etc/rc2.d/. 
> Everything foomatic is installed.  No errors showing in the error log
> (at a normal logging level).  I tried upgrading to the latest cups
> etc to no avail. There must be a simple rational and reliable way of
> getting it to work in a predictable timescale, surely?

I wrote some notes for myself last time I installed a CUPS print server.
Should you choose to follow these notes, please let me/us know if it 
worked out for you.


## Package installation
#
# Install these packages on the print server. It is very possible
# that you far from need all of these packages, but installing
# these packages should guarantee that you will get support for
# your particular printer.
#
# The download is roughly 30 MB and once installed, the packages
# will take up almost 100 MB on your disk.
apt-get install cupsys cupsys-client cupsys-driver-gimpprint \
        foomatic-db-engine foomatic-db-gimp-print foomatic-db-hpijs \
        foomatic-filters foomatic-filters-ppds hpoj hpijs ijsgimpprint \
        psfontmgr foo2zjs libprinterconf0 pconf-detect


# Now install these packages on all client machines that will be printing
# via the print server. Again you may not want all these packages
# depending on your preferred desktop environment and other preferences.

apt-get install cupsys-client cupsys-pt gnome-cups-manager gtklp kdeprint xpp

# Maybe install the cupsys package on your clients as well. This should allow
# for the local daemon (provided by cupsys) to auto-discover available printers
# on other hosts on the LAN, I think (in this case, it should not be necessary
# to edit /etc/cups/client.conf on the client machines).



## Configure the CUPS server
#
# The default /etc/cupsys/cupsd.conf is huge with many configuration
# options and verbose comments.
#
# At the very least you must ensure that User is set to lp,
# and Group/SystemGroup must be set to lpadmin!
#
# Also, towards the bottom of the default cupsd.conf you will find a section
# called 'Security Options'. Allow your LAN network (e.g. 192.168.1.0/24) to
# access the CUPS server, but only allow a specific host (e.g. 192.168.1.4)
# to do administrative tasks on the CUPS server (provided the correct login
# credentials are supplied). See the below example file for inspiration.


# cupsd.conf example configuration file
#
# The below example file is a good starting point for your CUPS server.
# Refer to the CUPS documentation for detailed explanation of each option,
# or have a look at the default cupsd.conf which has several comments.
#
#######################################
ServerName cupsserver.mydomain.org
ServerAdmin root@localhost

User lp
Group lpadmin
SystemGroup lpadmin
RemoteRoot remroot

Listen 127.0.0.1:631
Listen 192.168.1.2:631

HostNameLookups Off
KeepAlive On
KeepAliveTimeout 120
MaxClients 100
MaxClientsPerHost 0
MaxRequestSize 0
Timeout 300

AccessLog /var/log/cups/access_log
ErrorLog /var/log/cups/error_log
PageLog /var/log/cups/page_log
LogLevel info
MaxLogSize 2m

DataDir /usr/share/cups
DocumentRoot /usr/share/cups/doc-root
FontPath /usr/share/cups/fonts
ServerCertificate /etc/cups/ssl/server.crt
ServerKey /etc/cups/ssl/server.key

TempDir /var/spool/cups/tmp
RequestRoot /var/spool/cups
ServerBin /usr/lib/cups
ServerRoot /etc/cups
Printcap /var/run/cups/printcap
PrintcapFormat BSD

DefaultCharset UTF-8
DefaultLanguage en
PreserveJobHistory Yes
PreserveJobFiles No
AutoPurgeJobs No

Browsing On
BrowseProtocols cups
BrowseAddress 192.168.1.255
BrowseShortNames No
BrowseOrder deny,allow
BrowseDeny All
BrowseAllow 192.168.1.0/24
BrowseInterval 30
BrowsePort 631
BrowseTimeout 600
ImplicitClasses On
ImplicitAnyCLasses Off
HideImplicitMembers On

<Location />
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From 192.168.1.0/24
</Location>

<Location /admin>
AuthType Basic
AuthClass System
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From 192.168.1.0/24
</Location>
#######################################


# Restart the CUPS daemon.
/etc/init.d/cupsys restart


# Create a local system account (e.g. cupsadmin) on the print server.
# This user will be used for CUPS administrative tasks. The cupsadmin
# user, however, will not be able to actually log onto the print server
# as a system user due to SHELL=/bin/false. Nonetheless, always choose
# strong passwords for your local system accounts.
useradd -d /var/lib/cups -s /bin/false -g nogroup -G lpadmin cupsadmin
passwd cupsadmin


# Notice:
# When you don't run your CUPS server locally, but on a remote host, you
# must specify the ServerName of the CUPS server in /etc/cups/client.conf
# on all the machines that will be accessing the CUPS server. This
# ServerName must be the very same ServerName that is also specified in
# /etc/cups/cupsd.conf on the server host. Furthermore, CUPS may be upset
# if you don't have a valid /etc/hosts file that also refers to the very
# same ServerName/hostname.



## Add a printer to the print server
#
# From the 192.168.1.4 host you can now access http://192.168.1.2:631
# via a web browser. When prompted to login, supply the credentials
# for the cupsadmin user.
#
# Add a printer and follow the step-by-step wizard. Alternatively,
# you can use the lpadmin command from the command line (man lpadmin).
# After adding a printer, a new section in /etc/cups/printers.conf
# should now have been created.
#
# printers.conf example configuration file
#
<DefaultPrinter CX3200>
Info Epson Stylus CX3200
Location Kunden 39, Gistrup
DeviceURI usb:/dev/usb/lp0
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>

# Now test the printer by printing out a test page.



## CUPS configuration client-side (KDE)
#
# In KDE you can manage printers from the KDE Control Center.
# Look under Peripherals -> Printers). There's also an easy to
# use wizard for adding printers. It ought to be easy and
# straight-forward to use. Remember to set CUPS as the print
# system you want to use (in the lower-right corner of the screen).
#
# Go on by specifying the location of your CUPS server in the
# 'Print Manager' tab. Choose to use anonymous access for printing.
#
# Finally, add the printer (if it's not already auto-detected).
# Happy printing...



B/R,
-- 
Frederik Dannemare | mailto:frederik@dannemare.net
http://qa.debian.org/developer.php?login=Frederik+Dannemare
http://frederik.dannemare.net | http://www.linuxworlddomination.dk



Reply to: