# If you're replacing another print server like lpr, lpr-ng, etc., remove it
# before you begin. CUPS should blow it away, but better to do it on purpose
# beforehand, and I'm sure it won't clean out old man pages and such...
# Every time I removepkg'd lpr it left /usr/sbin/lpd, so 'rm /usr/sbin/lpd'
# too (don't forget to 'killall lpd' also).
# After you install CUPS itself, move on to these howtos (before you start
# CUPS and configure the printer):
# HPLIP (HP Linux Imaging and Printing)
# gimp-print (Canon, Epson, Lexmark,
# and PCL drivers)
# Ghostscript
# This howto used to install several things into ~/installed/cups (because
# they were all in this howto). Move them into ~/installed and fix the
# source dirs:
cd
test -d installed/cups &&
( mv -f installed/cups/* installed/ ; rmdir installed/cups )
test -d src/cups &&
( mv -f src/cups/* src/ ; rmdir src/cups )
cd
test -f installed/cups-1.4.3-source.tar.bz2 &&
mv installed/cups-1.4.3-source.tar.bz2 .
test ! -f cups-1.4.3-source.tar.bz2 &&
wget http://ftp.easysw.com/pub/cups/1.4.3/cups-1.4.3-source.tar.bz2
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "cups-*" -exec rm -r {} \;
tar xjvf ~/cups-1.4.3-source.tar.bz2
cd cups-1.4.3
test $UID = 0 && chown -R root:root .
# If you have both OpenSSL and GnuTLS installed, and configure can find
# both, it will use GnuTLS.
#
# If you are building in OpenSSL and have it installed under /usr/local/ssl
# or another location that is not in your PATH, tell configure where to find
# it like so:
# ./configure \
# --with-openssl-libs=/usr/local/ssl/lib \
# --with-openssl-includes=/usr/local/ssl/include
# To specify a Java interpreter for web interfaces, add --with-java=/path
# to configure below. For example: --with-java=/usr/local/java/bin/java
# If it's in your PATH, configure should find it automatically without the
# --with-java option.
./configure
make
# Become root
su
# Back up existing CUPS config files:
test -d /etc/cups &&
( mkdir -p -m 0700 ~/backup/cups
cp -a /etc/cups/* ~/backup/cups/ )
# If you have a modern version of Slackware that supports SystemV style
# init scripts, create the necessary directories:
test -x /etc/rc.d/rc.sysvinit &&
( cd /etc/rc.d ; mkdir -p init.d rc{0,1,2,3,4,5,6}.d )
test -x /sbin/removepkg && /sbin/removepkg cups
( cd /usr/lib ; rm -f libcups.* libcupsimage.* )
make install
ldconfig
# If you compiled in PAM support, 'make install' added a /etc/pam.d/cups
# file if you didn't have one already.
# If you have both init scripts, leave the init.d one, remove the other
test -e /etc/rc.d/rc.cups && test -e /etc/rc.d/init.d/cups &&
rm -f /etc/rc.d/rc.cups
# If you don't want to run the cupsd server:
test -x /etc/rc.d/init.d/cups && chmod -x /etc/rc.d/init.d/cups
# To set up a CUPS client that will only print to one remote printer:
cd /etc/cups
mv -f client.conf client.conf.orig
echo "ServerName cupsserver.foo.org" > client.conf
# To set up a CUPS server, do everything below:
# Poke around in /etc/cups. If you just upgraded CUPS, you'll find the file
# you had before, an .O file if you've upgraded before, and an .N file from
# the version you just upgraded to. Check for differences between the file
# and the .N file.
## Add these two lines to /etc/services if they're not in there already:
# ipp 631/tcp
# ipp 631/udp
## For logging, either set these three lines in /etc/cups/cupsd.conf
# AccessLog syslog
# ErrorLog syslog
# PageLog syslog
## or set up log rotating for /var/log/cups/*:
cat << EOF > /etc/logrotate.d/cups
/var/log/cups/access_log /var/log/cups/error_log /var/log/cups/page_log {
rotate 6
daily
copytruncate
missingok
}
EOF
chmod 600 /etc/logrotate.d/cups
# Create and/or fix up your CUPS init script:
test -f /etc/rc.d/init.d/cups -a -f /etc/rc.d/rc.cups && rm /etc/rc.d/rc.cups
test ! -d /etc/rc.d/init.d &&
install -m 755 ~/src/cups-1.4.3/cups.sh /etc/rc.d/rc.cups
# If you have an older version of Slackware that doesn't run rc.cups out of
# /etc/rc.d/rc.M on boot-up (grep rc.M for "rc.cups" to find out), or if you
# don't run Slackware (or another distro that uses SystemV init scripts) at
# all, add something to rc.local (or your distro's equivalent) to run
# "rc.cups start" on boot-up:
# if [ -x /etc/rc.d/rc.cups ]; then
# echo "Starting cupsd..."
# /etc/rc.d/rc.cups
# fi
# Run this to start CUPS (cupsd):
test -x /etc/rc.d/init.d/cups && /etc/rc.d/init.d/cups start
test -x /etc/rc.d/rc.cups && /etc/rc.d/rc.cups start
## To use the CUPS web interface, open up http://localhost:631/ in a browser.
## By default, cupsd only listens to 127.0.0.1:631 for connections. If you
## need to be able to get to the web interface from remote machines, add
## something like this to cupsd.conf and restart CUPS.
# Listen 1.2.3.4:631
## (1.2.3.4 is the machine's eth0 IP address).
## You'll also need to change lines like this:
# Allow @LOCAL
## to this:
# Allow localhost
# Allow 192.168.0.0/255.255.255.0
## If you don't want to use the web interface at all, see 'man lpadmin'.
## You can use it to add printers from the commandline.
##
## I used it to add a HP OfficeJet 7210 like this:
# lpadmin -p hp7210 -v socket://192.168.100.105:9100/ -P \
# /usr/share/cups/model/foomatic-ppds/HP/HP-OfficeJet_7200-hpijs.ppd.gz -E
# (end of cups server part)
# Read the CUPS documentation:
lynx http://www.cups.org/documentation.php