mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	Apache2 Reverse proxy subdirectory /kolibri
This commit is contained in:
		
							parent
							
								
									db7793beac
								
							
						
					
					
						commit
						37d66df237
					
				
					 4 changed files with 16 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -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"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,10 @@
 | 
			
		|||
    state: stopped
 | 
			
		||||
  when: not kolibri_enabled
 | 
			
		||||
 | 
			
		||||
- name: Disable http://box{{ kolibri_url }} with Apache
 | 
			
		||||
  command: a2dissite kolibri.conf
 | 
			
		||||
  when: not kolibri_enabled
 | 
			
		||||
 | 
			
		||||
- name: Add 'kolibri' variable values to {{ iiab_ini_file }}
 | 
			
		||||
  ini_file:
 | 
			
		||||
    path: "{{ iiab_ini_file }}"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										3
									
								
								roles/kolibri/templates/kolibri.conf.j2
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								roles/kolibri/templates/kolibri.conf.j2
									
										
									
									
									
										Normal 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 }}
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue