[11381] | 1 | Installation of Kofa |
---|
| 2 | #################### |
---|
[10120] | 3 | |
---|
[17263] | 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 | |
---|
[11384] | 18 | |
---|
[11381] | 19 | Prerequisites |
---|
| 20 | ************* |
---|
[11323] | 21 | |
---|
[17264] | 22 | Installing `kofa` from sources on a local system involves many steps to meet |
---|
| 23 | all requirements, dependencies, etc. For quick setup we provide `docker`_ |
---|
| 24 | based installs which ease the whole setup procedure very much. |
---|
| 25 | |
---|
| 26 | There are, however, a few things, you should be aware of. Most important: |
---|
| 27 | `kofa` stores persistent data on disk, in an own `var/` directory. This |
---|
| 28 | directory keeps all files, database data and also log files. You must keep this |
---|
| 29 | directory if you want to keep your data. |
---|
| 30 | |
---|
| 31 | Starting with version 1.8, each release of `kofa` contains a `Dockerfile` in |
---|
| 32 | the sources root. You can use this file to build a dockerized version of |
---|
| 33 | `kofa`. But you can also use this file as a reference, how to build `kofa` from |
---|
| 34 | sources. |
---|
| 35 | |
---|
| 36 | Good to know and very important if you want to install the manual way: |
---|
[11381] | 37 | The Kofa packages are based on `Grok`_, which is a Python_ |
---|
[13075] | 38 | framework for agile web application development. Grok_ itself is based |
---|
[11381] | 39 | on `Zope`_. |
---|
[11323] | 40 | |
---|
[17264] | 41 | Both, Grok_ and Zope_, are written in the `Python`_ programming language (with |
---|
| 42 | parts written in C). For a source install you therefore have to have `Python`_ |
---|
| 43 | installed (including `Python`_ headers) in version 2.7 (Python 3.x is currently |
---|
| 44 | not supported). |
---|
[11323] | 45 | |
---|
[17264] | 46 | If you want to install using `docker` you of course need `docker` installed on |
---|
| 47 | your system. Please refer to your system documentation or to https://docker.com |
---|
| 48 | for details. |
---|
[11323] | 49 | |
---|
| 50 | |
---|
[17264] | 51 | Quick Install (dockerized) |
---|
| 52 | ************************** |
---|
[11323] | 53 | |
---|
[17264] | 54 | The Dockerfiles contained in our releases fetch sources from the central Python |
---|
| 55 | package repository `https://pypi.org/`. Visit the Dockerfile to learn, how you |
---|
| 56 | can build kofa from a local source tree. |
---|
[11323] | 57 | |
---|
[17264] | 58 | Go to the directory with the `Dockerfile` (we assume here, it is called |
---|
| 59 | `waeup.kofa`):: |
---|
[11323] | 60 | |
---|
[17264] | 61 | $ cd waeup.kofa |
---|
[11323] | 62 | |
---|
[17264] | 63 | Build `kofa` and tag the build, so you can tell different versions apart later |
---|
| 64 | on:: |
---|
[11527] | 65 | |
---|
[17264] | 66 | $ docker build -t kofa:latest . |
---|
[13690] | 67 | |
---|
[17264] | 68 | Please note the separated dot at the end of the command. |
---|
[11323] | 69 | |
---|
[17264] | 70 | Replace `kofa:latest` with any tag you find useful. Usual alternative tags |
---|
| 71 | would be: `kofa:1.8.1.dev0` or similar. But also `mybuild:foo` or just |
---|
| 72 | `mybuild` are valid tags. |
---|
[11323] | 73 | |
---|
[17264] | 74 | This command will take a lot of time and will perform all the steps, you would |
---|
| 75 | need to do to install `kofa` natively. |
---|
[11323] | 76 | |
---|
[17264] | 77 | If all works well, you can start a new `kofa` instance in foreground like this:: |
---|
[11323] | 78 | |
---|
[17264] | 79 | $ docker run --rm -it -p 8080:8080 -v kofadata1:/home/kofa/waeup.kofa/var kofa:latest |
---|
[11323] | 80 | |
---|
[17264] | 81 | Use the tag you picked before (here: `kofa:latest`) and connect to the running instance |
---|
| 82 | |
---|
| 83 | https://localhost:8080/ |
---|
| 84 | |
---|
| 85 | Your username and password will be `grok` and `grok`. |
---|
| 86 | |
---|
| 87 | Enter the credentials (username 'grok', password 'grok' by default) |
---|
| 88 | and name and add a `University`. |
---|
| 89 | |
---|
| 90 | Congratulations, you got Kofa running. |
---|
| 91 | |
---|
| 92 | |
---|
| 93 | What else can I do with `kofa` and Docker? |
---|
| 94 | ****************************************** |
---|
| 95 | |
---|
| 96 | Some remarks about the last `docker` command: |
---|
| 97 | `-v kofadata1:/home/kofa/waeup.kofa` keeps a persistent volume named `kofadata1` on |
---|
| 98 | your host. You do not have to know where this volume resides on your machine |
---|
| 99 | (while you can, if you insist). The containers using this volume can be |
---|
| 100 | discarded after use and you can of course keep multiple volumes in parallel on |
---|
| 101 | your system. |
---|
| 102 | |
---|
| 103 | You can stop the instance running in foreground pressing `CTRL-C`. |
---|
| 104 | |
---|
| 105 | Passing `--rm` to `docker` means to dispose a container after it stopped. |
---|
| 106 | |
---|
| 107 | |
---|
[17273] | 108 | Run `kofa` daemonized |
---|
| 109 | ********************* |
---|
[17264] | 110 | |
---|
| 111 | If you want to run `kofa` daemonized, use this:: |
---|
| 112 | |
---|
| 113 | $ docker run --rm -d -p 8080:8080 -v kofadata1:/home/kofa/waeup.kofa/var kofa:latest |
---|
| 114 | |
---|
| 115 | Instead of interactive (`-it`) we now use daemonized mode (`-d`). We also |
---|
| 116 | tunnel the containers port 8080 to our hosts port 8080 because otherwise we |
---|
| 117 | could not reach `kofa`. For security reasons it binds to containers localhost |
---|
| 118 | address by default. |
---|
| 119 | |
---|
| 120 | You can stop this instance with:: |
---|
| 121 | |
---|
| 122 | $ docker stop kofa:latest |
---|
| 123 | |
---|
| 124 | which will stop and destroy the running container. If you create a new |
---|
| 125 | container with the same volume data, all objects from the last run should be |
---|
| 126 | visible and usable. |
---|
| 127 | |
---|
| 128 | |
---|
| 129 | Enter the `kofa` filesystem inside container |
---|
| 130 | ******************************************** |
---|
| 131 | |
---|
[17273] | 132 | If an instance is running, you can enter the filesystem with for instance:: |
---|
[17264] | 133 | |
---|
| 134 | $ docker run --rm -it -v kofadata1:/home/kofa/waeup.kofa/var kofa:latest /bin/bash |
---|
| 135 | |
---|
| 136 | which will drop you into a shell inside the container. Your system credentials |
---|
| 137 | are by default `kofa` and `kofa`. |
---|
| 138 | |
---|
| 139 | |
---|
| 140 | Copy data in and out of the container |
---|
| 141 | ************************************* |
---|
| 142 | |
---|
| 143 | For backups etc. it is essential that you can copy data from or to the |
---|
| 144 | container. To do this, we mount a second local directory into the container and |
---|
[17273] | 145 | use that for transmitting data:: |
---|
[17264] | 146 | |
---|
| 147 | $ mkdir mybackup |
---|
| 148 | $ docker run --rm -it -v kofadata1:/home/kofa/waeup.kofa/var -v `pwd`/mybackup:/data kofa:latest cp -ar /home/kofa/waeup.kofa/var /mybackup |
---|
| 149 | |
---|
| 150 | which will copy the whole container-internal `var/`-directory into our local |
---|
| 151 | `mybackup` dir. |
---|
| 152 | |
---|
| 153 | |
---|
| 154 | How to start/stop `kofa` when running the native setup |
---|
| 155 | ****************************************************** |
---|
| 156 | |
---|
[17273] | 157 | Startup Kofa in foreground:: |
---|
[11323] | 158 | |
---|
[17263] | 159 | $ bin/kofactl fg |
---|
| 160 | # press CTRL-D to stop the kofa server |
---|
[11323] | 161 | |
---|
[17273] | 162 | Startup Kofa in background:: |
---|
[13830] | 163 | |
---|
[17263] | 164 | $ bin/kofactl start |
---|
| 165 | $ bin/kofactl status # check status, running or not |
---|
| 166 | $ bin/kofactl stop # stop running instance (also 'restart' possible) |
---|
[13830] | 167 | |
---|
[17264] | 168 | That should start you. |
---|
[13830] | 169 | |
---|
[17264] | 170 | Have fun with Kofa! |
---|
[13830] | 171 | |
---|
| 172 | |
---|
[17264] | 173 | .. _Debian: https://www.debian.org/ |
---|
| 174 | .. _docker: https:// |
---|
[11381] | 175 | .. _Grok: http://grok.zope.org/ |
---|
[17264] | 176 | .. _Python: https://www.python.org/ |
---|
| 177 | .. _Subversion: https://subversion.apache.org/ |
---|
| 178 | .. _Ubuntu: https://www.ubuntu.com/ |
---|
| 179 | .. _virtualenv: https://www.virtualenv.org/en/latest/ |
---|
[11381] | 180 | .. _WAeUP: https://www.waeup.org/ |
---|
[17264] | 181 | .. _Zope: https://www.zope.org/ |
---|
| 182 | .. _zc.buildout: https://pypi.org/project/zc.buildout |
---|
[17263] | 183 | |
---|