root / pykota / trunk / docs / installation.sgml @ 2117

Revision 2117, 39.2 kB (checked in by jalet, 19 years ago)

Improved documentation

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<!-- $Id$ -->
2
3<chapter>
4  <title id="installation">Installation</title>
5 
6  <para>Last modified on $Date$</para>
7 
8  <para>
9    Before being able to use <application>PyKota</application>, you have of course to
10    install it first. But before installing, you must carefully plan your installation.
11  </para>
12 
13  <para>
14    First you have to determine which machine will be the <application>PyKota</application>
15    <firstterm>Storage Server</firstterm>. The Storage Server is the host responsible
16    for keeping a centralized database of print usage for all your printers, users and groups.
17  </para>
18 
19  <para>
20    Then you have to list all the <firstterm>Print Servers</firstterm> for which
21    you plan to use <firstterm>print quota</firstterm> facilities.
22  </para>
23 
24  <para>
25    Finally you have to download <application>PyKota</application>'s latest version
26    or buy an official package, from
27    <ulink url="http://www.librelogiciel.com/software/">http://www.librelogiciel.com/software/</ulink>.
28    If you've just bought an official package, then as soon as you've receive it you
29    have to decompress and visit its archive, to do so just type the following commands :
30    <screen>
31jerome@nordine:~$ tar -zxf pykota-1.21_official.tar.gz   
32jerome@nordine:~$ cd pykota-1.21_official
33jerome@nordine:~/pykota-1.21_official$
34    </screen>
35  </para>
36 
37  <para>
38    You can see many files in this directory, the first ones to read are <filename>README</filename>,
39    then <filename>COPYING</filename> and <filename>LICENSE</filename>. They will give you
40    basic installation instructions and explain the licensing terms under which
41    <application>PyKota</application> is distributed. Of course they are also mostly
42    boring to read ! Detailed installation and operating instructions are defined
43    in the <filename>./docs</filename> directory, in the form of <acronym>SGML</acronym>
44    documentation in the <ulink url="http://www.docbook.org">DocBook</ulink> format.
45    You have to compile these files into readable documentation like the <acronym>HTML</acronym>
46    or <acronym>PDF</acronym> formats, or buy an official <application>PyKota</application> package
47    which already contains these compiled forms of the documentation. Of course you already
48    know this because that's what you are currently reading !
49  </para>
50 
51  <para>
52    Now we will see what has to be done on each of the servers we are planning to use.
53    <note>
54      <title>Note</title>
55      <para>
56        Of course, depending on the size of your network, you may very well
57        use the same machine as both a Print Server and a Storage Server.
58        This is especially the case if you've got only one server.
59      </para>
60    </note> 
61  </para>
62 
63  <sect1>
64    <title>Storage Server Installation</title>
65   
66    <para>
67      Depending on <application>PyKota</application>'s version number, different
68      types of storage backends may be supported, so we will see for each one of
69      them how to configure it.
70    </para>
71   
72    <sect2>
73      <title>PostgreSQL</title>
74     
75      <para>
76        <application>PostgreSQL</application> is an <firstterm>Object Relationnal DataBase
77        Management System</firstterm> distributed under a <firstterm>Free Software</firstterm>
78        license from the
79        <ulink url="http://www.postgresql.org">http://www.postgresql.org</ulink>
80        web site. It certainely is the free <acronym>RDBMS</acronym> which has the most advanced
81        features, and is widely used all over the world.
82      </para>
83     
84      <para>
85        To configure your Storage Server, you must have PostgreSQL already working.
86        The complete installation of <application>PostgreSQL</application> is not covered by
87        the present manual, please refer to your system's documentation or to
88        <ulink url="http://www.postgresql.org">http://www.postgresql.org</ulink> for
89        details.
90      </para>
91     
92      <para>
93        One thing you have to check, though, is that every Print Server on which you
94        want to install the print quota mechanism, must be able to connect to the
95        <application>PostgreSQL</application> server. In the default installation of
96        <application>PostgreSQL</application> this may not be the case for security reasons, except if both
97        servers are in fact the same machine. In any case, it is recommended that you
98        check the <filename>/etc/postgresql/pg_hba.conf</filename> file and modify it if
99        needed. This file is self documented and its modification is straightforward.
100        You also have to make sure that <application>PostgreSQL</application> accepts <acronym>TCP/IP</acronym> connections.
101        To do so you either have to launch it with the <option>-i</option> option or
102        modify the <filename>/etc/postgresql/postgresql.conf</filename> file, which is
103        self documented and easy to modify too. Allowing <acronym>TCP/IP</acronym> connections
104        is not necessary though if your Quota Storage Server and your Print Server are
105        the very same host.
106      </para> 
107     
108      <para>
109        Here's an excerpt from a <filename>pg_hba.conf</filename> file. This one rejects all
110        connections to PyKota's database excepted when made from the same host by <application>PostgreSQL</application> users
111        <literal>pykotauser</literal> or <literal>pykotaadmin</literal> with the correct password.
112<screen>        
113        local all    postgres                              ident sameuser
114        local all    all                                   reject
115        host  pykota pykotauser  127.0.0.1 255.255.255.255 crypt
116        host  pykota pykotaadmin 127.0.0.1 255.255.255.255 crypt
117        host  pykota all         127.0.0.1 255.255.255.255 reject
118</screen>
119     </para>
120     
121     <para>
122        Of course if your print server and your database servers have different <acronym>IP</acronym>
123        addresses, you have to replace the <literal>127.0.0.1</literal> address above with your print
124        server's <acronym>IP</acronym> address.
125        <tip>
126          <title>Tip</title>
127          <para>
128            Don't forget to restart <application>PostgreSQL</application> if you modify
129            any of its configuration files, in order for the changes to take effect.
130          </para>
131        </tip> 
132      </para>
133     
134      <para>
135        Be careful, you may be unable to connect from a Print Server to the <application>PostgreSQL</application>
136        server even if the configuration is correct. Sometimes your connections may be blocked by
137        one or more network firewalls along the route from one machine to the other. If this
138        is the case, then the best thing you can do is to ask your <firstterm>Network Administrator</firstterm>
139        to not filter the IP port used by <application>PostgreSQL</application>, which is
140        usually port <literal>5432/tcp</literal>.
141        <note>
142          <title>Note</title>
143          <para>
144            The TCP/IP network port used by PostgreSQL may be different. When in doubt, ask your
145            <firstterm>System Administrator</firstterm> for the correct value.
146          </para>
147        </note> 
148      </para>
149     
150      <para>
151        Now that your <application>PostgreSQL</application> server is up and running, and
152        is waiting for your connections, you have to create the Quota Storage DataBase.
153        To do so, you'll have to feed <application>PostgreSQL</application> with the
154        <filename>pykota-1.21/initscripts/postgresql/pykota-postgresql.sql</filename> file.
155        This file will create a Quota DataBase administrator in the <application>PostgreSQL</application> system, then create an empty
156        Quota DataBase and set some permissions on it. The Quota DataBase administrator
157        is the <application>PostgreSQL</application>'s user used to manage the Quota database.
158        The Quota DataBase Administrator is not present in the Quota Database
159        itself, he is only defined in <application>PostgreSQL</application> and don't
160        have to exist on any system, nor in the Quota DataBase. His default name
161        is <literal>pykotaadmin</literal>.
162        A Quota Storage read-only user is also created under the name of <literal>pykotauser</literal>.
163        This read-only user is used by <application>PyKota</application> to connect to the
164        Quota Storage when an user who is not a <application>PyKota</application> administrator
165        <footnote><para>a <application>PyKota</application> administrator is an user who can read the <filename>~pykota/pykotadmin.conf</filename> file.</para></footnote>
166        launches a pykota command. This prevents normal
167        users from being able to modify their own, or other users', quota information.
168        The database which will be created will be named <literal>pykota</literal> by default.
169        <note>
170          <title>Note</title>
171          <para>
172            You can choose other names if you want, just modify the
173            <filename>initscripts/postgresql/pykota-postgresql.sql</filename> file
174            accordingly, and report your changes into <application>PyKota</application>'s
175            configuration files.
176          </para>
177        </note> 
178      </para>
179     
180      <para>
181        To run this script, you can use the <command>psql</command> frontend to
182        <application>PostgreSQL</application>, but your priviledges must be sufficient
183        to be allowed to create users and databases. You can launch <command>psql</command>
184        as the <literal>postgres</literal> user which is <application>PostgreSQL</application>'s
185        default administrator, and connect to the default database named <literal>template1</literal>.
186        From a command line interpreter (i.e. shell), type the following commands :
187        <screen>
188jerome@nordine:~$ cd pykota-1.21_official/initscripts/postgresql
189jerome@nordine:~/pykota-1.21_official/initscripts$ psql -h localhost -U postgres template1
190Welcome to psql, the PostgreSQL interactive terminal.
191
192Type:  \copyright for distribution terms
193       \h for help with SQL commands
194       \? for help on internal slash commands
195       \g or terminate with semicolon to execute query
196       \q to quit
197
198template1=# \i pykota-postgresql.sql
199            ... a lot of output lines
200pykota=#       
201        </screen>
202        <note>
203          <title>Note</title>
204          <para>
205            If you use RPM or DEB packages, usually the
206            <filename>pykota-postgresql.sql</filename> file gets installed into the
207            <filename>/usr/share/pykota/postgresql</filename> directory, along
208            with a README file.
209          </para>
210        </note> 
211      </para>
212     
213      <para>
214        For security reasons, you may want to set passwords in
215        <application>PostgreSQL</application> for the
216        <literal>pykotaadmin</literal> and <literal>pykotauser</literal> users.
217        Otherwise any user able to connect to
218        <application>PostgreSQL</application> on your Quota Storage Server
219        could connect to the quota database, and either see it, or even modify it without problem.
220      </para>
221     
222      <para>
223        To do so, just type the following lines while still being at the <command>psql</command>
224        prompt (replace the password values by your own, and do the same for the <literal>pykotauser</literal> user) :
225        <screen>
226pykota=# ALTER USER pykotaadmin PASSWORD 'somepassword';
227ALTER USER
228pykota=# \q
229jerome@nordine:~/pykota-1.21_official/initscripts/postgresql$
230        </screen>
231      </para>
232     
233      <para>
234        The <literal>\q</literal> command above will quit the <command>psql</command>
235        program and return you to the shell's command line prompt.
236      </para>
237     
238      <para>
239        To improve security further, you could encrypt your database connections, or
240        take any other step as needed. Please refer to <application>PostgreSQL</application>'s
241        documentation for details.
242        <warning>
243          <title>Warning</title>
244          <para>
245            Defining passwords may not be sufficient if your database access rule is
246            set to <literal>trust</literal> in the <filename>/etc/postgresql/pg_hba.conf</filename>.
247            Again, please refer to <application>PostgreSQL</application>'s documentation
248            for details. Also, passwords will fly unencrypted over the network by default,
249            so be sure to take any necessary step to secure your database server from
250            unauthorized use. This has nothing to do with <application>PyKota</application>
251            though, it is just a general rule to keep in mind.
252          </para>
253        </warning> 
254      </para>
255     
256      <para>
257        If no error occured, then your Quota DataBase is ready to be used.
258        Now you can let the Quota Storage Server alone, the remaining work
259        will have to be done on each one of the print servers which will
260        use this particular Quota Storage Server.
261        <tip>
262          <title>Tip</title>
263          <para>
264            If an error occured, maybe your PostgreSQL version is too old, or
265            an unexpected problem (like a bug) happened. Please contact us via email so that we
266            can try to fix the problem. Thanks in advance.
267          </para>
268        </tip> 
269      </para>
270     
271    </sect2> 
272   
273    <sect2>
274      <title>LDAP</title>
275     
276      <para>
277        Any <acronym>LDAP</acronym> server, and particularly <application>OpenLDAP</application>, can be used
278        as a Quota Storage Backend.
279        Some other LDAP servers can be used, but this is currently untested in production.
280      </para>
281     
282      <para>
283        <application>OpenLDAP</application> is a Lightweight Directory Access Protocol server
284        implementation published as Free Software.
285        You can download it from <ulink url="http://www.openldap.org">http://www.openldap.org</ulink>.
286      </para>
287     
288      <para>
289        To use <application>OpenLDAP</application> as your Quota Storage Backend, you have to copy the
290        <filename>pykota/initscripts/ldap/pykota.schema</filename> into <application>OpenLDAP</application>'s
291        schemas directory.
292        Under Debian GNU/Linux, this is something like :
293        <screen>       
294$ cp pykota.schema /etc/ldap/schema
295        </screen>
296        <note>
297          <title>Note</title>
298          <para>
299            If you use RPM or DEB packages, usually the
300            <filename>pykota.schema</filename> file gets installed into the
301            <filename>/usr/share/pykota/ldap</filename> directory, along
302            with a README file.
303          </para>
304        </note> 
305     </para>
306     <para>   
307       Then edit <filename>/etc/ldap/slapd.conf</filename> and add a line to   
308       include the PyKota schema. You should have something
309       like :
310       <screen>   
311# Schema and objectClass definitions
312include         /etc/ldap/schema/core.schema
313include         /etc/ldap/schema/cosine.schema
314include         /etc/ldap/schema/nis.schema
315include         /etc/ldap/schema/inetorgperson.schema
316include         /etc/ldap/schema/pykota.schema
317        </screen>       
318      </para>
319     
320      <para>
321        While this is not mandatory, it is recommended that you setup
322        some indexes for some often accessed PyKota attributes.
323        Here are the minimal indexes
324        lines you may want to put in <filename>slapd.conf</filename> :
325        <screen>
326# Indexes for PyKota
327index pykotaUserName pres,eq,sub
328index pykotaGroupName pres,eq,sub
329index pykotaPrinterName pres,eq,sub
330index pykotaLastJobIdent eq
331        </screen>
332      </para>
333     
334      <para>
335        Now you must ensure that the DNs you'll use to bind to   
336        your OpenLDAP server don't have search queries size limits,
337        which gives for example (OpenLDAP 2.1.x or above) :
338       
339<screen>        
340# No Limits for PyKota's administrator and read-only user
341limits dn="cn=RWadmin,dc=example,dc=com" size.soft=-1 size.hard=soft
342limits dn="cn=ROadmin,dc=example,dc=com" size.soft=-1 size.hard=soft
343</screen>       
344
345        Where RWadmin and ROadmin are the usernames used to bind to your
346        OpenLDAP server within PyKota, respectively in ReadWrite mode
347        (as set in pykotadmin.conf) and in ReadOnly mode (as set in pykota.conf).
348      </para>
349     
350      <para>
351        Finally, restart the <application>OpenLDAP</application> server :   
352        <screen>   
353$ /etc/init.d/slapd restart
354        </screen>
355      </para>
356     
357      <para>
358        With an <acronym>LDAP</acronym> backend, PyKota will need some branches
359        in your <acronym>LDAP</acronym> directory to put its own datas.
360        You can configure PyKota to either attach its datas to your existing
361        users and groups, or to put them in their own <literal>ou</literal>.
362        But some <literal>ou</literal>s dedicated to PyKota are needed in any case,
363        so the best bet may be to put all PyKota's datas below an <literal>ou=PyKota</literal>
364        branch. While this will separate these datas from your existing users and groups
365        entries, this may ease the maintainance.
366      </para>
367     
368      <para>
369        PyKota needs at least an <literal>ou</literal> for printers, for users quotas, for
370        groups quotas, for print jobs, and for pointers to the last job of each printer.
371        In the future, this last <literal>ou</literal> may disappear as its content
372        will probably be attached to each printer.
373      </para>
374     
375      <para>
376        Actually PyKota doesn't create these <literal>ou</literal>s for you, because it's
377        difficult to guess what is the best configuration for you. So you have to
378        create them by yourself, either directly with a text editor and the
379        <command>ldapadd</command> command, or with some specialized tool
380        like <command>gq</command>. You can look at the <filename>initscripts/ldap/pykota-sample.ldif</filename>
381        file to see what minimal branches are necessary.
382        <note>
383          <title>Note</title>
384          <para>
385            If you use RPM or DEB packages, usually the
386            <filename>pykota-sample.ldif</filename> file gets installed into the
387            <filename>/usr/share/pykota/ldap</filename> directory, along
388            with a README file.
389          </para>
390        </note> 
391      </para>
392     
393      <para>
394        If no error occured, then your Quota DataBase is ready to be used.
395        Now you can let the Quota Storage Server alone, the remaining work
396        will have to be done on each one of the print servers which will
397        use this particular Quota Storage Server.
398        <tip>
399          <title>Tip</title>
400          <para>
401            If an error occured, maybe your OpenLDAP version is too old, or
402            an unexpected problem (like a bug) happened. Please contact us via email so that we
403            can try to fix the problem. Thanks in advance.
404          </para>
405        </tip> 
406      </para>
407    </sect2> 
408   
409    <sect2>
410      <title>MySQL</title>
411     
412      <para>
413        A <application>MySQL</application> Storage Backend is planned, but it actually
414        doesn't exist.
415      </para>
416    </sect2> 
417   
418    <sect2>
419      <title>Berkeley DB</title>
420     
421      <para>
422        A <application>Berkeley DB</application> Storage Backend is planned, but it actually
423        doesn't exist. It seems that remote storage won't be possible with such a backend,
424        so in other terms this means that you will have a different quota database on
425        each print server. This may still prove to be useful for small configurations.
426      </para>
427    </sect2> 
428  </sect1> 
429 
430  <sect1>
431    <title>Print Server Installation</title>
432   
433    <para>
434      For each Print Server on which you plan to implement the print quota
435      mechanism, you have, of course, to have an already working printing environment.
436      Currently <application>PyKota</application> works with either
437      <ulink url="http://www.cups.org"><application>CUPS</application></ulink>
438      or <ulink url="http://lprng.sourceforge.net"><application>LPRng</application></ulink>,
439      but more printing systems may be added in the future.
440    </para>
441   
442    <para>
443      Here's the list of software you have to install on each Print Server, version numbers
444      are given as an indication of which was successfully tested, but older versions may
445      work too.
446      <itemizedlist>
447        <listitem>
448          <para>
449            <application>CUPS</application> version 1.1 or above, or <application>LPRng</application>
450            version 3.8.27 or above (it probably works with older versions but this is untested).
451            You can download them from <ulink url="http://www.cups.org">http://www.cups.org</ulink>
452            or <ulink url="http://lprng.sourceforge.net">http://lprng.sourceforge.net</ulink>
453          </para>
454        </listitem> 
455        <listitem>
456          <para>
457            Python version 2.1 or above.
458            You can download it from <ulink url="http://www.python.org">http://www.python.org</ulink>.
459          </para>
460        </listitem> 
461        <listitem>
462          <para>
463            Quota Storage client libraries, depending on your Quota Storage Backend :
464            <itemizedlist>
465              <listitem>
466                <para>
467                  PostgreSQL backend :
468                  <itemizedlist>
469                    <listitem>
470                      <para>
471                        <application>PostgreSQL</application> client libraries. They must match the <application>PostgreSQL</application>
472                        version used on your Quota Storage Server.
473                      </para>
474                    </listitem> 
475                    <listitem>
476                      <para>
477                        The <application>PygreSQL</application> python module.
478                        It must have been compiled against the same
479                        <application>PostgreSQL</application> client libraries.
480                        <application>PygreSQL</application> is normally included in
481                        <application>PostgreSQL</application>, but you may want to
482                        download it from <ulink url="http://www.pygresql.org">http://www.pygresql.org</ulink>
483                      </para>
484                    </listitem> 
485                  </itemizedlist> 
486                </para>
487              </listitem> 
488              <listitem>
489                <para>
490                  OpenLDAP backend :
491                  <itemizedlist>
492                    <listitem>
493                      <para>
494                        <application>OpenLDAP</application> client libraries. They must match
495                        the <application>OpenLDAP</application> version used on your Quota Storage Server.
496                      </para>
497                    </listitem> 
498                    <listitem>
499                      <para>
500                        The <application>Python-LDAP</application> python module.
501                        It must have been compiled against the same
502                        <application>OpenLDAP</application> client libraries.
503                        You may download this module from <ulink url="http://python-ldap.sourceforge.net">http://python-ldap.sourceforge.net</ulink>
504                      </para>
505                    </listitem> 
506                  </itemizedlist>
507                </para>
508              </listitem>
509              <listitem>
510                <para>
511                  MySQL backend : TODO
512                </para>
513              </listitem>
514              <listitem>
515                <para>
516                  Berkeley DB backend : TODO
517                </para>
518              </listitem>
519            </itemizedlist> 
520          </para>
521        </listitem> 
522        <listitem>
523          <para>
524            <application>ucd-snmp</application> or <application>net-snmp</application> tools, version 4.2.5 or above. You only need
525            the <command>snmpget</command> command.
526            You can download this software from <ulink url="http://www.sourceforge.net/projects/net-snmp/">http://www.sourceforge.net/projects/net-snmp/</ulink>.
527            You only need this if you plan to query your printers for their internal page counter via SNMP.
528          </para>
529        </listitem> 
530        <listitem>
531          <para>
532            <application>netatalk</application> version 1.6.1 or above. You only need
533            the <command>pap</command> command.
534            You can download this software from <ulink url="http://netatalk.sourceforge.net/">http://netatalk.sourceforge.net/</ulink>.
535            You only need this if you plan to query your printers for their internal page counter via AppleTalk.
536          </para>
537        </listitem> 
538        <listitem>
539          <para>
540            eGenix' mxDateTime Python module version 2.0.3 or above. It must match your default Python version.
541            You can download it from <ulink url="http://www.egenix.com">http://www.egenix.com</ulink>.
542          </para>
543        </listitem> 
544        <listitem>
545          <para>
546            The Python acccelerator <application>Psyco</application>. It must match your default Python version.
547            You can download it from <ulink url="http://psyco.sourceforge.net">http://psyco.sourceforge.net</ulink>.
548            You only need this if you run on the <literal>x86</literal> architecture because
549            <application>Psyco</application> doesn't yet exist on other architectures.
550          </para>
551        </listitem> 
552        <listitem>
553          <para>
554            The <application>pysnmp</application> Python module version 3.4.2 or 3.4.3 exclusively.
555            You can download it from <ulink url="http://pysnmp.sourceforge.net">http://pysnmp.sourceforge.net</ulink>.
556          </para>
557        </listitem> 
558        <listitem>
559          <para>
560            The <application>JAXML</application> Python module.
561            You can download it from <ulink url="http://www.librelogiciel.com/software/">http://www.librelogiciel.com/software/</ulink>.
562          </para>
563        </listitem> 
564        <listitem>
565          <para>
566            The <application>ReportLab</application> Toolkit Python module.
567            You can download it from <ulink url="http://www.reportlab.org">http://www.reportlab.org</ulink>.
568          </para>
569        </listitem> 
570        <listitem>
571          <para>
572            The <application>PyOSD</application> Python module.
573            You can download it from <ulink url="http://repose.cx/pyosd/">http://repose.cx/pyosd/</ulink>.
574          </para>
575        </listitem> 
576      </itemizedlist> 
577    </para>
578   
579    <para>
580      Instead of downloading all these programs' sources and compiling them, which really
581      is a boring task considering that many software are needed, you may prefer to look
582      into the packages included with your GNU/Linux distribution of choice (if you use
583      this operating system of course). Most, if not all, GNU/Linux distributions include
584      all the software mentionned above, in the form of packages which are easier to
585      install than sources tarballs. This is probably the same for the many *BSD
586      distributions.
587    </para>
588   
589    <para>
590       You can check that all needed software is installed by launching the <filename>checkdeps.py</filename>
591       command :
592      <screen>     
593$ python checkdeps.py     
594      </screen>
595    </para>
596   
597    <para>
598      Once all these software are installed, installing PyKota itself is a breeze.
599      PyKota being written entirely in the Python language, which is interpreted,
600      there's no need to compile anything. You just have to execute the installation
601      script :
602      <screen>     
603$ python setup.py install     
604      </screen>
605    </para>
606   
607    <para>
608      The setup script will automatically create the
609      <filename>/usr/share/pykota/conf</filename> directory and put the sample
610      configuration files <filename>conf/pykota.conf.sample</filename> and
611      <filename>conf/pykotadmin.conf.sample</filename> there, along with
612      a <filename>README</filename> file explaining their purpose.
613    </para>
614   
615    <para>
616      Now you have to create a <literal>pykota</literal> system user and group. The <application>PyKota</application>
617      software will automatically search its configuration files in user <literal>pykota</literal>'s
618      home directory. For example we could create the user and group, and set <filename>/etc/pykota</filename>
619      as the home directory, but any other home directory will do :
620<screen>      
621    adduser --system --group --home /etc/pykota --gecos PyKota pykota
622</screen>
623    </para>
624   
625    <para>
626      You now have to copy the sample configuration files into the <filename>~pykota</filename>
627      directory, under the respective names <filename>pykota.conf</filename> and
628      <filename>pykotadmin.conf</filename>. Once copied there, you just
629      have to modify these files to adapt them to your own setup.
630      These files are heavily commented, so you should have no problem.
631      Also their format is quite common, because it's the one used by
632      <application>Samba</application> for example, or by <literal>.ini</literal>
633      files under <application>MS-Windows</application>, so you may already
634      be familiar with this syntax.
635      In a future release, this documentation will include the complete
636      reference for all configuration fields available. Keep in mind that
637      PyKota can be really heavily customized, and can delegate some work
638      to any external command of your choice.
639    </para>
640   
641    <para>
642      Please create a backup copy of the <filename>~pykota</filename>
643      directory before modifying a working installation.
644    </para>
645   
646    <para>
647      PyKota features some interesting possibilities which allow you to
648      define options either globally so that they apply to all printers,
649      or on a per printer basis. Please see the sample configuration files
650      to see what I mean. In the simplest form, only a global section is
651      needed. In more complex configurations, you will have to create
652      one section per printer. Each section in the configuration files
653      begins with a name between square brackets <literal>[]</literal>.
654      The name to use to define a particular printer section is the name
655      of the print queue on which you want to set quotas.
656    </para>
657   
658    <para>
659      After you have modified PyKota's configuration files, you have to
660      double check their permissions, otherwise your installation may be
661      insecure or may not work at all.
662      The main configuration file <filename>~pykota/pykota.conf</filename>
663      doesn't contain much sensitive information, so it can be made
664      readable by anyone. If normal users read this file, at best they
665      will learn the username and optional password of the read-only
666      database user, so they won't be allowed to do any harm.
667      On the other hand, the <filename>~pykota/pykotadmin.conf</filename>
668      file contains the read-write user's identity and password. You must then
669      ensure that no normal user can read this file. It should only be readable
670      by the <literal>root</literal> user, which is always the case, and by
671      <application>PyKota</application> administrators. In addition, <application>LPRng</application>
672      users, or users for which <application>CUPS</application> doesn't run as user <literal>root</literal> will
673      have to ensure that the user their printing system is run as
674      can read both of these files. An easy way to do so is to put the <literal>lp</literal> user
675      (for example) into the <literal>pykota</literal> system group, then
676      to give the correct permissions to <application>PyKota</application>'s configuration files :
677      <screen>
678$ chown pykota.pykota ~pykota/pykota.conf     
679$ chmod 644 ~pykota/pykota.conf     
680$ chown pykota.pykota ~pykota/pykotadmin.conf     
681$ chmod 640 ~pykota/pykotadmin.conf     
682      </screen>
683     
684      <warning>
685        <title>Warning</title>
686        <para>
687          All the users allowed to read the <filename>~pykota/pykotadmin.conf</filename>
688          are considered to be <application>PyKota</application> administrators. So be
689          careful with these files permissions.
690        </para>
691      </warning>
692    </para>
693   
694   
695    <para>
696      Now depending on your printing system, the configuration to do is particular.
697      We will now see how to plug PyKota into your printing system.
698    </para>
699   
700    <sect2>
701      <title>With CUPS</title>
702     
703      <para>
704        From version 1.16alpha7 on, configuring PyKota to integrate
705        within CUPS is more than easy.
706      </para>
707     
708      <para>
709        You just have to create a symbolic link to the <filename>cupspykota</filename>
710        command in CUPS' backend directory :
711        <screen>       
712$ cd /usr/lib/cups/backend       
713$ ln -s /usr/share/pykota/cupspykota cupspykota
714        </screen>
715      </para>
716     
717      <para>
718        You have to restart <application>CUPS</application> for this modification to
719        take effect :
720        <screen>
721$ /etc/init.d/cupsys restart       
722        </screen>
723      </para>
724     
725      <para>
726        Now point your web browser to CUPS configuration page, usually at
727        <ulink url="http://localhost:631">http://localhost:631</ulink> on
728        your print server.
729      </para>
730     
731      <para>
732        Then when creating new printers or reconfiguring existing ones, just
733        choose devices which are <literal>PyKota managed</literal>
734        <footnote>
735          <para>
736            Debian 3.0 Woody is known to have problems : CUPS 1.1.14 doesn't automatically
737            detect <literal>PyKota managed</literal> devices. So you have to manually
738            modify CUPS' <filename>printers.conf</filename> file as explained in
739            PyKota's toplevel <filename>README</filename> file.
740          </para>
741        </footnote>
742        instead of
743        normal devices. You've got one <literal>PyKota managed</literal> device
744        for each regular device available from CUPS, so just choose the appropriate
745        one.
746      </para>
747     
748      <para>
749        Repeat the above procedure for each print queue on which you want to use
750        PyKota. That's all !
751      </para>
752     
753      <sect3>
754        <title>Troubleshooting</title>
755        <para>
756          In case of problem, the simplest way to solve it is currently
757          to ask on PyKota's mailing list, describing the symptoms, as
758          well as the hardware and software you use.
759          In a future release of this document, a section dedicated to
760          Frequently Asked Questions will be included.
761        </para>
762       
763        <para>
764          You can now also ask us questions on IRC :
765          <screen>
766/server irc.freenode.net         
767/join #pykota
768          </screen>
769        </para> 
770      </sect3> 
771     
772    </sect2>
773   
774    <sect2>
775      <title>With LPRng</title>
776     
777      <para>
778        For each printer on which you want to use <application>PyKota</application>, just modify the printer's
779        entry in <filename>/etc/printcap</filename> : you have to add
780        the three following lines :
781       
782<screen>        
783  :achk=true:\
784  :as=/usr/share/pykota/lprngpykota:\
785  :ae=/usr/share/pykota/lprngpykota:\
786</screen>         
787
788        This will tell <application>LPRng</application> to activate accounting, and use the <filename>lprngpykota</filename>
789        accounting filter both at the start and at the end of printing.
790      </para>
791     
792     
793      <para>
794        Repeat the above procedure for each print queue on which you want to use
795        PyKota. That's all !
796      </para>
797     
798      <para>
799        When all modifications are done, just save the <filename>/etc/printcap</filename> file
800        and restart <application>LPRng</application> for the changes to take effect :
801        <screen>
802$ /etc/init.d/lprng restart       
803        </screen>
804      </para>
805     
806      <sect3>
807        <title>Troubleshooting</title>
808        <para>
809          In case of problem, the simplest way to solve it is currently
810          to ask on PyKota's mailing list, describing the symptoms, as
811          well as the hardware and software you use.
812          In a future release of this document, a section dedicated to
813          Frequently Asked Questions will be included.
814        </para>
815       
816        <para>
817          You can now also ask us questions on IRC :
818          <screen>
819/server irc.freenode.net         
820/join #pykota
821          </screen>
822        </para>
823      </sect3> 
824     
825    </sect2>
826   
827  </sect1> 
828</chapter>
829
830<!--
831
832$Log$
833Revision 1.32  2005/02/28 23:17:40  jalet
834Improved documentation
835
836Revision 1.31  2005/02/28 22:29:25  jalet
837More complete PostgreSQL configuration.
838Changed all occurences of /etc/pykota/ to ~pykota/
839
840Revision 1.30  2005/02/28 00:07:37  jalet
841Added pkmail's doc.
842Used the <command> tag instead of <application> for commands.
843Fixed some typos.
844Added some missing command line options in the commands reference.
845
846Revision 1.29  2004/11/10 22:35:23  jalet
847Changes to the installation documentation
848
849Revision 1.28  2004/10/06 10:03:16  jalet
850Improved documentation
851
852Revision 1.27  2004/07/21 09:39:03  jalet
853LPRng documentation
854
855Revision 1.26  2004/07/16 12:22:46  jalet
856LPRng support early version
857
858Revision 1.25  2004/05/25 09:49:53  jalet
859The old pykota filter has been removed. LPRng support disabled for now.
860
861Revision 1.24  2004/02/13 08:46:32  jalet
862Fixed documentation wrt installation paths changed
863
864Revision 1.23  2004/01/30 17:13:56  jalet
8651.17
866
867Revision 1.22  2003/11/15 14:59:53  jalet
868Documentation wrt the new CUPS backend.
869
870Revision 1.21  2003/10/14 20:26:53  jalet
871Better documentation.
8721.15 is out !
873
874Revision 1.20  2003/07/25 13:20:32  jalet
875Typo which wasn't
876
877Revision 1.19  2003/07/25 13:18:44  jalet
878Typos
879
880Revision 1.18  2003/07/25 10:41:29  jalet
881Better documentation.
882pykotme now displays the current user's account balance.
883Some test changed in ldap module.
884
885Revision 1.17  2003/06/30 21:44:18  jalet
8861.09 is out !
887
888Revision 1.16  2003/06/24 21:37:05  jalet
889Minor changes
890
891Revision 1.15  2003/06/10 16:37:54  jalet
892Deletion of the second user which is not needed anymore.
893Added a debug configuration field in /etc/pykota.conf
894All queries can now be sent to the logger in debug mode, this will
895greatly help improve performance when time for this will come.
896
897Revision 1.14  2003/06/05 07:12:29  jalet
898Reorganization of directories
899
900Revision 1.13  2003/04/24 21:09:47  jalet
901Documentation slightly improved.
902
903Revision 1.12  2003/04/17 21:33:16  jalet
904Version 1.03 is out.
905
906Revision 1.11  2003/03/25 09:32:06  jalet
907Improved documentation.
908
909Revision 1.10  2003/03/23 17:59:56  jalet
910Clarify a point.
911
912Revision 1.9  2003/03/23 17:57:20  jalet
913Deleted a repetition.
914
915Revision 1.8  2003/03/22 15:34:50  jalet
916More complete installation documentation.
917
918Revision 1.7  2003/03/22 14:26:45  jalet
919Download instructions added.
920
921Revision 1.6  2003/03/22 14:06:02  jalet
922Quota Storage Server installation is OK for PostgreSQL.
923
924Revision 1.5  2003/03/22 13:11:33  jalet
925The port on which the Quota Storage Sever is listening can now
926be set in the configuration file (see sample).
927Better error handling if PygreSQL is not installed.
928Improved documentation.
929Version number changed to 1.02alpha
930
931Revision 1.4  2003/03/22 07:20:38  jalet
932More information wrt PostgreSQL tcp/ip configuration.
933
934Revision 1.3  2003/03/18 22:18:25  jalet
935The documentation will only be a sequence of chapters in a single part, not
936multiple parts each including chapters.
937
938Revision 1.2  2003/03/18 22:10:54  jalet
939Documentation improvements.
940
941Revision 1.1  2003/02/08 00:03:35  jalet
942Documentation skeleton added
943
944
945-->
Note: See TracBrowser for help on using the browser.