1 | Installation of Kofa |
---|
2 | #################### |
---|
3 | |
---|
4 | These are generic installation instructions for the WAeUP.Kofa |
---|
5 | student information portal and customized versions thereof. |
---|
6 | |
---|
7 | For specific aspects of this package please refer to the local README |
---|
8 | file. |
---|
9 | |
---|
10 | Please note, that **only Linux-based installs** are described and actively |
---|
11 | supported. We recommend use of Debian_ / Ubuntu_. |
---|
12 | |
---|
13 | .. note:: This means we do not actively support Windows(tm)! |
---|
14 | |
---|
15 | .. contents:: Table of Contents |
---|
16 | :local: |
---|
17 | |
---|
18 | |
---|
19 | Prerequisites |
---|
20 | ************* |
---|
21 | |
---|
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: |
---|
37 | The Kofa packages are based on `Grok`_, which is a Python_ |
---|
38 | framework for agile web application development. Grok_ itself is based |
---|
39 | on `Zope`_. |
---|
40 | |
---|
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). |
---|
45 | |
---|
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. |
---|
49 | |
---|
50 | |
---|
51 | Quick Install (dockerized) |
---|
52 | ************************** |
---|
53 | |
---|
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. |
---|
57 | |
---|
58 | Go to the directory with the `Dockerfile` (we assume here, it is called |
---|
59 | `waeup.kofa`):: |
---|
60 | |
---|
61 | $ cd waeup.kofa |
---|
62 | |
---|
63 | You might want to create a `var/` directory to keep the persisted data later:: |
---|
64 | |
---|
65 | $ mkdir var/ |
---|
66 | |
---|
67 | Build `kofa` and tag the build, so you can tell different versions apart later |
---|
68 | on:: |
---|
69 | |
---|
70 | $ docker build -t kofa:latest . |
---|
71 | |
---|
72 | Please note the separated dot at the end of the command. |
---|
73 | |
---|
74 | Replace `kofa:latest` with any tag you find useful. Usual alternative tags |
---|
75 | would be: `kofa:1.8.1.dev0` or similar. But also `mybuild:foo` or just |
---|
76 | `mybuild` are valid tags. |
---|
77 | |
---|
78 | This command will take a lot of time and will perform all the steps, you would |
---|
79 | need to do to install `kofa` natively. |
---|
80 | |
---|
81 | If all works well, you can start a new `kofa` instance in foreground like this:: |
---|
82 | |
---|
83 | $ docker run --rm -it -p 8080:8080 -v kofadata1:/home/kofa/waeup.kofa/var kofa:latest |
---|
84 | |
---|
85 | Use the tag you picked before (here: `kofa:latest`) and connect to the running instance |
---|
86 | |
---|
87 | https://localhost:8080/ |
---|
88 | |
---|
89 | Your username and password will be `grok` and `grok`. |
---|
90 | |
---|
91 | Enter the credentials (username 'grok', password 'grok' by default) |
---|
92 | and name and add a `University`. |
---|
93 | |
---|
94 | Congratulations, you got Kofa running. |
---|
95 | |
---|
96 | |
---|
97 | What else can I do with `kofa` and Docker? |
---|
98 | ****************************************** |
---|
99 | |
---|
100 | Some remarks about the last `docker` command: |
---|
101 | `-v kofadata1:/home/kofa/waeup.kofa` keeps a persistent volume named `kofadata1` on |
---|
102 | your host. You do not have to know where this volume resides on your machine |
---|
103 | (while you can, if you insist). The containers using this volume can be |
---|
104 | discarded after use and you can of course keep multiple volumes in parallel on |
---|
105 | your system. |
---|
106 | |
---|
107 | You can stop the instance running in foreground pressing `CTRL-C`. |
---|
108 | |
---|
109 | Passing `--rm` to `docker` means to dispose a container after it stopped. |
---|
110 | |
---|
111 | |
---|
112 | Run `kofa` daemonized |
---|
113 | ********************* |
---|
114 | |
---|
115 | If you want to run `kofa` daemonized, use this:: |
---|
116 | |
---|
117 | $ docker run --rm -d -p 8080:8080 -v kofadata1:/home/kofa/waeup.kofa/var kofa:latest |
---|
118 | |
---|
119 | Instead of interactive (`-it`) we now use daemonized mode (`-d`). We also |
---|
120 | tunnel the containers port 8080 to our hosts port 8080 because otherwise we |
---|
121 | could not reach `kofa`. For security reasons it binds to containers localhost |
---|
122 | address by default. |
---|
123 | |
---|
124 | You can stop this instance with:: |
---|
125 | |
---|
126 | $ docker stop kofa:latest |
---|
127 | |
---|
128 | which will stop and destroy the running container. If you create a new |
---|
129 | container with the same volume data, all objects from the last run should be |
---|
130 | visible and usable. |
---|
131 | |
---|
132 | |
---|
133 | Enter the `kofa` filesystem inside container |
---|
134 | ******************************************** |
---|
135 | |
---|
136 | If an instance is running, you can enter the filesystem with for instance:: |
---|
137 | |
---|
138 | $ docker run --rm -it -v kofadata1:/home/kofa/waeup.kofa/var kofa:latest /bin/bash |
---|
139 | |
---|
140 | which will drop you into a shell inside the container. Your system credentials |
---|
141 | are by default `kofa` and `kofa`. |
---|
142 | |
---|
143 | |
---|
144 | Copy data in and out of the container |
---|
145 | ************************************* |
---|
146 | |
---|
147 | For backups etc. it is essential that you can copy data from or to the |
---|
148 | container. To do this, we mount a second local directory into the container and |
---|
149 | use that for transmitting data:: |
---|
150 | |
---|
151 | $ mkdir mybackup |
---|
152 | $ 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 |
---|
153 | |
---|
154 | which will copy the whole container-internal `var/`-directory into our local |
---|
155 | `mybackup` dir. |
---|
156 | |
---|
157 | |
---|
158 | How to start/stop `kofa` when running the native setup |
---|
159 | ****************************************************** |
---|
160 | |
---|
161 | Startup Kofa in foreground:: |
---|
162 | |
---|
163 | $ bin/kofactl fg |
---|
164 | # press CTRL-D to stop the kofa server |
---|
165 | |
---|
166 | Startup Kofa in background:: |
---|
167 | |
---|
168 | $ bin/kofactl start |
---|
169 | $ bin/kofactl status # check status, running or not |
---|
170 | $ bin/kofactl stop # stop running instance (also 'restart' possible) |
---|
171 | |
---|
172 | That should start you. |
---|
173 | |
---|
174 | Have fun with Kofa! |
---|
175 | |
---|
176 | |
---|
177 | .. _Debian: https://www.debian.org/ |
---|
178 | .. _docker: https:// |
---|
179 | .. _Grok: http://grok.zope.org/ |
---|
180 | .. _Python: https://www.python.org/ |
---|
181 | .. _Subversion: https://subversion.apache.org/ |
---|
182 | .. _Ubuntu: https://www.ubuntu.com/ |
---|
183 | .. _virtualenv: https://www.virtualenv.org/en/latest/ |
---|
184 | .. _WAeUP: https://www.waeup.org/ |
---|
185 | .. _Zope: https://www.zope.org/ |
---|
186 | .. _zc.buildout: https://pypi.org/project/zc.buildout |
---|
187 | |
---|