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

Revision 862, 16.1 kB (checked in by jalet, 21 years ago)

More complete installation 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>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.02-official.tar.gz   
32jerome@nordine:~$ cd pykota-1.02-official
33jerome@nordine:~/pykota-1.02-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.
48  </para>
49 
50  <para>
51    Now we will see what has to be done on each of the servers we are planning to use.
52    <note>
53      <title>Note</title>
54      <para>
55        Of course, depending on the size of your network, you may very well
56        use the same machine as both a Print Server and a Storage Server.
57        This is especially the case if you've got only one server.
58      </para>
59    </note> 
60  </para>
61 
62  <sect1>
63    <title>Storage Server Installation</title>
64   
65    <para>
66      Depending on <application>PyKota</application>'s version number, different
67      types of storage backends may be supported, so we will see for each one of
68      them how to configure it.
69    </para>
70   
71    <sect2>
72      <title>PostgreSQL</title>
73     
74      <para>
75        <application>PostgreSQL</application> is an <firstterm>Object Relationnal DataBase
76        Management System</firstterm> distributed under a <firstterm>Free Software</firstterm>
77        license from the
78        <ulink url="http://www.postgresql.org">http://www.postgresql.org</ulink>
79        web site. It certainely is the free <acronym>RDBMS</acronym> which has the most advanced
80        features, and is widely used all over the world.
81      </para>
82     
83      <para>
84        To configure your Storage Server, you must have PostgreSQL already working.
85        The complete installation of <application>PostgreSQL</application> is not covered by
86        the present manual, please refer to your system's documentation or to
87        <ulink url="http://www.postgresql.org">http://www.postgresql.org</ulink> for
88        details.
89      </para>
90     
91      <para>
92        One thing you have to check, though, is that every Print Server on which you
93        want to install the print quota mechanism, i.e. the print servers, must be able to connect to the
94        <application>PostgreSQL</application> server. In the default installation of
95        <application>PostgreSQL</application> this may not be the case for security reasons, except if both
96        servers are in fact the same machine. In any case, it is recommended that you
97        check the <filename>/etc/postgresql/pg_hba.conf</filename> file and modify it if
98        needed. This file is self documented and its modification is straightforward.
99        You also have to make sure that <application>PostgreSQL</application> accepts <acronym>TCP/IP</acronym> connections.
100        To do so you either have to launch it with the <option>-i</option> option or
101        modify the <filename>/etc/postgresql/postgresql.conf</filename> file, which is
102        self documented and easy to modify too.
103        <tip>
104          <title>Tip</title>
105          <para>
106            Don't forget to restart <application>PostgreSQL</application> if you modify
107            any of its configuration files, in order for the changes to take effect.
108          </para>
109        </tip> 
110      </para>
111     
112      <para>
113        Be careful, you may be unable to connect from a Print Server to the <application>PostgreSQL</application>
114        server even if the configuration is correct. Sometimes your connections may be blocked by
115        one or more network firewalls along the route from one machine to the other. If this
116        is the case, then the best thing you can do is to ask your <firstterm>Network Administrator</firstterm>
117        to not filter the IP port used by <application>PostgreSQL</application>, which is
118        usually port 5432/tcp.
119        <note>
120          <title>Note</title>
121          <para>
122            The TCP/IP network port used by PostgreSQL may be different. When in doubt, ask your
123            <firstterm>System Administrator</firstterm> for the correct value.
124          </para>
125        </note> 
126      </para>
127     
128      <para>
129        Now that your <application>PostgreSQL</application> server is up and running, and
130        is waiting for your connections, you have to create the Quota Storage DataBase.
131        To do so, you'll have to feed <application>PostgreSQL</application> with the
132        <filename>pykota-x.xx/initscripts/pykota-postgresql.sql</filename> file.
133        This file will create a Quota DataBase administrator and a Quota DataBase user
134        in the <application>PostgreSQL</application> system, then create an empty
135        Quota DataBase and set some permissions on it. The Quota DataBase administrator
136        will be able to add printers, users and groups to the Quota DataBase, while
137        the Quota DataBase user will be used to update the print quota usage
138        in the Quota DataBase. None of these two users is present in the Quota Database
139        itself, they are only defined in <application>PostgreSQL</application> and don't
140        have to exist on any system, nor in the Quota DataBase. Their default names
141        are <literal>pykotaadmin</literal> for the administrator and <literal>pykotauser</literal>
142        for the user. The database which will be created will be named <literal>pykota</literal>.
143        <note>
144          <title>Note</title>
145          <para>
146            You can choose other names if you want, just modify the
147            <filename>initscripts/pykota-postgresql.sql</filename> file
148            accordingly.
149          </para>
150        </note> 
151      </para>
152     
153      <para>
154        To run this script, you can use the <application>psql</application> frontend to
155        <application>PostgreSQL</application>, but your priviledges must be sufficient
156        to be allowed to create users and databases. You can launch <application>psql</application>
157        as the <literal>postgres</literal> user which is <application>PostgreSQL</application>'s
158        default administrator, and connect to the default database named <literal>template1</literal>.
159        From a command line interpreter (i.e. shell), type the following commands :
160        <screen>
161jerome@nordine:~$ cd pykota-1.02-official/initscripts/
162jerome@nordine:~/pykota-1.02-official/initscripts$ psql -h localhost -U postgres template1
163Welcome to psql, the PostgreSQL interactive terminal.
164
165Type:  \copyright for distribution terms
166       \h for help with SQL commands
167       \? for help on internal slash commands
168       \g or terminate with semicolon to execute query
169       \q to quit
170
171template1=# \i pykota-postgresql.sql
172            ... a lot of output lines
173pykota=#       
174        </screen>
175      </para>
176     
177      <para>
178        For security reasons, you may want to set passwords in
179        <application>PostgreSQL</application> for the
180        <literal>pykotaadmin</literal> and <literal>pykotauser</literal>
181        users. Otherwise any user able to connect to
182        <application>PostgreSQL</application> on your Quota Storage Server
183        could connect to the quota database as one of them and modify it without problem.
184      </para>
185     
186      <para>
187        To do so, just type the following lines while still being at the <application>psql</application>
188        prompt (replace the passwords values by your own) :
189        <screen>
190pykota=# ALTER USER pykotaadmin PASSWORD 'somepassword';
191ALTER USER
192pykota=# ALTER USER pykotauser PASSWORD 'anotherpassword';
193ALTER USER
194pykota=# \q
195jerome@nordine:~/pykota-1.02-official/initscripts$
196        </screen>
197      </para>
198     
199      <para>
200        The <literal>\q</literal> command above will quit the <application>psql</application>
201        program and return you to the shell's command line prompt.
202      </para>
203     
204      <para>
205        To improve security further, you could encrypt your database connections, or
206        take any other step as needed. Please refer to <application>PostgreSQL</application>'s
207        documentation for details.
208        <warning>
209          <title>Warning</title>
210          <para>
211            Defining passwords may not be sufficient if your database access rule is
212            set to <literal>trust</literal> in the <filename>/etc/postgresql/pg_hba.conf</filename>.
213            Again, please refer to <application>PostgreSQL</application>'s documentation
214            for details. Also, passwords will fly unencrypted over the network by default,
215            so be sure to take any necessary step to secure your database server from
216            unauthorized use. This has nothing to do with <application>PyKota</application>
217            though, it is just a general rule to keep in mind.
218          </para>
219        </warning> 
220      </para>
221     
222      <para>
223        If no error occured, then your Quota DataBase is ready to be used.
224        Now you can let the Quota Storage Server alone, the remaining work
225        will have to be done on each one of the print servers which will
226        use this particular Quota Storage Server.
227        <tip>
228          <title>Tip</title>
229          <para>
230            If an error occured, maybe your PostgreSQL version is too old, or
231            an unexpected problem (like a bug) happened. Please send me an email so that I
232            can try to solve the problem. Thanks in advance.
233          </para>
234        </tip> 
235      </para>
236     
237    </sect2> 
238   
239    <sect2>
240      <title>MySQL</title>
241     
242      <para>
243        A <application>MySQL</application> Storage Backend is planned, but it actually
244        doesn't exist.
245      </para>
246    </sect2> 
247   
248    <sect2>
249      <title>LDAP</title>
250     
251      <para>
252        An <application>LDAP</application> Storage Backend is planned, but it actually
253        doesn't exist. Some people may already be working on this, though.
254      </para>
255    </sect2> 
256   
257    <sect2>
258      <title>Berkeley DB</title>
259     
260      <para>
261        A <application>Berkeley DB</application> Storage Backend is planned, but it actually
262        doesn't exist. It seems that remote storage won't be possible with such a backend,
263        so in other terms this means that you will have a different quota database on
264        each print server. This may still prove to be useful for small configurations.
265      </para>
266    </sect2> 
267  </sect1> 
268 
269  <sect1>
270    <title>Print Server Installation</title>
271   
272    <para>
273      For each Print Server on which you plan to implement the print quota
274      mechanism, you have, of course, to have an already working printing environment.
275      Currently <application>PyKota</application> only works with the
276      <ulink url="http://www.cups.org"><application>CUPS</application></ulink> environment,
277      but more may be added in the future.
278    </para>
279   
280    <para>
281      Here's the list of software you have to install on each Print Server :
282      <itemizedlist>
283        <listitem>
284          <para>
285            CUPS version 1.1 or above.
286            You can download it from <ulink url="http://www.cups.org">http://www.cups.org</ulink>.
287          </para>
288        </listitem> 
289        <listitem>
290          <para>
291            Python version 2.1 or above.
292            You can download it from <ulink url="http://www.python.org">http://www.python.org</ulink>.
293          </para>
294        </listitem> 
295        <listitem>
296          <para>
297            Quota Storage client libraries, depending on your Quota Storage Backend :
298            <itemizedlist>
299              <listitem>
300                <para>
301                  PostgreSQL backend :
302                  <itemizedlist>
303                    <listitem>
304                      <para>
305                        <application>PostgreSQL</application> client libraries. They must match the <application>PostgreSQL</application>
306                        version used on your Quota Storage Server.
307                      </para>
308                    </listitem> 
309                    <listitem>
310                      <para>
311                        The <application>PygreSQL</application> python module.
312                        It must match the
313                        <application>PostgreSQL</application> client libraries'
314                        version, as well as Python's version.
315                      </para>
316                    </listitem> 
317                  </itemizedlist> 
318                </para>
319              </listitem> 
320              <listitem>
321                <para>
322                  MySQL backend : TODO
323                </para>
324              </listitem>
325              <listitem>
326                <para>
327                  LDAP backend : TODO
328                </para>
329              </listitem>
330              <listitem>
331                <para>
332                  Berkeley DB backend : TODO
333                </para>
334              </listitem>
335            </itemizedlist> 
336          </para>
337        </listitem> 
338        <listitem>
339          <para>
340            <application>ucd-snmp</application> or <application>net-snmp</application> tools, version 4.2.5 or above. You only need
341            the <application>snmpget</application> command.
342            You can download them from <ulink url="http://www.sourceforge.net/projects/net-snmp/">http://www.sourceforge.net/projects/net-snmp/</ulink>
343          </para>
344        </listitem> 
345        <listitem>
346          <para>
347            eGenix' mxDateTime Python module. It must match your default Python version.
348            You can download it from <ulink url="http://www.egenix.com">http://www.egenix.com</ulink>.
349          </para>
350        </listitem> 
351      </itemizedlist> 
352    </para>
353  </sect1> 
354</chapter>
355
356<!--
357
358$Log$
359Revision 1.8  2003/03/22 15:34:50  jalet
360More complete installation documentation.
361
362Revision 1.7  2003/03/22 14:26:45  jalet
363Download instructions added.
364
365Revision 1.6  2003/03/22 14:06:02  jalet
366Quota Storage Server installation is OK for PostgreSQL.
367
368Revision 1.5  2003/03/22 13:11:33  jalet
369The port on which the Quota Storage Sever is listening can now
370be set in the configuration file (see sample).
371Better error handling if PygreSQL is not installed.
372Improved documentation.
373Version number changed to 1.02alpha
374
375Revision 1.4  2003/03/22 07:20:38  jalet
376More information wrt PostgreSQL tcp/ip configuration.
377
378Revision 1.3  2003/03/18 22:18:25  jalet
379The documentation will only be a sequence of chapters in a single part, not
380multiple parts each including chapters.
381
382Revision 1.2  2003/03/18 22:10:54  jalet
383Documentation improvements.
384
385Revision 1.1  2003/02/08 00:03:35  jalet
386Documentation skeleton added
387
388
389-->
Note: See TracBrowser for help on using the browser.