[753] | 1 | <!-- $Id$ --> |
---|
| 2 | |
---|
| 3 | <chapter> |
---|
[865] | 4 | <title id="installation">Installation</title> |
---|
[860] | 5 | |
---|
| 6 | <para>Last modified on $Date$</para> |
---|
| 7 | |
---|
[753] | 8 | <para> |
---|
[856] | 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. |
---|
[753] | 11 | </para> |
---|
[856] | 12 | |
---|
| 13 | <para> |
---|
| 14 | First you have to determine which machine will be the <application>PyKota</application> |
---|
[860] | 15 | <firstterm>Storage Server</firstterm>. The Storage Server is the host responsible |
---|
[856] | 16 | for keeping a centralized database of print usage for all your printers, users and groups. |
---|
| 17 | </para> |
---|
| 18 | |
---|
| 19 | <para> |
---|
[860] | 20 | Then you have to list all the <firstterm>Print Servers</firstterm> for which |
---|
| 21 | you plan to use <firstterm>print quota</firstterm> facilities. |
---|
[856] | 22 | </para> |
---|
| 23 | |
---|
| 24 | <para> |
---|
[861] | 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> |
---|
[1168] | 31 | jerome@nordine:~$ tar -zxf pykota-1.15_official.tar.gz |
---|
| 32 | jerome@nordine:~$ cd pykota-1.15_official |
---|
| 33 | jerome@nordine:~/pykota-1.15_official$ |
---|
[861] | 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 |
---|
[1168] | 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 ! |
---|
[861] | 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. |
---|
[856] | 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> |
---|
[860] | 76 | <application>PostgreSQL</application> is an <firstterm>Object Relationnal DataBase |
---|
| 77 | Management System</firstterm> distributed under a <firstterm>Free Software</firstterm> |
---|
[856] | 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 |
---|
[863] | 94 | want to install the print quota mechanism, must be able to connect to the |
---|
[856] | 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 |
---|
[862] | 98 | check the <filename>/etc/postgresql/pg_hba.conf</filename> file and modify it if |
---|
[856] | 99 | needed. This file is self documented and its modification is straightforward. |
---|
[858] | 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 |
---|
[862] | 102 | modify the <filename>/etc/postgresql/postgresql.conf</filename> file, which is |
---|
[1168] | 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. |
---|
[856] | 106 | <tip> |
---|
| 107 | <title>Tip</title> |
---|
| 108 | <para> |
---|
| 109 | Don't forget to restart <application>PostgreSQL</application> if you modify |
---|
| 110 | any of its configuration files, in order for the changes to take effect. |
---|
| 111 | </para> |
---|
| 112 | </tip> |
---|
| 113 | </para> |
---|
| 114 | |
---|
| 115 | <para> |
---|
| 116 | Be careful, you may be unable to connect from a Print Server to the <application>PostgreSQL</application> |
---|
| 117 | server even if the configuration is correct. Sometimes your connections may be blocked by |
---|
| 118 | one or more network firewalls along the route from one machine to the other. If this |
---|
[860] | 119 | is the case, then the best thing you can do is to ask your <firstterm>Network Administrator</firstterm> |
---|
[856] | 120 | to not filter the IP port used by <application>PostgreSQL</application>, which is |
---|
[1099] | 121 | usually port <literal>5432/tcp</literal>. |
---|
[860] | 122 | <note> |
---|
| 123 | <title>Note</title> |
---|
[856] | 124 | <para> |
---|
| 125 | The TCP/IP network port used by PostgreSQL may be different. When in doubt, ask your |
---|
[860] | 126 | <firstterm>System Administrator</firstterm> for the correct value. |
---|
[856] | 127 | </para> |
---|
[860] | 128 | </note> |
---|
[856] | 129 | </para> |
---|
| 130 | |
---|
| 131 | <para> |
---|
[860] | 132 | Now that your <application>PostgreSQL</application> server is up and running, and |
---|
| 133 | is waiting for your connections, you have to create the Quota Storage DataBase. |
---|
| 134 | To do so, you'll have to feed <application>PostgreSQL</application> with the |
---|
[1015] | 135 | <filename>pykota-x.xx/initscripts/postgresql/pykota-postgresql.sql</filename> file. |
---|
[1021] | 136 | This file will create a Quota DataBase administrator in the <application>PostgreSQL</application> system, then create an empty |
---|
[862] | 137 | Quota DataBase and set some permissions on it. The Quota DataBase administrator |
---|
[1021] | 138 | is the <application>PostgreSQL</application>'s user used to manage the Quota database. |
---|
| 139 | The Quota DataBase Administrator is not present in the Quota Database |
---|
| 140 | itself, he is only defined in <application>PostgreSQL</application> and don't |
---|
[1168] | 141 | have to exist on any system, nor in the Quota DataBase. His default name |
---|
[1021] | 142 | is <literal>pykotaadmin</literal>. |
---|
[1099] | 143 | A Quota Storage read-only user is also created under the name of <literal>pykotauser</literal>. |
---|
| 144 | This read-only user is used by <application>PyKota</application> to connect to the |
---|
| 145 | Quota Storage when a non-root user launches a pykota command. This prevents normal |
---|
| 146 | users from being able to modify their own, or other users', quota information. |
---|
[1021] | 147 | The database which will be created will be named <literal>pykota</literal> by default. |
---|
[862] | 148 | <note> |
---|
| 149 | <title>Note</title> |
---|
| 150 | <para> |
---|
| 151 | You can choose other names if you want, just modify the |
---|
[1015] | 152 | <filename>initscripts/postgresql/pykota-postgresql.sql</filename> file |
---|
[864] | 153 | accordingly, and report your changes into <application>PyKota</application>'s |
---|
| 154 | configuration file. |
---|
[862] | 155 | </para> |
---|
| 156 | </note> |
---|
[856] | 157 | </para> |
---|
[860] | 158 | |
---|
| 159 | <para> |
---|
| 160 | To run this script, you can use the <application>psql</application> frontend to |
---|
| 161 | <application>PostgreSQL</application>, but your priviledges must be sufficient |
---|
| 162 | to be allowed to create users and databases. You can launch <application>psql</application> |
---|
| 163 | as the <literal>postgres</literal> user which is <application>PostgreSQL</application>'s |
---|
| 164 | default administrator, and connect to the default database named <literal>template1</literal>. |
---|
| 165 | From a command line interpreter (i.e. shell), type the following commands : |
---|
| 166 | <screen> |
---|
[1168] | 167 | jerome@nordine:~$ cd pykota-1.15_official/initscripts/postgresql |
---|
| 168 | jerome@nordine:~/pykota-1.15_official/initscripts$ psql -h localhost -U postgres template1 |
---|
[860] | 169 | Welcome to psql, the PostgreSQL interactive terminal. |
---|
| 170 | |
---|
| 171 | Type: \copyright for distribution terms |
---|
| 172 | \h for help with SQL commands |
---|
| 173 | \? for help on internal slash commands |
---|
| 174 | \g or terminate with semicolon to execute query |
---|
| 175 | \q to quit |
---|
| 176 | |
---|
| 177 | template1=# \i pykota-postgresql.sql |
---|
| 178 | ... a lot of output lines |
---|
[862] | 179 | pykota=# |
---|
[860] | 180 | </screen> |
---|
| 181 | </para> |
---|
| 182 | |
---|
| 183 | <para> |
---|
[862] | 184 | For security reasons, you may want to set passwords in |
---|
| 185 | <application>PostgreSQL</application> for the |
---|
[1099] | 186 | <literal>pykotaadmin</literal> and <literal>pykotauser</literal> users. |
---|
[1021] | 187 | Otherwise any user able to connect to |
---|
[862] | 188 | <application>PostgreSQL</application> on your Quota Storage Server |
---|
[1099] | 189 | could connect to the quota database, and either see it, or even modify it without problem. |
---|
[862] | 190 | </para> |
---|
| 191 | |
---|
| 192 | <para> |
---|
| 193 | To do so, just type the following lines while still being at the <application>psql</application> |
---|
[1099] | 194 | prompt (replace the password values by your own, and do the same for the <literal>pykotauser</literal> user) : |
---|
[862] | 195 | <screen> |
---|
| 196 | pykota=# ALTER USER pykotaadmin PASSWORD 'somepassword'; |
---|
| 197 | ALTER USER |
---|
| 198 | pykota=# \q |
---|
[1168] | 199 | jerome@nordine:~/pykota-1.15_official/initscripts/postgresql$ |
---|
[862] | 200 | </screen> |
---|
| 201 | </para> |
---|
| 202 | |
---|
| 203 | <para> |
---|
| 204 | The <literal>\q</literal> command above will quit the <application>psql</application> |
---|
| 205 | program and return you to the shell's command line prompt. |
---|
| 206 | </para> |
---|
| 207 | |
---|
| 208 | <para> |
---|
| 209 | To improve security further, you could encrypt your database connections, or |
---|
| 210 | take any other step as needed. Please refer to <application>PostgreSQL</application>'s |
---|
[959] | 211 | documentation for details. Also if <application>PyKota</application>'s configuration |
---|
[1099] | 212 | file <filename>/etc/pykota/pykotadmin.conf</filename> is readable by anyone with access on your file system, a local user could |
---|
[959] | 213 | create some script to modify his own print quota. |
---|
[862] | 214 | <warning> |
---|
| 215 | <title>Warning</title> |
---|
| 216 | <para> |
---|
| 217 | Defining passwords may not be sufficient if your database access rule is |
---|
| 218 | set to <literal>trust</literal> in the <filename>/etc/postgresql/pg_hba.conf</filename>. |
---|
| 219 | Again, please refer to <application>PostgreSQL</application>'s documentation |
---|
| 220 | for details. Also, passwords will fly unencrypted over the network by default, |
---|
| 221 | so be sure to take any necessary step to secure your database server from |
---|
| 222 | unauthorized use. This has nothing to do with <application>PyKota</application> |
---|
| 223 | though, it is just a general rule to keep in mind. |
---|
| 224 | </para> |
---|
| 225 | </warning> |
---|
| 226 | </para> |
---|
| 227 | |
---|
| 228 | <para> |
---|
[860] | 229 | If no error occured, then your Quota DataBase is ready to be used. |
---|
| 230 | Now you can let the Quota Storage Server alone, the remaining work |
---|
| 231 | will have to be done on each one of the print servers which will |
---|
| 232 | use this particular Quota Storage Server. |
---|
| 233 | <tip> |
---|
| 234 | <title>Tip</title> |
---|
| 235 | <para> |
---|
| 236 | If an error occured, maybe your PostgreSQL version is too old, or |
---|
[1168] | 237 | an unexpected problem (like a bug) happened. Please contact us via email so that we |
---|
[860] | 238 | can try to solve the problem. Thanks in advance. |
---|
| 239 | </para> |
---|
| 240 | </tip> |
---|
| 241 | </para> |
---|
[862] | 242 | |
---|
[856] | 243 | </sect2> |
---|
| 244 | |
---|
| 245 | <sect2> |
---|
[1168] | 246 | <title>OpenLDAP</title> |
---|
[856] | 247 | |
---|
| 248 | <para> |
---|
[1104] | 249 | From version 1.09 on, <application>OpenLDAP</application> can be used as a Quota Storage Backend. |
---|
[1052] | 250 | It is possible that other LDAP servers can be used, but this is currently untested. |
---|
[856] | 251 | </para> |
---|
[1052] | 252 | |
---|
| 253 | <para> |
---|
[1168] | 254 | <application>OpenLDAP</application> is a Lightweight Directory Access Protocol server |
---|
| 255 | implementation published as Free Software. |
---|
| 256 | You can download it from <ulink url="http://www.openldap.org">http://www.openldap.org</ulink>. |
---|
| 257 | </para> |
---|
| 258 | |
---|
| 259 | <para> |
---|
[1052] | 260 | To use <application>OpenLDAP</application> as your Quota Storage Backend, you have to copy the |
---|
| 261 | <filename>pykota/initscripts/ldap/pykota.schema</filename> in <application>OpenLDAP</application>'s |
---|
| 262 | schemas directory. |
---|
| 263 | Under Debian GNU/Linux, this is something like : |
---|
| 264 | <screen> |
---|
| 265 | $ cp pykota.schema /etc/ldap/schema |
---|
| 266 | </screen> |
---|
| 267 | </para> |
---|
| 268 | <para> |
---|
| 269 | Then edit <filename>/etc/ldap/slapd.conf</filename> and add a line to |
---|
| 270 | include the PyKota schema. You should have something |
---|
| 271 | like : |
---|
| 272 | <screen> |
---|
| 273 | # Schema and objectClass definitions |
---|
| 274 | include /etc/ldap/schema/core.schema |
---|
| 275 | include /etc/ldap/schema/cosine.schema |
---|
| 276 | include /etc/ldap/schema/nis.schema |
---|
| 277 | include /etc/ldap/schema/inetorgperson.schema |
---|
| 278 | include /etc/ldap/schema/pykota.schema |
---|
| 279 | </screen> |
---|
| 280 | </para> |
---|
[1168] | 281 | |
---|
[1052] | 282 | <para> |
---|
[1168] | 283 | While this is not mandatory, it is recommended that you setup |
---|
| 284 | some indexes for some often accessed PyKota attributes. |
---|
| 285 | Actually, the <acronym>LDAP</acronym> schema included with |
---|
| 286 | PyKota doesn't allow indexes of another type than <literal>eq</literal>, |
---|
| 287 | but this will change in a next release. Here are the minimal indexes |
---|
| 288 | lines you may want to put in <filename>slapd.conf</filename> : |
---|
| 289 | <screen> |
---|
| 290 | # Indexes for PyKota |
---|
| 291 | index pykotaUserName eq |
---|
| 292 | index pykotaGroupName eq |
---|
| 293 | index pykotaPrinterName eq |
---|
| 294 | index pykotaLastJobIdent eq |
---|
| 295 | </screen> |
---|
| 296 | </para> |
---|
| 297 | |
---|
| 298 | <para> |
---|
[1052] | 299 | Finally, restart the <application>OpenLDAP</application> server : |
---|
| 300 | <screen> |
---|
| 301 | $ /etc/init.d/slapd restart |
---|
| 302 | </screen> |
---|
| 303 | </para> |
---|
| 304 | |
---|
| 305 | <para> |
---|
[1168] | 306 | With an <acronym>LDAP</acronym> backend, PyKota will need some branches |
---|
| 307 | in your <acronym>LDAP</acronym> directory to put its own datas. |
---|
| 308 | You can configure PyKota to either attach its datas to your existing |
---|
| 309 | users and groups, or to put them in their own <literal>ou</literal>. |
---|
| 310 | But some <literal>ou</literal>s dedicated to PyKota are needed in any case, |
---|
| 311 | so the best bet may be to put all PyKota's datas below an <literal>ou=PyKota</literal> |
---|
| 312 | branch. While this will separate these datas from your existing users and groups |
---|
| 313 | entries, this may ease the maintainance. |
---|
| 314 | </para> |
---|
| 315 | |
---|
| 316 | <para> |
---|
| 317 | PyKota needs at least an <literal>ou</literal> for printers, for users quotas, for |
---|
| 318 | groups quotas, for print jobs, and for pointers to the last job of each printer. |
---|
| 319 | In the future, this last <literal>ou</literal> may disappear as its content |
---|
| 320 | will probably be attached to each printer. |
---|
| 321 | </para> |
---|
| 322 | |
---|
| 323 | <para> |
---|
| 324 | Actually PyKota doesn't create these <literal>ou</literal>s for you, because it's |
---|
| 325 | difficult to guess what is the best configuration for you. So you have to |
---|
| 326 | create them by yourself, either directly with a text editor and the |
---|
| 327 | <application>ldapadd</application> command, or with some specialized tool |
---|
| 328 | like <application>gq</application>. |
---|
| 329 | </para> |
---|
| 330 | |
---|
| 331 | <para> |
---|
| 332 | Once you have chosen and created your directory structure, you have to modify PyKota's configuration files <filename>/etc/pykota/pykota.conf</filename> |
---|
[1099] | 333 | and <filename>/etc/pykota/pykotadmin.conf</filename> |
---|
[1168] | 334 | to set some LDAP specific options and binding <literal>dn</literal>s. The easiest is |
---|
| 335 | probably to give a look at |
---|
[1052] | 336 | <filename>pykota/conf/pykota.conf.sample</filename> to see all the options that are |
---|
| 337 | needed. Adapt the values to your own configuration, and finally initialize your |
---|
| 338 | Quota Storage with the help of the <application>edpykota</application> command. |
---|
| 339 | </para> |
---|
[856] | 340 | </sect2> |
---|
| 341 | |
---|
| 342 | <sect2> |
---|
[1038] | 343 | <title>MySQL</title> |
---|
[856] | 344 | |
---|
| 345 | <para> |
---|
[1038] | 346 | A <application>MySQL</application> Storage Backend is planned, but it actually |
---|
| 347 | doesn't exist. |
---|
[856] | 348 | </para> |
---|
| 349 | </sect2> |
---|
| 350 | |
---|
| 351 | <sect2> |
---|
| 352 | <title>Berkeley DB</title> |
---|
| 353 | |
---|
| 354 | <para> |
---|
[857] | 355 | A <application>Berkeley DB</application> Storage Backend is planned, but it actually |
---|
| 356 | doesn't exist. It seems that remote storage won't be possible with such a backend, |
---|
| 357 | so in other terms this means that you will have a different quota database on |
---|
| 358 | each print server. This may still prove to be useful for small configurations. |
---|
[856] | 359 | </para> |
---|
| 360 | </sect2> |
---|
| 361 | </sect1> |
---|
| 362 | |
---|
| 363 | <sect1> |
---|
| 364 | <title>Print Server Installation</title> |
---|
| 365 | |
---|
| 366 | <para> |
---|
| 367 | For each Print Server on which you plan to implement the print quota |
---|
| 368 | mechanism, you have, of course, to have an already working printing environment. |
---|
[1168] | 369 | Currently <application>PyKota</application> works with either |
---|
[959] | 370 | <ulink url="http://www.cups.org"><application>CUPS</application></ulink> |
---|
[1168] | 371 | or <ulink url="http://lprng.sourceforge.net"><application>LPRng</application></ulink>, |
---|
| 372 | but more printing systems may be added in the future. |
---|
[856] | 373 | </para> |
---|
| 374 | |
---|
| 375 | <para> |
---|
[959] | 376 | Here's the list of software you have to install on each Print Server, version numbers |
---|
| 377 | are given as an indication of which was successfully tested, but older versions may |
---|
| 378 | work too. |
---|
[862] | 379 | <itemizedlist> |
---|
| 380 | <listitem> |
---|
| 381 | <para> |
---|
[959] | 382 | <application>CUPS</application> version 1.1 or above, or <application>LPRng</application> |
---|
| 383 | version 3.8.20 or above (it probably works with older versions but this is untested). |
---|
| 384 | You can download them from <ulink url="http://www.cups.org">http://www.cups.org</ulink> |
---|
| 385 | or <ulink url="http://lprng.sourceforge.net">http://lprng.sourceforge.net</ulink> |
---|
[862] | 386 | </para> |
---|
| 387 | </listitem> |
---|
| 388 | <listitem> |
---|
| 389 | <para> |
---|
| 390 | Python version 2.1 or above. |
---|
| 391 | You can download it from <ulink url="http://www.python.org">http://www.python.org</ulink>. |
---|
| 392 | </para> |
---|
| 393 | </listitem> |
---|
| 394 | <listitem> |
---|
| 395 | <para> |
---|
| 396 | Quota Storage client libraries, depending on your Quota Storage Backend : |
---|
| 397 | <itemizedlist> |
---|
| 398 | <listitem> |
---|
| 399 | <para> |
---|
| 400 | PostgreSQL backend : |
---|
| 401 | <itemizedlist> |
---|
| 402 | <listitem> |
---|
| 403 | <para> |
---|
| 404 | <application>PostgreSQL</application> client libraries. They must match the <application>PostgreSQL</application> |
---|
| 405 | version used on your Quota Storage Server. |
---|
| 406 | </para> |
---|
| 407 | </listitem> |
---|
| 408 | <listitem> |
---|
| 409 | <para> |
---|
| 410 | The <application>PygreSQL</application> python module. |
---|
[1168] | 411 | It must have been compiled against the same |
---|
| 412 | <application>PostgreSQL</application> client libraries. |
---|
| 413 | <application>PygreSQL</application> is normally included in |
---|
| 414 | <application>PostgreSQL</application>, but you may want to |
---|
| 415 | download it from <ulink url="http://www.pygresql.org">http://www.pygresql.org</ulink> |
---|
[862] | 416 | </para> |
---|
| 417 | </listitem> |
---|
| 418 | </itemizedlist> |
---|
| 419 | </para> |
---|
| 420 | </listitem> |
---|
| 421 | <listitem> |
---|
| 422 | <para> |
---|
[1168] | 423 | OpenLDAP backend : |
---|
| 424 | <itemizedlist> |
---|
| 425 | <listitem> |
---|
| 426 | <para> |
---|
| 427 | <application>OpenLDAP</application> client libraries. They must match |
---|
| 428 | the <application>OpenLDAP</application> version used on your Quota Storage Server. |
---|
| 429 | </para> |
---|
| 430 | </listitem> |
---|
| 431 | <listitem> |
---|
| 432 | <para> |
---|
| 433 | The <application>Python-LDAP</application> python module. |
---|
| 434 | It must have been compiled against the same |
---|
| 435 | <application>OpenLDAP</application> client libraries. |
---|
| 436 | You may download this module from <ulink url="http://python-ldap.sourceforge.net">http://python-ldap.sourceforge.net</ulink> |
---|
| 437 | </para> |
---|
| 438 | </listitem> |
---|
| 439 | </itemizedlist> |
---|
[862] | 440 | </para> |
---|
| 441 | </listitem> |
---|
| 442 | <listitem> |
---|
| 443 | <para> |
---|
[1099] | 444 | MySQL backend : TODO |
---|
[862] | 445 | </para> |
---|
| 446 | </listitem> |
---|
| 447 | <listitem> |
---|
| 448 | <para> |
---|
| 449 | Berkeley DB backend : TODO |
---|
| 450 | </para> |
---|
| 451 | </listitem> |
---|
| 452 | </itemizedlist> |
---|
| 453 | </para> |
---|
| 454 | </listitem> |
---|
| 455 | <listitem> |
---|
| 456 | <para> |
---|
| 457 | <application>ucd-snmp</application> or <application>net-snmp</application> tools, version 4.2.5 or above. You only need |
---|
| 458 | the <application>snmpget</application> command. |
---|
[1168] | 459 | You can download this software from <ulink url="http://www.sourceforge.net/projects/net-snmp/">http://www.sourceforge.net/projects/net-snmp/</ulink>. |
---|
[959] | 460 | You only need this if you plan to query your printers for their internal page counter via SNMP. |
---|
[862] | 461 | </para> |
---|
| 462 | </listitem> |
---|
| 463 | <listitem> |
---|
| 464 | <para> |
---|
[959] | 465 | <application>netatalk</application> version 1.6.1 or above. You only need |
---|
| 466 | the <application>pap</application> command. |
---|
[1168] | 467 | You can download this software from <ulink url="http://netatalk.sourceforge.net/">http://netatalk.sourceforge.net/</ulink>. |
---|
[959] | 468 | You only need this if you plan to query your printers for their internal page counter via AppleTalk. |
---|
| 469 | </para> |
---|
| 470 | </listitem> |
---|
| 471 | <listitem> |
---|
| 472 | <para> |
---|
| 473 | eGenix' mxDateTime Python module version 2.0.3 or above. It must match your default Python version. |
---|
[862] | 474 | You can download it from <ulink url="http://www.egenix.com">http://www.egenix.com</ulink>. |
---|
| 475 | </para> |
---|
| 476 | </listitem> |
---|
| 477 | </itemizedlist> |
---|
[856] | 478 | </para> |
---|
[1168] | 479 | |
---|
| 480 | <para> |
---|
| 481 | Instead of downloading all these programs' sources and compiling them, which really |
---|
| 482 | is a boring task considering that many software are needed, you may prefer to look |
---|
| 483 | into the packages included with your GNU/Linux distribution of choice (if you use |
---|
| 484 | this operating system of course). Most, if not all, GNU/Linux distributions include |
---|
| 485 | all the software mentionned above, in the form of packages which are easier to |
---|
| 486 | install than sources tarballs. This is probably the same for the many *BSD |
---|
| 487 | distributions. |
---|
| 488 | </para> |
---|
| 489 | |
---|
| 490 | <para> |
---|
| 491 | Once all these software are installed, installing PyKota itself is a breeze. |
---|
| 492 | PyKota being written entirely in the Python language, which is interpreted, |
---|
| 493 | there's no need to compile anything. You just have to execute the installation |
---|
| 494 | script : |
---|
| 495 | <screen> |
---|
| 496 | $ python setup.py install |
---|
| 497 | </screen> |
---|
| 498 | </para> |
---|
| 499 | |
---|
| 500 | <para> |
---|
| 501 | The installation script will try to do a safe upgrade if needed. |
---|
| 502 | Also it will check if some needed software is missing or unavailable |
---|
| 503 | and will tell you so. This may be the case for example if you |
---|
| 504 | installed several versions of the Python language, and some Python |
---|
| 505 | modules are only available for one of them which is not the one you |
---|
| 506 | are actually running. |
---|
| 507 | </para> |
---|
| 508 | |
---|
| 509 | <para> |
---|
| 510 | On your first installation, the setup script will automatically create |
---|
| 511 | the <filename>/etc/pykota</filename> directory and put the sample |
---|
| 512 | configuration files <filename>conf/pykota.conf.sample</filename> and |
---|
| 513 | <filename>conf/pykotadmin.conf.sample</filename> there, after having |
---|
| 514 | renamed them respectively <filename>pykota.conf</filename> and |
---|
| 515 | <filename>pykotadmin.conf</filename>. Once copied there, you just |
---|
| 516 | have to modify these files to adapt them to your own setup. |
---|
| 517 | These files are heavily commented, so you should have no problem. |
---|
| 518 | Also their format is quite common, because it's the one used by |
---|
| 519 | <application>Samba</application> for example, or by <literal>.ini</literal> |
---|
| 520 | files under <application>MS-Windows</application>, so you may already |
---|
| 521 | be familiar with this syntax. |
---|
| 522 | In a future release, this documentation will include the complete |
---|
| 523 | reference for all configuration fields available. Keep in mind that |
---|
| 524 | PyKota can be really heavily customized, and can delegate some work |
---|
| 525 | to any external command of your choice. |
---|
| 526 | </para> |
---|
| 527 | |
---|
| 528 | <para> |
---|
| 529 | On later installations, the setup script won't modify any of your |
---|
| 530 | configuration files. However it will try to explain what have changed |
---|
| 531 | and encourages you to manually do the modifications which are needed. |
---|
| 532 | Please create a backup of the <filename>/etc/pykota</filename> |
---|
| 533 | directory before modifying anything. |
---|
| 534 | Under some circumstances, the setup PyKota may refuse to install PyKota |
---|
| 535 | until you have modified your configuration. Just do it and restart |
---|
| 536 | the installation script as described above. |
---|
| 537 | </para> |
---|
| 538 | |
---|
| 539 | <para> |
---|
| 540 | PyKota features some interesting possibilities which allow you to |
---|
| 541 | define options either globally so that they apply to all printers, |
---|
| 542 | or on a per printer basis. Please see the sample configuration files |
---|
| 543 | to see what I mean. In the simplest form, only a global section is |
---|
| 544 | needed. In more complex configurations, you will have to create |
---|
| 545 | one section per printer. Each section in the configuration files |
---|
| 546 | begins with a name between square brackets <literal>[]</literal>. |
---|
| 547 | The name to use to define a particular printer section is the name |
---|
| 548 | of the print queue on which you want to set quotas. |
---|
| 549 | </para> |
---|
| 550 | |
---|
| 551 | <para> |
---|
| 552 | After you have modified PyKota's configuration files, you have to |
---|
| 553 | double check their permissions, otherwise your installation may be |
---|
| 554 | insecure or may not work at all. |
---|
| 555 | The main configuration file <filename>/etc/pykota/pykota.conf</filename> |
---|
| 556 | doesn't contain much sensitive information, so it can be made |
---|
| 557 | readable by anyone. If normal users read this file, at best they |
---|
| 558 | will learn the username and optional password of the read-only |
---|
| 559 | database user, so they won't be allowed to do any harm. |
---|
| 560 | On the other hand, the <filename>/etc/pykota/pykotadmin.conf</filename> |
---|
| 561 | file contains the read-write user's identity and password. You must then |
---|
| 562 | ensure that no normal user can read this file. It should only be readable |
---|
| 563 | by the <literal>root</literal> user, which is always the case, by |
---|
| 564 | the user your printing system is running as, and optionally by the print administrators, |
---|
| 565 | who are usually members of the <literal>lpadmin</literal> group. Under my Debian GNU/Linux system, |
---|
| 566 | with CUPS, here's how to do to give the correct permissions : |
---|
| 567 | <screen> |
---|
| 568 | $ chown root.root /etc/pykota/pykota.conf |
---|
| 569 | $ chmod 644 /etc/pykota/pykota.conf |
---|
| 570 | $ chown lp.lpadmin /etc/pykota/pykotadmin.conf |
---|
| 571 | $ chmod 640 /etc/pykota/pykotadmin.conf |
---|
| 572 | </screen> |
---|
| 573 | </para> |
---|
| 574 | |
---|
| 575 | <para> |
---|
| 576 | Now depending on your printing system, the configuration to do is particular. |
---|
| 577 | We will now see how to plug PyKota into your printing system. |
---|
| 578 | </para> |
---|
| 579 | |
---|
| 580 | <sect2> |
---|
| 581 | <title>With CUPS</title> |
---|
| 582 | |
---|
| 583 | <para> |
---|
| 584 | The easiest way to configure PyKota to be used for a particular <application>CUPS</application> print queue, |
---|
| 585 | is to modify the <literal>PPD</literal> file associated with this print queue. |
---|
| 586 | Say you want to set quotas on the <literal>HPLaser</literal> print queue. You |
---|
| 587 | then just have to modify the file <filename>/etc/cups/ppd/HPLaser.ppd</filename>. |
---|
| 588 | You will have to add the following lines somewhere near the beginning of this file : |
---|
| 589 | <screen> |
---|
| 590 | *% Print Quota System |
---|
| 591 | *cupsFilter: "application/vnd.cups-postscript 0 /usr/bin/pykota" |
---|
| 592 | </screen> |
---|
| 593 | </para> |
---|
| 594 | |
---|
| 595 | <para> |
---|
| 596 | The first line is a comment. The second one tells <application>CUPS</application> |
---|
| 597 | to launch PyKota's accounting filter just before sending the print job to |
---|
| 598 | the printer's hardware. |
---|
| 599 | </para> |
---|
| 600 | |
---|
| 601 | <para> |
---|
| 602 | You have to restart <application>CUPS</application> for this modification to |
---|
| 603 | take effect : |
---|
| 604 | <screen> |
---|
| 605 | $ /etc/init.d/cupsys restart |
---|
| 606 | </screen> |
---|
| 607 | </para> |
---|
| 608 | |
---|
| 609 | <para> |
---|
| 610 | Repeat the above procedure for each print queue on which you want to use |
---|
| 611 | PyKota. That's all ! |
---|
| 612 | </para> |
---|
| 613 | |
---|
| 614 | <sect3> |
---|
| 615 | <title>Troubleshooting</title> |
---|
| 616 | <para> |
---|
| 617 | NB : the above procedure only works with <literal>PPD</literal> files which |
---|
| 618 | don't already contain an <literal>*cupsFilter</literal> line. PostScript |
---|
| 619 | printers usually don't need this line, but other types of printers may need |
---|
| 620 | it. A different procedure exists for such printers, but it is not actually |
---|
| 621 | documented. Search the mailing list archives at |
---|
| 622 | <ulink url="http://cgi.librelogiciel.com/mailman/listinfo/pykota"> |
---|
| 623 | http://cgi.librelogiciel.com/mailman/listinfo/pykota |
---|
| 624 | </ulink> to learn how to do. |
---|
| 625 | </para> |
---|
| 626 | |
---|
| 627 | <para> |
---|
| 628 | In case of problem, the simplest way to solve it is currently |
---|
| 629 | to ask on PyKota's mailing list, describing the symptoms, as |
---|
| 630 | well as the hardware and software you use. |
---|
| 631 | In a future release of this document, a section dedicated to |
---|
| 632 | Frequently Asked Questions will be included. |
---|
| 633 | </para> |
---|
| 634 | </sect3> |
---|
| 635 | |
---|
| 636 | </sect2> |
---|
| 637 | |
---|
| 638 | <sect2> |
---|
| 639 | <title>With LPRng</title> |
---|
| 640 | <para> |
---|
| 641 | To plug PyKota into your <application>LPRng</application> setup, |
---|
| 642 | you have to modify the <filename>/etc/printcap</filename>. |
---|
| 643 | You just have to add the following lines to each queue on |
---|
| 644 | which you want to use PyKota : |
---|
| 645 | <screen> |
---|
| 646 | :achk=true |
---|
| 647 | :as=|/usr/bin/pykota |
---|
| 648 | </screen> |
---|
| 649 | </para> |
---|
| 650 | |
---|
| 651 | <para> |
---|
| 652 | You have to restart <application>LPRng</application> for this modification to |
---|
| 653 | take effect : |
---|
| 654 | <screen> |
---|
| 655 | $ /etc/init.d/lprng restart |
---|
| 656 | </screen> |
---|
| 657 | </para> |
---|
| 658 | |
---|
| 659 | <para> |
---|
| 660 | Repeat the above procedure for each print queue on which you want to use |
---|
| 661 | PyKota. That's all ! |
---|
| 662 | </para> |
---|
| 663 | |
---|
| 664 | <sect3> |
---|
| 665 | <title>Troubleshooting</title> |
---|
| 666 | <para> |
---|
| 667 | In case of problem, the simplest way to solve it is currently |
---|
| 668 | to ask on PyKota's mailing list, describing the symptoms, as |
---|
| 669 | well as the hardware and software you use. |
---|
| 670 | In a future release of this document, a section dedicated to |
---|
| 671 | Frequently Asked Questions will be included. |
---|
| 672 | </para> |
---|
| 673 | </sect3> |
---|
| 674 | |
---|
| 675 | </sect2> |
---|
| 676 | |
---|
[856] | 677 | </sect1> |
---|
[753] | 678 | </chapter> |
---|
| 679 | |
---|
| 680 | <!-- |
---|
| 681 | |
---|
| 682 | $Log$ |
---|
[1168] | 683 | Revision 1.21 2003/10/14 20:26:53 jalet |
---|
| 684 | Better documentation. |
---|
| 685 | 1.15 is out ! |
---|
| 686 | |
---|
[1104] | 687 | Revision 1.20 2003/07/25 13:20:32 jalet |
---|
| 688 | Typo which wasn't |
---|
| 689 | |
---|
[1103] | 690 | Revision 1.19 2003/07/25 13:18:44 jalet |
---|
| 691 | Typos |
---|
| 692 | |
---|
[1099] | 693 | Revision 1.18 2003/07/25 10:41:29 jalet |
---|
| 694 | Better documentation. |
---|
| 695 | pykotme now displays the current user's account balance. |
---|
| 696 | Some test changed in ldap module. |
---|
| 697 | |
---|
[1052] | 698 | Revision 1.17 2003/06/30 21:44:18 jalet |
---|
| 699 | 1.09 is out ! |
---|
| 700 | |
---|
[1038] | 701 | Revision 1.16 2003/06/24 21:37:05 jalet |
---|
| 702 | Minor changes |
---|
| 703 | |
---|
[1021] | 704 | Revision 1.15 2003/06/10 16:37:54 jalet |
---|
| 705 | Deletion of the second user which is not needed anymore. |
---|
| 706 | Added a debug configuration field in /etc/pykota.conf |
---|
| 707 | All queries can now be sent to the logger in debug mode, this will |
---|
| 708 | greatly help improve performance when time for this will come. |
---|
| 709 | |
---|
[1015] | 710 | Revision 1.14 2003/06/05 07:12:29 jalet |
---|
| 711 | Reorganization of directories |
---|
| 712 | |
---|
[959] | 713 | Revision 1.13 2003/04/24 21:09:47 jalet |
---|
| 714 | Documentation slightly improved. |
---|
| 715 | |
---|
[942] | 716 | Revision 1.12 2003/04/17 21:33:16 jalet |
---|
| 717 | Version 1.03 is out. |
---|
| 718 | |
---|
[865] | 719 | Revision 1.11 2003/03/25 09:32:06 jalet |
---|
| 720 | Improved documentation. |
---|
| 721 | |
---|
[864] | 722 | Revision 1.10 2003/03/23 17:59:56 jalet |
---|
| 723 | Clarify a point. |
---|
| 724 | |
---|
[863] | 725 | Revision 1.9 2003/03/23 17:57:20 jalet |
---|
| 726 | Deleted a repetition. |
---|
| 727 | |
---|
[862] | 728 | Revision 1.8 2003/03/22 15:34:50 jalet |
---|
| 729 | More complete installation documentation. |
---|
| 730 | |
---|
[861] | 731 | Revision 1.7 2003/03/22 14:26:45 jalet |
---|
| 732 | Download instructions added. |
---|
| 733 | |
---|
[860] | 734 | Revision 1.6 2003/03/22 14:06:02 jalet |
---|
| 735 | Quota Storage Server installation is OK for PostgreSQL. |
---|
| 736 | |
---|
[859] | 737 | Revision 1.5 2003/03/22 13:11:33 jalet |
---|
| 738 | The port on which the Quota Storage Sever is listening can now |
---|
| 739 | be set in the configuration file (see sample). |
---|
| 740 | Better error handling if PygreSQL is not installed. |
---|
| 741 | Improved documentation. |
---|
| 742 | Version number changed to 1.02alpha |
---|
| 743 | |
---|
[858] | 744 | Revision 1.4 2003/03/22 07:20:38 jalet |
---|
| 745 | More information wrt PostgreSQL tcp/ip configuration. |
---|
| 746 | |
---|
[857] | 747 | Revision 1.3 2003/03/18 22:18:25 jalet |
---|
| 748 | The documentation will only be a sequence of chapters in a single part, not |
---|
| 749 | multiple parts each including chapters. |
---|
| 750 | |
---|
[856] | 751 | Revision 1.2 2003/03/18 22:10:54 jalet |
---|
| 752 | Documentation improvements. |
---|
| 753 | |
---|
[753] | 754 | Revision 1.1 2003/02/08 00:03:35 jalet |
---|
| 755 | Documentation skeleton added |
---|
| 756 | |
---|
| 757 | |
---|
| 758 | --> |
---|