1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Merge pull request #1412 from arky/kolibri-fix-913

Apache2 Reverse proxy subdirectory /kolibri
This commit is contained in:
A Holt 2019-01-18 03:36:31 -05:00 committed by GitHub
commit 3935bcfd0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 1 deletions

View file

@ -9,7 +9,7 @@ kolibri_enabled: False
kolibri_home: "{{ content_base }}/kolibri"
kolibri_http_port: 8009
kolibri_url: /kolibri/
kolibri_url: /kolibri
kolibri_venv_path: /usr/local/kolibri
# 2018-07-16: IIAB recommends /usr/bin but @arky says this isn't yet possible, due to pip
kolibri_exec_path: "{{ kolibri_venv_path }}/bin/kolibri"

View file

@ -64,6 +64,7 @@
group: root
with_items:
- { src: 'kolibri.service.j2', dest: '/etc/systemd/system/kolibri.service', mode: '0644' }
- { src: 'kolibri.conf.j2', dest: '/etc/apache2/sites-available/kolibri.conf', mode: '0644' }
- name: Enable & (Re)Start kolibri service
systemd:
@ -73,6 +74,12 @@
daemon_reload: yes
when: kolibri_enabled
# Default: http://box/kolibri
- name: Enable http://box{{ kolibri_url }} with Apache
command: a2ensite kolibri.conf
when: kolibri_enabled
- name: Disable kolibri service
systemd:
name: kolibri
@ -80,6 +87,15 @@
state: stopped
when: not kolibri_enabled
- name: Disable http://box{{ kolibri_url }} with Apache
command: a2dissite kolibri.conf
when: not kolibri_enabled
- name: Restart {{ apache_service }} # almost always apache2
systemd:
name: "{{ apache_service }}"
state: restarted
- name: Add 'kolibri' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}"

View file

@ -0,0 +1,3 @@
ProxyPreserveHost On
ProxyPass {{ kolibri_url }} http://localhost:{{ kolibri_http_port }}{{ kolibri_url }}
ProxyPassReverse {{ kolibri_url }} http://localhost:{{ kolibri_http_port }}{{ kolibri_url }}

View file

@ -7,6 +7,7 @@ RemainAfterExit=yes
Environment=KOLIBRI_USER={{ kolibri_user }}
Environment=KOLIBRI_HOME={{ kolibri_home }}
Environment=KOLIBRI_HTTP_PORT={{ kolibri_http_port }}
Environment=KOLIBRI_URL_PATH_PREFIX={{ kolibri_url }}
User={{ kolibri_user }}
Group={{ apache_user }}
ExecStart={{ kolibri_exec_path }} start