[11381] | 1 | Installation of Kofa |
---|
| 2 | #################### |
---|
[10120] | 3 | |
---|
[12967] | 4 | These are generic installation instructions for the WAeUP_ Kofa |
---|
[11381] | 5 | student information portal and customized versions thereof. |
---|
[10120] | 6 | |
---|
[11381] | 7 | For specific aspects of this package please refer to the local README |
---|
| 8 | file. |
---|
[10120] | 9 | |
---|
[11381] | 10 | Please note, that **only Linux-based installs** are described and actively |
---|
| 11 | supported. We recommend use of Debian_ / Ubuntu_. |
---|
[11323] | 12 | |
---|
[11381] | 13 | .. note:: This means we do not actively support Windows(tm)! |
---|
[11323] | 14 | |
---|
[12864] | 15 | .. contents:: Table of Contents |
---|
| 16 | :local: |
---|
[11323] | 17 | |
---|
[12968] | 18 | .. _prerequisites: |
---|
[11384] | 19 | |
---|
[13829] | 20 | |
---|
[15892] | 21 | Quick Install on Ubuntu 18.04 |
---|
| 22 | ***************************** |
---|
[13829] | 23 | |
---|
[14561] | 24 | If you want to install Kofa on a running Ubuntu system, the following quick |
---|
| 25 | steps might be sufficient:: |
---|
[13829] | 26 | |
---|
| 27 | ## install neccessary system packages as superuser |
---|
| 28 | $ sudo apt-get update && apt-get install -y # update system |
---|
[15892] | 29 | $ sudo apt-get install python2.7-dev libxml2-dev libxslt1-dev zlib1g-dev python-virtualenv libssl-dev libffi-dev libjpeg-dev libfreetype6-dev libtiff-dev libopenjp2-7-dev |
---|
[13829] | 30 | |
---|
| 31 | ## get sources as regular user |
---|
[14561] | 32 | $ wget https://pypi.python.org/packages/ed/0f/0b30fcf8c113b11967c1481668b38b4b9e32f256eb366f73b70ff960872f/waeup.kofa-1.5.tar.gz && tar -xzf waeup.kofa-1.5.tar.gz |
---|
| 33 | $ cd waeup.kofa-1.5 |
---|
[13829] | 34 | |
---|
| 35 | ## create python sandbox and build kofa |
---|
| 36 | $ virtualenv py27 |
---|
| 37 | $ source py27/bin/activate |
---|
| 38 | $ pip install --upgrade pip |
---|
| 39 | $ python bootstrap.py |
---|
| 40 | $ ./bin/buildout |
---|
| 41 | |
---|
| 42 | To run Kofa, now do:: |
---|
| 43 | |
---|
| 44 | ## startup Kofa in foreground (recommended for first start) |
---|
| 45 | $ ./bin/kofactl fg |
---|
| 46 | ## press CTRL-D to stop the kofa server |
---|
| 47 | |
---|
| 48 | ## startup Kofa in background |
---|
| 49 | $ ./bin/kofactl start |
---|
| 50 | $ ./bin/kofactl status # check status, running or not |
---|
| 51 | $ ./bin/kofactl stop # stop running instance (also 'restart' possible) |
---|
| 52 | |
---|
| 53 | When Kofa is running, you can access the portal on port 8080. Open |
---|
| 54 | |
---|
| 55 | http://localhost:8080/ |
---|
| 56 | |
---|
| 57 | and enter the credentials (username 'grok', password 'grok' by |
---|
| 58 | default) and name and add a `University`. |
---|
| 59 | |
---|
| 60 | Congratulations, you got Kofa running. |
---|
| 61 | |
---|
| 62 | |
---|
[11381] | 63 | Prerequisites |
---|
| 64 | ************* |
---|
[11323] | 65 | |
---|
[11381] | 66 | The Kofa packages are based on `Grok`_, which is a Python_ |
---|
[13075] | 67 | framework for agile web application development. Grok_ itself is based |
---|
[11381] | 68 | on `Zope`_. |
---|
[11323] | 69 | |
---|
[11381] | 70 | Both, Grok_ and Zope_, are written in the `Python`_ programming |
---|
| 71 | language (with parts written in C). You therefore have to have |
---|
[13829] | 72 | `Python`_ installed (including `Python`_ headers) in version 2.7 |
---|
| 73 | (Python 3.x is currently not supported). |
---|
[11323] | 74 | |
---|
| 75 | |
---|
[11381] | 76 | Preparing the System |
---|
[11323] | 77 | ==================== |
---|
| 78 | |
---|
[12967] | 79 | For a Kofa install we need of course `Python`_ installed as well as |
---|
[11381] | 80 | some standard developer tools like C compilers, C libraries, etc. |
---|
[11323] | 81 | |
---|
| 82 | What you need (Debian/Ubuntu package names in brackets): |
---|
| 83 | |
---|
[11381] | 84 | * Python 2.7 (``python2.7``) |
---|
[11323] | 85 | |
---|
[11381] | 86 | * Python 2.7 development files (``python2.7-dev``) |
---|
[11323] | 87 | |
---|
[11381] | 88 | * A C-Compiler with basic C developer libraries (``build-essential``) |
---|
[11323] | 89 | |
---|
[11527] | 90 | * A subversion client (``subversion``) |
---|
[11323] | 91 | |
---|
[11527] | 92 | * XML and XSLT development libraries (``libxml2-dev``, ``libxslt1-dev``) |
---|
| 93 | |
---|
[13690] | 94 | * Other helper libraries, especially for image processing support |
---|
| 95 | (``zlib1g-dev``, ``libssl-dev``, ``libffi-dev``, ``libjpeg-dev``, |
---|
| 96 | ``libfreetype6-dev``, ``libtiff-dev`` ``libopenjpeg-dev``) |
---|
| 97 | |
---|
[11381] | 98 | * enscript (``enscript``) [optional] |
---|
[11323] | 99 | |
---|
| 100 | This is only needed if you want test coverage reports. |
---|
| 101 | |
---|
| 102 | All these packages can be installed on Debian systems like this:: |
---|
| 103 | |
---|
[11527] | 104 | $ sudo apt-get install python2.7 python2.7-dev subversion \ |
---|
[13690] | 105 | build-essential enscript libxml2-dev libxslt1-dev \ |
---|
[13698] | 106 | zlib1g-dev libssl-dev libffi-dev libjpeg-dev \ |
---|
| 107 | libfreetype6-dev libtiff-dev libopenjpeg-dev |
---|
[11323] | 108 | |
---|
| 109 | Afterwards you should be able to enter:: |
---|
| 110 | |
---|
| 111 | $ python2.7 |
---|
| 112 | |
---|
[11381] | 113 | at the commandline and get a Python_ prompt. Quit the interpreter |
---|
[11323] | 114 | pressing <CTRL-D>. |
---|
| 115 | |
---|
[13690] | 116 | The above packages have been tested to be sufficient for running Kofa |
---|
[14561] | 117 | on Ubuntu. We check this with Docker images created at |
---|
[11323] | 118 | |
---|
[13690] | 119 | https://github.com/WAeUP/kofa-docker |
---|
| 120 | |
---|
| 121 | This project provides tags that refer to certain Kofa versions. |
---|
| 122 | |
---|
| 123 | Please note: to make freetype2 work correctly with Kofa [#]_, you have to |
---|
| 124 | fix a link:: |
---|
| 125 | |
---|
| 126 | (root) $ ln -s /usr/include/freetype2 /usr/include/freetype2/freetype |
---|
| 127 | |
---|
| 128 | |
---|
| 129 | |
---|
| 130 | |
---|
[11323] | 131 | Installing `virtualenv` |
---|
| 132 | ======================= |
---|
| 133 | |
---|
[11382] | 134 | We strongly suggest use of `virtualenv`_ to create Python_ sandboxes |
---|
| 135 | where you can run your code without touching any other installations. |
---|
[11323] | 136 | |
---|
[12967] | 137 | `virtualenv`_ is also the only possibility to build a Kofa install |
---|
[11382] | 138 | without the need of superuser permissions. In short: `virtualenv`_ |
---|
| 139 | will make your life easier. Use it. |
---|
[11323] | 140 | |
---|
[11382] | 141 | Detailed install instructions for `virtualenv`_ can be found on |
---|
| 142 | http://www.virtualenv.org/en/latest/virtualenv.html#installation. |
---|
[11323] | 143 | |
---|
[11382] | 144 | The short way for a user install (no superuser perms required) is like |
---|
| 145 | this:: |
---|
[11323] | 146 | |
---|
[11382] | 147 | $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.11.4.tar.gz#md5=9accc2d3f0ec1da479ce2c3d1fdff06e |
---|
| 148 | $ tar xvfz virtualenv-1.11.4.tar.gz |
---|
| 149 | $ cd virtualenv-1.11.4 |
---|
| 150 | $ python virtualenv.py py27 |
---|
[11323] | 151 | |
---|
[11382] | 152 | Superusers can install `virtualenv`_ system-wide much easier. On |
---|
| 153 | `Debian`_/`Ubuntu`_ systems where you have superuser permissions, you |
---|
| 154 | can install `virtualenv`_ via:: |
---|
[11323] | 155 | |
---|
[11382] | 156 | $ sudo apt-get install python-virtualenv |
---|
[11323] | 157 | |
---|
[13826] | 158 | *Or*, they install if `pip` first:: |
---|
[11323] | 159 | |
---|
[13826] | 160 | $ sudo apt-get install python-pip |
---|
| 161 | |
---|
| 162 | and then use `pip` to install `virtualenv`_:: |
---|
| 163 | |
---|
[11382] | 164 | $ sudo pip install virtualenv |
---|
[11323] | 165 | |
---|
| 166 | |
---|
[11402] | 167 | Creating a Sandbox |
---|
[11323] | 168 | ================== |
---|
| 169 | |
---|
[11383] | 170 | After installing `virtualenv`_ you can install local sandboxes like |
---|
[11401] | 171 | this (if `virtualenv` is installed system-wide):: |
---|
[11323] | 172 | |
---|
[11383] | 173 | $ virtualenv --no-site-packages py27 |
---|
[11323] | 174 | |
---|
[11401] | 175 | *or* like this:: |
---|
| 176 | |
---|
| 177 | $ python /path/to/my/virtualenv.py --no-site-packages py27 |
---|
| 178 | |
---|
[11383] | 179 | where ``py27`` is a directory in the filesystem where your sandbox |
---|
| 180 | will be created. `virtualenv` will also create this directory for |
---|
[11401] | 181 | you. While you can pick any sandbox name you want, it is recommended |
---|
| 182 | to use a sandbox name that is short and at the same time reflects the |
---|
| 183 | Python version used (here: Python 2.7). |
---|
[11323] | 184 | |
---|
| 185 | By passing the ``no-site-packages`` switch we tell `virtualenv` to |
---|
[11401] | 186 | provide a clean environment without any extra-packages installed |
---|
[11383] | 187 | systemwide. More recent versions of `virtualenv`_ have this option set |
---|
| 188 | by default. |
---|
[11323] | 189 | |
---|
[11383] | 190 | Another often used option of `virtualenv`_ is ``-p``. With ``-p`` you |
---|
| 191 | can tell `virtualenv`_ which Python executable to use as base for the |
---|
| 192 | new sandbox. |
---|
| 193 | |
---|
[11323] | 194 | You now can activate the sandbox by doing:: |
---|
| 195 | |
---|
[11383] | 196 | $ source py27/bin/activate |
---|
| 197 | (py27)$ |
---|
[11323] | 198 | |
---|
[11401] | 199 | You will notice that the input prompt changes, indicating the name of |
---|
| 200 | the sandbox activated. |
---|
[11323] | 201 | |
---|
| 202 | To deactivate the sandbox at any time, enter:: |
---|
| 203 | |
---|
[11383] | 204 | (py27)$ deactivate |
---|
[11323] | 205 | |
---|
| 206 | and the prompt will be the same as before the activation. |
---|
| 207 | |
---|
| 208 | For the following steps make sure the sandbox is active. |
---|
| 209 | |
---|
| 210 | |
---|
[11402] | 211 | Getting the Sources |
---|
| 212 | =================== |
---|
[11323] | 213 | |
---|
[11401] | 214 | Now, as the sandbox is activated (see above, if not), we can fetch the |
---|
| 215 | sources for Kofa. |
---|
[11323] | 216 | |
---|
[13830] | 217 | Source from PyPI |
---|
| 218 | ---------------- |
---|
[11323] | 219 | |
---|
[13830] | 220 | Official releases are always uploaded to PyPI. Please have a look at |
---|
| 221 | |
---|
| 222 | http://pypi.python.org/pypi/waeup.kofa |
---|
| 223 | |
---|
| 224 | where you can download all you need. |
---|
| 225 | |
---|
| 226 | From the commandline you can also get sources like this:: |
---|
| 227 | |
---|
[14561] | 228 | (py27)$ wget https://pypi.python.org/packages/source/w/waeup.kofa/waeup.kofa-1.5.tar.gz |
---|
[13830] | 229 | |
---|
[14561] | 230 | where ``1.5`` is, of course, only one possible version. |
---|
[13830] | 231 | |
---|
| 232 | |
---|
| 233 | Source from Subversion |
---|
| 234 | ---------------------- |
---|
| 235 | |
---|
| 236 | If you have access to the (restricted) developer repository (if you |
---|
| 237 | don't know, then you have not), then you can use the Subversion_ |
---|
| 238 | client `svn` and checkout the main devel branch of the `waeup.kofa` |
---|
| 239 | package like this:: |
---|
| 240 | |
---|
[11401] | 241 | (py27)$ svn co https://svn.waeup.org/repos/main/waeup.kofa/trunk |
---|
[11323] | 242 | |
---|
| 243 | The command should fetch the Kofa base package sources for you and |
---|
[11401] | 244 | will put everything in a new directory ``trunk/``. |
---|
[11323] | 245 | |
---|
| 246 | Now enter the new directory:: |
---|
| 247 | |
---|
[11401] | 248 | (py27)$ cd trunk/ |
---|
[11323] | 249 | |
---|
[11401] | 250 | and you can start building the real package. |
---|
[11323] | 251 | |
---|
[11401] | 252 | .. note:: If you not want to work with the `waeup.kofa` package but a |
---|
| 253 | customized package (like ``waeup.aaue`` or similar), then |
---|
| 254 | you can use the above checkout command but with |
---|
| 255 | ``waeup.kofa`` replaced by the name of the customized |
---|
| 256 | package:: |
---|
[11381] | 257 | |
---|
[11401] | 258 | (py27)$ svn co https://svn.waeup.org/repos/main/<PKG-NAME>/trunk |
---|
[11381] | 259 | |
---|
[11401] | 260 | For the exact link, please refer to the README.txt file in |
---|
| 261 | your package. |
---|
| 262 | |
---|
| 263 | |
---|
[11402] | 264 | Bootstrapping the Build |
---|
| 265 | ======================= |
---|
| 266 | |
---|
| 267 | After `Creating a Sandbox`_ and `Getting the Sources`_ we have to |
---|
| 268 | initialize the newly created development environment:: |
---|
| 269 | |
---|
| 270 | (py27)$ python bootstrap.py |
---|
| 271 | |
---|
| 272 | This should create a local ``bin/`` directory with at least a script |
---|
| 273 | ``buildout`` in it. |
---|
| 274 | |
---|
| 275 | If bootstrapping fails, chances are, that you need the `distribute` |
---|
| 276 | package installed. In a virtual environment you can install it without |
---|
[11703] | 277 | interfering with other packages installed on your server:: |
---|
[11402] | 278 | |
---|
| 279 | (py27)$ pip install --upgrade distribute |
---|
| 280 | |
---|
| 281 | Afterwards you have to retry the bootstrapping, until you get a |
---|
| 282 | working ``buildout`` script in the local ``bin/`` directory. |
---|
| 283 | |
---|
| 284 | Once the ``buildout`` script exists, you do not have to activate the |
---|
| 285 | virtual envronment any more (although you can). |
---|
| 286 | |
---|
| 287 | |
---|
[11381] | 288 | Part 1: Single Client Setup |
---|
| 289 | *************************** |
---|
| 290 | |
---|
[12967] | 291 | You can run Kofa with a single client (useful for evaluation, |
---|
[11401] | 292 | development, etc.) or with multiple clients running in parallel. The |
---|
| 293 | latter setup is useful in productive environments with many thousands |
---|
[11402] | 294 | users and called a ``ZEO`` install. We will cover both setup |
---|
| 295 | types. The first is covered here, the latter one is covered in `Part |
---|
| 296 | 2: ZEO Install`_. |
---|
[11401] | 297 | |
---|
[11402] | 298 | |
---|
[11404] | 299 | Building the Package |
---|
| 300 | ==================== |
---|
[11323] | 301 | |
---|
[11404] | 302 | In the sources directory (``trunk/``) you have to prepare the |
---|
[11323] | 303 | project to fetch needed components (eggs), compile C-code parts, |
---|
[11404] | 304 | etc. This is done by a single command ``buildout``:: |
---|
[11323] | 305 | |
---|
[11404] | 306 | $ ./bin/buildout |
---|
[11323] | 307 | |
---|
| 308 | If this is your first install of some Grok-related project, this step |
---|
| 309 | will need some time as lots of sources have to be fetched, many |
---|
| 310 | components must be compiled, etc. |
---|
| 311 | |
---|
| 312 | This step must be redone whenever you change something in |
---|
[11404] | 313 | ``buildout.cfg``, ``buildout-zeo.cfg``, or ``setup.py``. |
---|
[11323] | 314 | |
---|
| 315 | Note that if you have more than one sandbox for a Zope-based web |
---|
| 316 | application, it will probably make sense to share the eggs between the |
---|
| 317 | different sandboxes. You can tell ``zc.buildout`` to use a central |
---|
| 318 | eggs directory by creating ``~/.buildout/default.cfg`` with the |
---|
| 319 | following contents:: |
---|
| 320 | |
---|
[11385] | 321 | [buildout] |
---|
| 322 | eggs-directory = /home/bruno/buildout-eggs |
---|
[11323] | 323 | |
---|
[11404] | 324 | where the given directory should be exist beforehand. All eggs of all |
---|
| 325 | `buildout` projects will then be stored in this directory (and not |
---|
| 326 | fetched anew if already existing there). |
---|
[11323] | 327 | |
---|
[11404] | 328 | |
---|
| 329 | Start the Instance |
---|
[11323] | 330 | ================== |
---|
| 331 | |
---|
| 332 | You should be able now to start the created instance by doing:: |
---|
| 333 | |
---|
[11404] | 334 | $ ./bin/kofactl fg |
---|
[11323] | 335 | |
---|
[11385] | 336 | Alternatively you can do:: |
---|
[11323] | 337 | |
---|
[11404] | 338 | $ bin/paster serve parts/etc/deploy-themed.ini |
---|
[11323] | 339 | |
---|
| 340 | The port numbers where Kofa is running on your server are defined in |
---|
[11404] | 341 | `buildout.cfg` under ``[kofa_params]``. |
---|
[11323] | 342 | |
---|
[11404] | 343 | If you now point a browser to the right port on your server, for example:: |
---|
[11323] | 344 | |
---|
[11385] | 345 | localhost:8080 |
---|
[11323] | 346 | |
---|
| 347 | you should get a login pop-up, where you can login as superuser with |
---|
| 348 | ``grok`` and ``grok`` as username/password (Kofa base package only!). |
---|
| 349 | |
---|
| 350 | You can stop the instance by pressing <CTRL-C>. |
---|
| 351 | |
---|
| 352 | If you are connected and logged in, |
---|
| 353 | you should be able to add the grok-based applications |
---|
| 354 | (such as ``University``) from the menu. |
---|
| 355 | |
---|
| 356 | Add an instance of ``University`` and click on the link next to the |
---|
| 357 | then visible entry in the list of installed applications. |
---|
| 358 | |
---|
[11404] | 359 | Running the Tests |
---|
[11323] | 360 | ================= |
---|
| 361 | |
---|
[11404] | 362 | All WAeUP_ packages come with comprehensive test suites ensuring the |
---|
| 363 | software quality also after changes and updates. |
---|
[11323] | 364 | |
---|
[11404] | 365 | The package tests are easily run by executing the test runner |
---|
| 366 | from the ``bin`` directory:: |
---|
[11323] | 367 | |
---|
[11404] | 368 | $ ./bin/test |
---|
[11323] | 369 | |
---|
[11404] | 370 | Use the ``-c`` option to get coloured output. Use the ``--pdb`` option |
---|
| 371 | to start the Python_ debugger when a test fails. |
---|
| 372 | |
---|
| 373 | |
---|
[11402] | 374 | Part 2: ZEO Install |
---|
| 375 | ******************* |
---|
[11323] | 376 | |
---|
| 377 | Each ZEO install consists of at least one ZEO server and normally two |
---|
| 378 | or more ZEO clients. While the ZEO server is meant to manage the ZODB |
---|
| 379 | database for clients, the clients connect to the outside world, listen |
---|
| 380 | for request and do the real dataprocessing. |
---|
| 381 | |
---|
| 382 | We prepared a `buildout` configuration that sets up one server |
---|
| 383 | configuration and two client configs. This configuration is in |
---|
| 384 | ``buildout-zeo.cfg``. |
---|
| 385 | |
---|
[11405] | 386 | Generating the ZEO Setup |
---|
[11323] | 387 | ======================== |
---|
| 388 | |
---|
| 389 | To install Kofa ZEO-based you can run `buildout` with the given |
---|
| 390 | (or your own) configuration file like this:: |
---|
| 391 | |
---|
| 392 | $ ./bin/buildout -c buildout-zeo.cfg |
---|
| 393 | |
---|
| 394 | This should generate all scripts necessary to run servers, clients, |
---|
| 395 | etc. |
---|
| 396 | |
---|
[11405] | 397 | Starting ZEO Servers and Clients |
---|
[11323] | 398 | ================================ |
---|
| 399 | |
---|
| 400 | First start the server:: |
---|
| 401 | |
---|
| 402 | $ ./bin/zeo_server start |
---|
| 403 | |
---|
| 404 | Clients can be started by doing:: |
---|
| 405 | |
---|
| 406 | $ ./bin/zeo_client1 start |
---|
| 407 | $ ./bin/zeo_client2 start |
---|
| 408 | |
---|
| 409 | This will start both clients in daemon mode. |
---|
| 410 | |
---|
| 411 | Instead of ``start`` you can, as usually, start an instance in |
---|
| 412 | foreground (``fg``), etc. You know the drill. |
---|
| 413 | |
---|
| 414 | |
---|
[11405] | 415 | Manually Starting ZEO Clients |
---|
[11323] | 416 | ============================= |
---|
| 417 | |
---|
| 418 | This is normally not neccessary. |
---|
| 419 | |
---|
| 420 | ``zeo_clientN`` scripts are basically wrappers around calls to |
---|
| 421 | ``bin/paster``. You can bypass this wrapper and start a client |
---|
| 422 | 'manually' like this:: |
---|
| 423 | |
---|
| 424 | $ ./bin/paster serve --pid-file var/zeo1.pid --daemon \ |
---|
| 425 | pars/etc/zeo1.ini |
---|
| 426 | |
---|
[11405] | 427 | It is important to give a pid-file as `paster` otherwise can not start |
---|
[11323] | 428 | different clients (they would all refer to the same pid file |
---|
| 429 | `paster.pid` and refuse to start after the first client was started). |
---|
| 430 | |
---|
| 431 | |
---|
[13270] | 432 | Setup (parameters, ports, etc.) |
---|
| 433 | =============================== |
---|
[11323] | 434 | |
---|
| 435 | By default the server will listen on port 8100 for requests from |
---|
| 436 | localhost (not: from the outside world). |
---|
| 437 | |
---|
| 438 | You can change ZEO server settings in the ``[zeo_server]`` section |
---|
| 439 | of ``buildout-zeo.conf``. Run `buildout` afterwards. |
---|
| 440 | |
---|
| 441 | The clients will listen on port 8081 and 8082. You can change settings |
---|
| 442 | in ``etc/zeo1.ini.in`` and ``etc/zeo2.ini.in`` respectively. Run |
---|
| 443 | buildout after any change. |
---|
| 444 | |
---|
| 445 | If you want to change the paster wrapper for any zeo client, you can |
---|
| 446 | edit ``etc/zeo1.conf`` and/or ``etc/zeo2.conf``. Run buildout |
---|
| 447 | afterwards. |
---|
| 448 | |
---|
| 449 | |
---|
[11405] | 450 | Stopping ZEO Servers and Clients |
---|
| 451 | ================================ |
---|
[11323] | 452 | |
---|
[11405] | 453 | Given everything was started in daemon mode, first stop the clients:: |
---|
[11323] | 454 | |
---|
[11405] | 455 | $ ./bin/zeo_client1 stop |
---|
| 456 | $ ./bin/zeo_client2 stop |
---|
[11323] | 457 | |
---|
[11405] | 458 | Then stop the ZEO server:: |
---|
| 459 | |
---|
| 460 | $ ./bin/zeo_server stop |
---|
| 461 | |
---|
| 462 | |
---|
| 463 | Creating New ZEO Clients |
---|
| 464 | ======================== |
---|
| 465 | |
---|
| 466 | You want more ZEO clients to be created by `buildout`? Easy. Three |
---|
| 467 | steps are neccessary. |
---|
| 468 | |
---|
| 469 | 1. Create config files in `etc/` |
---|
| 470 | -------------------------------- |
---|
| 471 | |
---|
[11323] | 472 | Each client needs two configuration files: |
---|
| 473 | |
---|
| 474 | - ``etc/zeoN.conf`` |
---|
| 475 | configuring the paster wrapper |
---|
| 476 | |
---|
| 477 | - ``etc/zeoN.ini`` |
---|
| 478 | configuring the runtime config, ports, etc. |
---|
| 479 | |
---|
| 480 | Just copy over these files from the already existing zeo1/zeo2 files |
---|
| 481 | and replace ``zeo1`` or ``zeo2`` with your new name. |
---|
| 482 | |
---|
| 483 | 2. Update buildout-zeo.cfg |
---|
| 484 | -------------------------- |
---|
| 485 | |
---|
| 486 | Here, inside ``buildourt-zeo.cfg`` also three steps are needed. |
---|
| 487 | |
---|
| 488 | * 2.1. Create new .ini and .conf entries |
---|
| 489 | |
---|
| 490 | The .conf and .ini files in etc/ are only templates that have to be |
---|
| 491 | generated in their really used final location. In buildout-zeo.cfg |
---|
| 492 | you can care for this by creating a new ``[zeoN_ini]`` and |
---|
| 493 | ``[zeoN_conf]`` option (replacing ``N`` with a number, of course). |
---|
| 494 | |
---|
| 495 | Just copy over existing entries and replace the mentions of ``zeo1`` |
---|
| 496 | or ``zeo2`` by your ``zeoN``. |
---|
| 497 | |
---|
| 498 | * 2.2. Create a new ``zeo_clientN`` entry |
---|
| 499 | |
---|
| 500 | Then you have to create an entry that will generate the |
---|
| 501 | ``zeo_clientN`` script. Again, just copy over an existing |
---|
| 502 | ``[zeo_client1]`` entry and replace ``1`` withg your client number. |
---|
| 503 | |
---|
| 504 | * 2.3. Register the new sections in ``[buildout]`` section |
---|
| 505 | |
---|
| 506 | When done with the above: add the new section in ``[buildout]``:: |
---|
| 507 | |
---|
| 508 | [buildout] |
---|
| 509 | ... |
---|
| 510 | <old entries...> |
---|
| 511 | ... |
---|
| 512 | zope_conf_zeo_5 |
---|
| 513 | zeo5_ini |
---|
| 514 | zeo_client5 |
---|
| 515 | |
---|
| 516 | depending on how you named your new sections. |
---|
| 517 | |
---|
| 518 | 3. Rerun ``buildout`` |
---|
| 519 | --------------------- |
---|
| 520 | |
---|
| 521 | When adding or removing client/server instances, make sure to stop all |
---|
| 522 | running servers/clients before rerunning buildout. |
---|
| 523 | |
---|
| 524 | To activate the new setup, rerun buildout:: |
---|
| 525 | |
---|
| 526 | $ bin/buildout -c buildout-zeo.cfg |
---|
| 527 | |
---|
| 528 | This should generate any new clients and remove older ones or just |
---|
| 529 | update configuration files. |
---|
| 530 | |
---|
| 531 | |
---|
| 532 | Considerations |
---|
| 533 | ============== |
---|
| 534 | |
---|
| 535 | There are some things in the current buildout-zeo.cfg we might do not |
---|
| 536 | want. It extends the regular ``buildout.cfg`` so that we do not have |
---|
| 537 | to repeat most sections but the ``parts`` in ``[buildout]`` have to be |
---|
| 538 | listed. |
---|
| 539 | |
---|
| 540 | We need, however, not everything with a ZEO-deploy that is listed in a |
---|
| 541 | default buildout. We might do not need docs, no profiling, etc. Also a |
---|
| 542 | regular non-ZEO kofactl might not make to much sense. Therefore all |
---|
| 543 | this might be subject to changes. |
---|
[11381] | 544 | |
---|
| 545 | .. _Debian: http://www.debian.org/ |
---|
| 546 | .. _Grok: http://grok.zope.org/ |
---|
| 547 | .. _Python: http://www.python.org/ |
---|
[11401] | 548 | .. _Subversion: http://subversion.apache.org/ |
---|
[11381] | 549 | .. _Ubuntu: http://www.ubuntu.com/ |
---|
| 550 | .. _virtualenv: http://www.virtualenv.org/en/latest/ |
---|
| 551 | .. _WAeUP: https://www.waeup.org/ |
---|
| 552 | .. _Zope: http://www.zope.org/ |
---|
| 553 | .. _zc.buildout: http://cheeseshop.python.org/pypi/zc.buildout |
---|
[13690] | 554 | .. [#] Strictly speaking, this link fix is required by ``Pillow``, a |
---|
| 555 | library used by Kofa to provide higher-level image processing. |
---|