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

Revision 2116, 37.1 kB (checked in by jalet, 19 years ago)

More complete PostgreSQL configuration.
Changed all occurences of /etc/pykota/ to ~pykota/

  • 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. Also if <application>PyKota</application>'s configuration
242        file <filename>~pykota/pykotadmin.conf</filename> is readable by anyone with access on your file system,
243        a local user could create some script to modify his own print quota.
244        <warning>
245          <title>Warning</title>
246          <para>
247            Defining passwords may not be sufficient if your database access rule is
248            set to <literal>trust</literal> in the <filename>/etc/postgresql/pg_hba.conf</filename>.
249            Again, please refer to <application>PostgreSQL</application>'s documentation
250            for details. Also, passwords will fly unencrypted over the network by default,
251            so be sure to take any necessary step to secure your database server from
252            unauthorized use. This has nothing to do with <application>PyKota</application>
253            though, it is just a general rule to keep in mind.
254          </para>
255        </warning> 
256      </para>
257     
258      <para>
259        If no error occured, then your Quota DataBase is ready to be used.
260        Now you can let the Quota Storage Server alone, the remaining work
261        will have to be done on each one of the print servers which will
262        use this particular Quota Storage Server.
263        <tip>
264          <title>Tip</title>
265          <para>
266            If an error occured, maybe your PostgreSQL version is too old, or
267            an unexpected problem (like a bug) happened. Please contact us via email so that we
268            can try to solve the problem. Thanks in advance.
269          </para>
270        </tip> 
271      </para>
272     
273    </sect2> 
274   
275    <sect2>
276      <title>LDAP</title>
277     
278      <para>
279        Any <acronym>LDAP</acronym> server, and particularly <application>OpenLDAP</application>, can be used
280        as a Quota Storage Backend.
281        Some other LDAP servers can be used, but this is currently untested in production.
282      </para>
283     
284      <para>
285        <application>OpenLDAP</application> is a Lightweight Directory Access Protocol server
286        implementation published as Free Software.
287        You can download it from <ulink url="http://www.openldap.org">http://www.openldap.org</ulink>.
288      </para>
289     
290      <para>
291        To use <application>OpenLDAP</application> as your Quota Storage Backend, you have to copy the
292        <filename>pykota/initscripts/ldap/pykota.schema</filename> in <application>OpenLDAP</application>'s
293        schemas directory.
294        Under Debian GNU/Linux, this is something like :
295        <screen>       
296$ cp pykota.schema /etc/ldap/schema
297        </screen>
298        <note>
299          <title>Note</title>
300          <para>
301            If you use RPM or DEB packages, usually the
302            <filename>pykota.schema</filename> file gets installed into the
303            <filename>/usr/share/pykota/ldap</filename> directory, along
304            with a README file.
305          </para>
306        </note> 
307     </para>
308     <para>   
309       Then edit <filename>/etc/ldap/slapd.conf</filename> and add a line to   
310       include the PyKota schema. You should have something
311       like :
312       <screen>   
313# Schema and objectClass definitions
314include         /etc/ldap/schema/core.schema
315include         /etc/ldap/schema/cosine.schema
316include         /etc/ldap/schema/nis.schema
317include         /etc/ldap/schema/inetorgperson.schema
318include         /etc/ldap/schema/pykota.schema
319        </screen>       
320      </para>
321     
322      <para>
323        While this is not mandatory, it is recommended that you setup
324        some indexes for some often accessed PyKota attributes.
325        Here are the minimal indexes
326        lines you may want to put in <filename>slapd.conf</filename> :
327        <screen>
328# Indexes for PyKota
329index pykotaUserName pres,eq,sub
330index pykotaGroupName pres,eq,sub
331index pykotaPrinterName pres,eq,sub
332index pykotaLastJobIdent eq
333        </screen>
334      </para>
335     
336      <para>
337        Now you must ensure that the DNs you'll use to bind to   
338        your OpenLDAP server don't have search queries size limits,
339        which gives for example (OpenLDAP 2.1.x or above) :
340       
341<screen>        
342# No Limits for PyKota's administrator and read-only user
343limits dn="cn=RWadmin,dc=example,dc=com" size.soft=-1 size.hard=soft
344limits dn="cn=ROadmin,dc=example,dc=com" size.soft=-1 size.hard=soft
345</screen>       
346
347        Where RWadmin and ROadmin are the usernames used to bind to your
348        OpenLDAP server within PyKota, respectively in ReadWrite mode
349        (as set in pykotadmin.conf) and in ReadOnly mode (as set in pykota.conf).
350      </para>
351     
352      <para>
353        Finally, restart the <application>OpenLDAP</application> server :   
354        <screen>   
355$ /etc/init.d/slapd restart
356        </screen>
357      </para>
358     
359      <para>
360        With an <acronym>LDAP</acronym> backend, PyKota will need some branches
361        in your <acronym>LDAP</acronym> directory to put its own datas.
362        You can configure PyKota to either attach its datas to your existing
363        users and groups, or to put them in their own <literal>ou</literal>.
364        But some <literal>ou</literal>s dedicated to PyKota are needed in any case,
365        so the best bet may be to put all PyKota's datas below an <literal>ou=PyKota</literal>
366        branch. While this will separate these datas from your existing users and groups
367        entries, this may ease the maintainance.
368      </para>
369     
370      <para>
371        PyKota needs at least an <literal>ou</literal> for printers, for users quotas, for
372        groups quotas, for print jobs, and for pointers to the last job of each printer.
373        In the future, this last <literal>ou</literal> may disappear as its content
374        will probably be attached to each printer.
375      </para>
376     
377      <para>
378        Actually PyKota doesn't create these <literal>ou</literal>s for you, because it's
379        difficult to guess what is the best configuration for you. So you have to
380        create them by yourself, either directly with a text editor and the
381        <command>ldapadd</command> command, or with some specialized tool
382        like <command>gq</command>. You can look at the <filename>initscripts/ldap/pykota-sample.ldif</filename>
383        file to see what minimal branches are necessary.
384        <note>
385          <title>Note</title>
386          <para>
387            If you use RPM or DEB packages, usually the
388            <filename>pykota-sample.ldif</filename> file gets installed into the
389            <filename>/usr/share/pykota/ldap</filename> directory, along
390            with a README file.
391          </para>
392        </note> 
393      </para>
394     
395      <para>
396        Once you have chosen and created your directory structure, you have to modify PyKota's configuration files <filename>~pykota/pykota.conf</filename>
397        and <filename>~pykota/pykotadmin.conf</filename>
398        to set some LDAP specific options and binding <literal>dn</literal>s. The easiest is
399        probably to give a look at
400        <filename>pykota/conf/pykota.conf.sample</filename> to see all the options that are
401        needed. Adapt the values to your own configuration, and finally initialize your
402        Quota Storage with the help of the <command>edpykota</command> command.
403      </para>
404    </sect2> 
405   
406    <sect2>
407      <title>MySQL</title>
408     
409      <para>
410        A <application>MySQL</application> Storage Backend is planned, but it actually
411        doesn't exist.
412      </para>
413    </sect2> 
414   
415    <sect2>
416      <title>Berkeley DB</title>
417     
418      <para>
419        A <application>Berkeley DB</application> Storage Backend is planned, but it actually
420        doesn't exist. It seems that remote storage won't be possible with such a backend,
421        so in other terms this means that you will have a different quota database on
422        each print server. This may still prove to be useful for small configurations.
423      </para>
424    </sect2> 
425  </sect1> 
426 
427  <sect1>
428    <title>Print Server Installation</title>
429   
430    <para>
431      For each Print Server on which you plan to implement the print quota
432      mechanism, you have, of course, to have an already working printing environment.
433      Currently <application>PyKota</application> works with either
434      <ulink url="http://www.cups.org"><application>CUPS</application></ulink>
435      or <ulink url="http://lprng.sourceforge.net"><application>LPRng</application></ulink>,
436      but more printing systems may be added in the future.
437    </para>
438   
439    <para>
440      Here's the list of software you have to install on each Print Server, version numbers
441      are given as an indication of which was successfully tested, but older versions may
442      work too.
443      <itemizedlist>
444        <listitem>
445          <para>
446            <application>CUPS</application> version 1.1 or above, or <application>LPRng</application>
447            version 3.8.27 or above (it probably works with older versions but this is untested).
448            You can download them from <ulink url="http://www.cups.org">http://www.cups.org</ulink>
449            or <ulink url="http://lprng.sourceforge.net">http://lprng.sourceforge.net</ulink>
450          </para>
451        </listitem> 
452        <listitem>
453          <para>
454            Python version 2.1 or above.
455            You can download it from <ulink url="http://www.python.org">http://www.python.org</ulink>.
456          </para>
457        </listitem> 
458        <listitem>
459          <para>
460            Quota Storage client libraries, depending on your Quota Storage Backend :
461            <itemizedlist>
462              <listitem>
463                <para>
464                  PostgreSQL backend :
465                  <itemizedlist>
466                    <listitem>
467                      <para>
468                        <application>PostgreSQL</application> client libraries. They must match the <application>PostgreSQL</application>
469                        version used on your Quota Storage Server.
470                      </para>
471                    </listitem> 
472                    <listitem>
473                      <para>
474                        The <application>PygreSQL</application> python module.
475                        It must have been compiled against the same
476                        <application>PostgreSQL</application> client libraries.
477                        <application>PygreSQL</application> is normally included in
478                        <application>PostgreSQL</application>, but you may want to
479                        download it from <ulink url="http://www.pygresql.org">http://www.pygresql.org</ulink>
480                      </para>
481                    </listitem> 
482                  </itemizedlist> 
483                </para>
484              </listitem> 
485              <listitem>
486                <para>
487                  OpenLDAP backend :
488                  <itemizedlist>
489                    <listitem>
490                      <para>
491                        <application>OpenLDAP</application> client libraries. They must match
492                        the <application>OpenLDAP</application> version used on your Quota Storage Server.
493                      </para>
494                    </listitem> 
495                    <listitem>
496                      <para>
497                        The <application>Python-LDAP</application> python module.
498                        It must have been compiled against the same
499                        <application>OpenLDAP</application> client libraries.
500                        You may download this module from <ulink url="http://python-ldap.sourceforge.net">http://python-ldap.sourceforge.net</ulink>
501                      </para>
502                    </listitem> 
503                  </itemizedlist>
504                </para>
505              </listitem>
506              <listitem>
507                <para>
508                  MySQL backend : TODO
509                </para>
510              </listitem>
511              <listitem>
512                <para>
513                  Berkeley DB backend : TODO
514                </para>
515              </listitem>
516            </itemizedlist> 
517          </para>
518        </listitem> 
519        <listitem>
520          <para>
521            <application>ucd-snmp</application> or <application>net-snmp</application> tools, version 4.2.5 or above. You only need
522            the <command>snmpget</command> command.
523            You can download this software from <ulink url="http://www.sourceforge.net/projects/net-snmp/">http://www.sourceforge.net/projects/net-snmp/</ulink>.
524            You only need this if you plan to query your printers for their internal page counter via SNMP.
525          </para>
526        </listitem> 
527        <listitem>
528          <para>
529            <application>netatalk</application> version 1.6.1 or above. You only need
530            the <command>pap</command> command.
531            You can download this software from <ulink url="http://netatalk.sourceforge.net/">http://netatalk.sourceforge.net/</ulink>.
532            You only need this if you plan to query your printers for their internal page counter via AppleTalk.
533          </para>
534        </listitem> 
535        <listitem>
536          <para>
537            eGenix' mxDateTime Python module version 2.0.3 or above. It must match your default Python version.
538            You can download it from <ulink url="http://www.egenix.com">http://www.egenix.com</ulink>.
539          </para>
540        </listitem> 
541      </itemizedlist> 
542    </para>
543   
544    <para>
545      Instead of downloading all these programs' sources and compiling them, which really
546      is a boring task considering that many software are needed, you may prefer to look
547      into the packages included with your GNU/Linux distribution of choice (if you use
548      this operating system of course). Most, if not all, GNU/Linux distributions include
549      all the software mentionned above, in the form of packages which are easier to
550      install than sources tarballs. This is probably the same for the many *BSD
551      distributions.
552    </para>
553   
554    <para>
555       You can check that all needed software is installed by launching the <filename>checkdeps.py</filename>
556       command :
557      <screen>     
558$ python checkdeps.py     
559      </screen>
560    </para>
561   
562    <para>
563      Once all these software are installed, installing PyKota itself is a breeze.
564      PyKota being written entirely in the Python language, which is interpreted,
565      there's no need to compile anything. You just have to execute the installation
566      script :
567      <screen>     
568$ python setup.py install     
569      </screen>
570    </para>
571   
572    <para>
573      The setup script will automatically create the
574      <filename>/usr/share/pykota/conf</filename> directory and put the sample
575      configuration files <filename>conf/pykota.conf.sample</filename> and
576      <filename>conf/pykotadmin.conf.sample</filename> there, along with
577      a <filename>README</filename> file explaining their purpose.
578    </para>
579    <para>
580      You have to copy these files into the <filename>~pykota</filename>
581      directory (you have to create it before), under the respective names <filename>pykota.conf</filename> and
582      <filename>pykotadmin.conf</filename>. Once copied there, you just
583      have to modify these files to adapt them to your own setup.
584      These files are heavily commented, so you should have no problem.
585      Also their format is quite common, because it's the one used by
586      <application>Samba</application> for example, or by <literal>.ini</literal>
587      files under <application>MS-Windows</application>, so you may already
588      be familiar with this syntax.
589      In a future release, this documentation will include the complete
590      reference for all configuration fields available. Keep in mind that
591      PyKota can be really heavily customized, and can delegate some work
592      to any external command of your choice.
593    </para>
594   
595    <para>
596      Please create a backup copy of the <filename>~pykota</filename>
597      directory before modifying a working installation.
598    </para>
599   
600    <para>
601      PyKota features some interesting possibilities which allow you to
602      define options either globally so that they apply to all printers,
603      or on a per printer basis. Please see the sample configuration files
604      to see what I mean. In the simplest form, only a global section is
605      needed. In more complex configurations, you will have to create
606      one section per printer. Each section in the configuration files
607      begins with a name between square brackets <literal>[]</literal>.
608      The name to use to define a particular printer section is the name
609      of the print queue on which you want to set quotas.
610    </para>
611   
612    <para>
613      After you have modified PyKota's configuration files, you have to
614      double check their permissions, otherwise your installation may be
615      insecure or may not work at all.
616      The main configuration file <filename>~pykota/pykota.conf</filename>
617      doesn't contain much sensitive information, so it can be made
618      readable by anyone. If normal users read this file, at best they
619      will learn the username and optional password of the read-only
620      database user, so they won't be allowed to do any harm.
621      On the other hand, the <filename>~pykota/pykotadmin.conf</filename>
622      file contains the read-write user's identity and password. You must then
623      ensure that no normal user can read this file. It should only be readable
624      by the <literal>root</literal> user, which is always the case, by
625      the user your printing system is running as, and optionally by the print administrators,
626      who are usually members of the <literal>lpadmin</literal> group. Under my Debian GNU/Linux system,
627      with CUPS, here's how to do to give the correct permissions :
628      <screen>
629$ chown root.root ~pykota/pykota.conf     
630$ chmod 644 ~pykota/pykota.conf     
631$ chown lp.lpadmin ~pykota/pykotadmin.conf     
632$ chmod 640 ~pykota/pykotadmin.conf     
633      </screen>
634     
635      <warning>
636        <title>Warning</title>
637        <para>
638          All the users allowed to read the <filename>~pykota/pykotadmin.conf</filename>
639          are considered to be <application>PyKota</application> administrators. So be
640          careful with these files permissions.
641        </para>
642      </warning>
643    </para>
644   
645   
646    <para>
647      Now depending on your printing system, the configuration to do is particular.
648      We will now see how to plug PyKota into your printing system.
649    </para>
650   
651    <sect2>
652      <title>With CUPS</title>
653     
654      <para>
655        From version 1.16alpha7 on, configuring PyKota to integrate
656        within CUPS is more than easy.
657      </para>
658     
659      <para>
660        You just have to create a symbolic link to the <filename>cupspykota</filename>
661        command in CUPS' backend directory :
662        <screen>       
663$ cd /usr/lib/cups/backend       
664$ ln -s /usr/share/pykota/cupspykota cupspykota
665        </screen>
666      </para>
667     
668      <para>
669        You have to restart <application>CUPS</application> for this modification to
670        take effect :
671        <screen>
672$ /etc/init.d/cupsys restart       
673        </screen>
674      </para>
675     
676      <para>
677        Now point your web browser to CUPS configuration page, usually at
678        <ulink url="http://localhost:631">http://localhost:631</ulink> on
679        your print server.
680      </para>
681     
682      <para>
683        Then when creating new printers or reconfiguring existing ones, just
684        choose devices which are <literal>PyKota managed</literal>
685        <footnote>
686          <para>
687            Debian 3.0 Woody is known to have problems : CUPS 1.1.14 doesn't automatically
688            detect <literal>PyKota managed</literal> devices. So you have to manually
689            modify CUPS' <filename>printers.conf</filename> file as explained in
690            PyKota's toplevel <filename>README</filename> file.
691          </para>
692        </footnote>
693        instead of
694        normal devices. You've got one <literal>PyKota managed</literal> device
695        for each regular device available from CUPS, so just choose the appropriate
696        one.
697      </para>
698     
699      <para>
700        Repeat the above procedure for each print queue on which you want to use
701        PyKota. That's all !
702      </para>
703     
704      <sect3>
705        <title>Troubleshooting</title>
706        <para>
707          In case of problem, the simplest way to solve it is currently
708          to ask on PyKota's mailing list, describing the symptoms, as
709          well as the hardware and software you use.
710          In a future release of this document, a section dedicated to
711          Frequently Asked Questions will be included.
712        </para>
713       
714        <para>
715          You can now also ask us questions on IRC :
716          <screen>
717/server irc.freenode.net         
718/join #pykota
719          </screen>
720        </para> 
721      </sect3> 
722     
723    </sect2>
724   
725    <sect2>
726      <title>With LPRng</title>
727     
728      <para>
729        For each printer on which you want to use <application>PyKota</application>, just modify the printer's
730        entry in <filename>/etc/printcap</filename> : you have to add
731        the three following lines :
732       
733<screen>        
734  :achk=true:\
735  :as=/usr/share/pykota/lprngpykota:\
736  :ae=/usr/share/pykota/lprngpykota:\
737</screen>         
738
739        This will tell <application>LPRng</application> to activate accounting, and use the <filename>lprngpykota</filename>
740        accounting filter both at the start and at the end of printing.
741      </para>
742     
743     
744      <para>
745        Repeat the above procedure for each print queue on which you want to use
746        PyKota. That's all !
747      </para>
748     
749      <para>
750        When all modifications are done, just save the <filename>/etc/printcap</filename> file
751        and restart <application>LPRng</application> for the changes to take effect :
752        <screen>
753$ /etc/init.d/lprng restart       
754        </screen>
755      </para>
756     
757      <sect3>
758        <title>Troubleshooting</title>
759        <para>
760          In case of problem, the simplest way to solve it is currently
761          to ask on PyKota's mailing list, describing the symptoms, as
762          well as the hardware and software you use.
763          In a future release of this document, a section dedicated to
764          Frequently Asked Questions will be included.
765        </para>
766       
767        <para>
768          You can now also ask us questions on IRC :
769          <screen>
770/server irc.freenode.net         
771/join #pykota
772          </screen>
773        </para>
774      </sect3> 
775     
776    </sect2>
777   
778  </sect1> 
779</chapter>
780
781<!--
782
783$Log$
784Revision 1.31  2005/02/28 22:29:25  jalet
785More complete PostgreSQL configuration.
786Changed all occurences of /etc/pykota/ to ~pykota/
787
788Revision 1.30  2005/02/28 00:07:37  jalet
789Added pkmail's doc.
790Used the <command> tag instead of <application> for commands.
791Fixed some typos.
792Added some missing command line options in the commands reference.
793
794Revision 1.29  2004/11/10 22:35:23  jalet
795Changes to the installation documentation
796
797Revision 1.28  2004/10/06 10:03:16  jalet
798Improved documentation
799
800Revision 1.27  2004/07/21 09:39:03  jalet
801LPRng documentation
802
803Revision 1.26  2004/07/16 12:22:46  jalet
804LPRng support early version
805
806Revision 1.25  2004/05/25 09:49:53  jalet
807The old pykota filter has been removed. LPRng support disabled for now.
808
809Revision 1.24  2004/02/13 08:46:32  jalet
810Fixed documentation wrt installation paths changed
811
812Revision 1.23  2004/01/30 17:13:56  jalet
8131.17
814
815Revision 1.22  2003/11/15 14:59:53  jalet
816Documentation wrt the new CUPS backend.
817
818Revision 1.21  2003/10/14 20:26:53  jalet
819Better documentation.
8201.15 is out !
821
822Revision 1.20  2003/07/25 13:20:32  jalet
823Typo which wasn't
824
825Revision 1.19  2003/07/25 13:18:44  jalet
826Typos
827
828Revision 1.18  2003/07/25 10:41:29  jalet
829Better documentation.
830pykotme now displays the current user's account balance.
831Some test changed in ldap module.
832
833Revision 1.17  2003/06/30 21:44:18  jalet
8341.09 is out !
835
836Revision 1.16  2003/06/24 21:37:05  jalet
837Minor changes
838
839Revision 1.15  2003/06/10 16:37:54  jalet
840Deletion of the second user which is not needed anymore.
841Added a debug configuration field in /etc/pykota.conf
842All queries can now be sent to the logger in debug mode, this will
843greatly help improve performance when time for this will come.
844
845Revision 1.14  2003/06/05 07:12:29  jalet
846Reorganization of directories
847
848Revision 1.13  2003/04/24 21:09:47  jalet
849Documentation slightly improved.
850
851Revision 1.12  2003/04/17 21:33:16  jalet
852Version 1.03 is out.
853
854Revision 1.11  2003/03/25 09:32:06  jalet
855Improved documentation.
856
857Revision 1.10  2003/03/23 17:59:56  jalet
858Clarify a point.
859
860Revision 1.9  2003/03/23 17:57:20  jalet
861Deleted a repetition.
862
863Revision 1.8  2003/03/22 15:34:50  jalet
864More complete installation documentation.
865
866Revision 1.7  2003/03/22 14:26:45  jalet
867Download instructions added.
868
869Revision 1.6  2003/03/22 14:06:02  jalet
870Quota Storage Server installation is OK for PostgreSQL.
871
872Revision 1.5  2003/03/22 13:11:33  jalet
873The port on which the Quota Storage Sever is listening can now
874be set in the configuration file (see sample).
875Better error handling if PygreSQL is not installed.
876Improved documentation.
877Version number changed to 1.02alpha
878
879Revision 1.4  2003/03/22 07:20:38  jalet
880More information wrt PostgreSQL tcp/ip configuration.
881
882Revision 1.3  2003/03/18 22:18:25  jalet
883The documentation will only be a sequence of chapters in a single part, not
884multiple parts each including chapters.
885
886Revision 1.2  2003/03/18 22:10:54  jalet
887Documentation improvements.
888
889Revision 1.1  2003/02/08 00:03:35  jalet
890Documentation skeleton added
891
892
893-->
Note: See TracBrowser for help on using the browser.