1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

Merge pull request #585 from tim-moody/kiwix-proxy-12-2

apache proxy for kiwix
This commit is contained in:
A Holt 2017-12-04 15:14:26 -05:00 committed by GitHub
commit 77c5626512
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 5 deletions

View file

@ -7,7 +7,7 @@ kiwix_src_file_i686: "kiwix-0.10-linux-i686.tar.bz2" # Published Oct 2016 ("ex
kiwix_port: 3000 kiwix_port: 3000
# Expected to be used soon for Kiwix proxy: # Expected to be used soon for Kiwix proxy:
kiwix_url: /kiwix kiwix_url: /kiwix/
# Unused in Nov 2017, but should be: # Unused in Nov 2017, but should be:
kiwix_path: "{{ iiab_base }}/kiwix" kiwix_path: "{{ iiab_base }}/kiwix"

View file

@ -95,7 +95,7 @@
# 4. CREATE/ENABLE/DISABLE KIWIX SERVICE & ITS CRON JOB # 4. CREATE/ENABLE/DISABLE KIWIX SERVICE & ITS CRON JOB
- name: Create 'kiwix-serve' service - name: Create 'kiwix-serve' service and related files
template: template:
backup: no backup: no
src: "{{ item.src }}" src: "{{ item.src }}"
@ -108,7 +108,14 @@
# - { src: 'kiwix-serve-init.j2', dest: '/usr/libexec/kiwix-serve-init', mode: '0755'} # - { src: 'kiwix-serve-init.j2', dest: '/usr/libexec/kiwix-serve-init', mode: '0755'}
- { src: 'iiab-make-kiwix-lib', dest: '/usr/bin/iiab-make-kiwix-lib', mode: '0755'} - { src: 'iiab-make-kiwix-lib', dest: '/usr/bin/iiab-make-kiwix-lib', mode: '0755'}
- { src: 'iiab-make-kiwix-lib.py', dest: '/usr/bin/iiab-make-kiwix-lib.py', mode: '0755'} - { src: 'iiab-make-kiwix-lib.py', dest: '/usr/bin/iiab-make-kiwix-lib.py', mode: '0755'}
- { src: 'iiab-make-apache-config.py', dest: '/usr/bin/iiab-make-apache-config.py', mode: '0755'} # - { src: 'iiab-make-apache-config.py', dest: '/usr/bin/iiab-make-apache-config.py', mode: '0755'}
- { src: 'kiwix.conf.j2', dest: '/etc/{{ apache_config_dir }}/kiwix.conf', mode: '0644'}
- name: Enable Kiwix Proxy in Apache - is disabled by turning off kiwix service
file: path=/etc/apache2/sites-enabled/kiwix.conf
src=/etc/apache2/sites-available/kiwix.conf
state=link
when: is_debuntu
- name: Enable 'kiwix-serve' service - name: Enable 'kiwix-serve' service
service: service:
@ -144,6 +151,9 @@
dest: /etc/crontab dest: /etc/crontab
when: kiwix_enabled and is_redhat when: kiwix_enabled and is_redhat
- name: Restart apache, so it picks up kiwix.conf
service: name={{ apache_service }} state=restarted
# 5. FINALIZE # 5. FINALIZE
- name: Add 'kiwix-serve' to list of services at /etc/iiab/iiab.ini - name: Add 'kiwix-serve' to list of services at /etc/iiab/iiab.ini

View file

@ -2,7 +2,7 @@
{{ systemctl_program }} stop kiwix-serve {{ systemctl_program }} stop kiwix-serve
/usr/bin/iiab-make-kiwix-lib.py /usr/bin/iiab-make-kiwix-lib.py
/usr/bin/iiab-make-apache-config.py #/usr/bin/iiab-make-apache-config.py
{{ systemctl_program }} start kiwix-serve {{ systemctl_program }} start kiwix-serve
exit 0 exit 0

View file

@ -4,7 +4,7 @@ After=syslog.target network.target local-fs.target
[Service] [Service]
Type=forking Type=forking
ExecStart={{ iiab_base }}/kiwix/bin/kiwix-serve --daemon --port {{ kiwix_port }} --nolibrarybutton --library {{ kiwix_library_xml }} ExecStart={{ iiab_base }}/kiwix/bin/kiwix-serve --daemon --port {{ kiwix_port }} --nolibrarybutton --library {{ kiwix_library_xml }} --urlRootLocation={{ kiwix_url }}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -0,0 +1 @@
ProxyPass {{ kiwix_url }} http://127.0.0.1:{{ kiwix_port }}{{ kiwix_url }}