User Tools

Site Tools


user:jbrant:print_server

My Printer server project.

First I started by building a Debian server: This was done using my documentation from last semester, found at http://lab46.corning-cc.edu/user/jbrant/csit1320/project2.

After the server was built I then added typescript and configured it to document my change so that I would have reference material for the paper.

Step 1 Installing Cups:
apt-get install cupsys cupsys-driver-gutenprint foomatic-db-gutenprint foomatcic-ffilters fontconfig libtiff4 libfreeype6type6

With this the following packages where added:

avahi-daemon avahi-utils bind9-host cups cups-client cups-common cups-driver-gutenprint dbus dbus-x11 defoma file fontconfig-config foomatic-db foomatic-db-engine ghostscript ghostscript-x gs-common gs-esp gsfonts ijsgutenprint libavahi-client3 libavahi-common-data libavahi-common3 libavahi-compat-libdnssd1 libavahi-core5 libbind9-50 libcap2 libcups2 libcupsimage2 libdaemon0 libdb4.5 libdbus-1-3 libdns55 libexpat1 libfontconfig1 libgs8 libgutenprint2 libice6 libijs-0.35 libisc52 libisccc50 libisccfg50 libjpeg62 libldap-2.4-2 liblwres50 libmagic1 libnss-mdns libpaper-utils libpaper1 libpng12-0 libpoppler3 libslp1 libsm6 libsqlite3-0 libtalloc1 libwbclient0 libxml2 libxt6 mime-support openssl openssl-blacklist perl perl-modules poppler-utils psfontmgr python python-minimal python2.5 python2.5-minimal samba-common sgml-base smbclient ssl-cert ttf-dejavu ttf-dejavu-core ttf-dejavu-extra ucf xml-core

After all the packages where installed I configured the /etc/cups/cupsd.conf file:
This was done by making a back up copy of the conf file called cupsd.conf.bak.
Then editing the original file:
Making changes to the sections shown below.
view /etc/cups/cupsd.conf

# Only listen for connections from the local machine.
Listen localhost:631
Listen 10.80.1.18
Listen /var/run/cups/cups.sock


# Restrict access to the server...
<Location />
  Order allow,deny
Allow localhost
Allow 10.80.1.*
Allow 10.80.2.*
Allow 10.80.3.*
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow localhost
  Allow 10.80.1.18
  allow 10.80.2.*
  allow 10.80.3.*
</Location> 

# Restrict access to configuration files...
<Location /admin/conf>
#  AuthType Default
  Require user @SYSTEM
  Order allow,deny
Allow localhost
Allow 10.80.1.18
</Location> 
 

After getting the config file setup we need to install a web server to host the cups web page.
wget http://download.lighttpd.net/lighttpd/lighttpd-1.4.28.tar.gz

Next unpack the file:
tar -xvvzf lighttpd-1.4.27.tar.gz

Then I needed a library:
apt-get install libpcre3

The following extra packages will be installed:
binutils cpp cpp-4.3 gcc gcc-4.3 libc6-dev libgmp3c2 libgomp1 libmpfr1ldbl libmysqlclient15off linux-libc-dev zlib1g-dev

After getting everything installed I need to configure the web browser There are only 2 lines that needed to be changed they are:

## bind to port (default: 80) server.port =80
## bind to localhost only (default: all interfaces) server.bind = “localhost”

Before we bring up the services we need to install some print fonts:
aptitude search fooinstall foomatic-db-gutenprint foomatic-filters-ppds

With this the following NEW packages were installed:

