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