cupsddk{a} cupsddk-drivers{a} foomatic-filters-ppds gconf2{a} gconf2-common{a}
gksu{a} gnome-keyring{a} hicolor-icon-theme{a} hpijs{a} hpijs-ppds{a} hplip{a}
hplip-data{a} hplip-gui{a} libatk1.0-0{a} libatk1.0-data{a} libaudio2{a}
libcairo2{a} libdatrie0{a} libdbus-glib-1-2{a} libdirectfb-1.0-0{a} libdrm2{a}
libexif12{a} libffi5{a} libfontenc1{a} libgconf2-4{a} libgksu2-0{a}
libgl1-mesa-glx{a} libglade2-0{a} libglib2.0-0{a} libglib2.0-data{a}
libglu1-mesa{a} libgnome-keyring0{a} libgphoto2-2{a} libgphoto2-port0{a}
lptitude foomatic-filters-ppds ibgtk2.0-0{a} libgtk2.0-bin{a} libgtk2.0-common{a} 
libgtop2-7{a} libgtop2-common{a} libhal-storage1{a} libhal1{a} libice6{a} libidl0{a}
libieee1284-3{a} liblcms1{a} libltdl3{a} libmng1{a} liborbit2{a}
libpam-gnome-keyring{a} libpango1.0-0{a} libpango1.0-common{a} libperl5.10{a}
libpixman-1-0{a} libqt3-mt{a} libqt4-assistant{a} libqt4-dbus{a} libqt4-designer{a}
libqt4-help{a} libqt4-network{a} libqt4-qt3support{a} libqt4-script{a}
libqt4-sql{a} libqt4-sql-mysql{a} libqt4-svg{a} libqt4-test{a} libqt4-webkit{a}
libqt4-xml{a} libqt4-xmlpatterns{a} libqtcore4{a} libqtgui4{a} libsane{a}
libsane-extras{a} libsensors3{a} libsm6{a} libsnmp-base{a} libsnmp15{a}
libstartup-notification0{a} libsysfs2{a} libthai-data{a} libthai0{a} libts-0.0-0{a}
libxcb-render-util0{a} libxcb-render0{a} libxcomposite1{a} libxcursor1{a}
libxdamage1{a} libxfixes3{a} libxfont1{a} libxft2{a} libxi6{a} libxinerama1{a}
libxmu6{a} libxrandr2{a} libxrender1{a} libxt6{a} libxxf86vm1{a} python-central{a}
python-dbus{a} python-elementtree{a} python-gobject{a} python-imaging{a}
python-qt3{a} python-qt4{a} python-qt4-common{a} python-reportlab{a} python-sip4{a}
python-support{a} qt4-qtconfig{a} sane-utils{a} ttf-bitstream-vera{a} ttf-dustin{a}
x-ttcidfont-conf{a} xfonts-encodings{a} xfonts-utils{a}

Now we are ready to bring the print services up

First bring up the web server:
/etc/init.d/lighttpd start

Next bring up the printer server:
/etc/init.d/cups start

After getting the print server up and running we need to bring up the web page for the print server:

http:printer.lair.lan:631

Once the print server webpage comes up select:
Administration
Then select:
Find New Printers <This will search for any available printers on the network.>

Next select the printer you want to add.
Give it a name and then select the driver for the printer.
There will be a list of drivers find the closed match.
In order to get command line printing to working you need to edit a file called /etc/cups/printers.conf :
vi /etc/cups/printers.conf

# Printer configuration file for CUPS v1.3.8
 # Written by cupsd on 2010-11-05 14:26
 <Printer lair_cp1518ni> Info HP Color LaserJet CP1518ni 
Location Lair DeviceURI socket:10.80.1.50 State Idle 
StateTime 1288981329
Accepting Yes 
Shared Yes 
JobSheets none none 
QuotaPeriod 0
 PageLimit 0 
KLimit 0 
OpPolicy default 
ErrorPolicy stop-printer
 </Printer>

Finally we need to do some testing
lpoptions -d printer <where printer is the name of the printer>
login to you favorite browser and find page you want to print and then select print.

The printer should print

to print from line command just do: lp file-name 'This will use the default printer'

user/jbrant/print_server.txt · Last modified: 2010/11/29 10:28 by jbrant