mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	nginx - group proxypass to apache together
This commit is contained in:
		
							parent
							
								
									2833bb1654
								
							
						
					
					
						commit
						4047894ab6
					
				
					 17 changed files with 50 additions and 55 deletions
				
			
		| 
						 | 
					@ -124,12 +124,6 @@
 | 
				
			||||||
    src: elgg.conf
 | 
					    src: elgg.conf
 | 
				
			||||||
    dest: "/etc/{{ apache_config_dir }}/elgg.conf"
 | 
					    dest: "/etc/{{ apache_config_dir }}/elgg.conf"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/elgg-nginx.conf from template, for http://box/elgg
 | 
					 | 
				
			||||||
  template:
 | 
					 | 
				
			||||||
    src: elgg-nginx.conf
 | 
					 | 
				
			||||||
    dest: "/etc/nginx/conf.d/elgg-nginx.conf"
 | 
					 | 
				
			||||||
  when: elgg_enabled and is_debuntu
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Create symlink elgg.conf from sites-enabled to sites-available (debuntu, not nec for redhat)
 | 
					- name: Create symlink elgg.conf from sites-enabled to sites-available (debuntu, not nec for redhat)
 | 
				
			||||||
  file:
 | 
					  file:
 | 
				
			||||||
    src: /etc/apache2/sites-available/elgg.conf
 | 
					    src: /etc/apache2/sites-available/elgg.conf
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -66,12 +66,11 @@
 | 
				
			||||||
  with_items:
 | 
					  with_items:
 | 
				
			||||||
    - { src: '010-iiab.conf.j2', dest: '/etc/{{ apache_config_dir }}/010-iiab.conf' }
 | 
					    - { src: '010-iiab.conf.j2', dest: '/etc/{{ apache_config_dir }}/010-iiab.conf' }
 | 
				
			||||||
    - { src: 'proxy_ajp.conf.j2', dest: '/etc/{{ apache_config_dir }}/proxy_ajp.conf' }
 | 
					    - { src: 'proxy_ajp.conf.j2', dest: '/etc/{{ apache_config_dir }}/proxy_ajp.conf' }
 | 
				
			||||||
    - { src: 'ports.conf' , dest: '/etc/{{ apache_service }}/' , mode: '0644' }
 | 
					 | 
				
			||||||
    #- { src: 'php.ini.j2', dest: '/etc/php.ini', mode: '0644' }    # @jvonau suggests removing this in https://github.com/iiab/iiab/issues/1147
 | 
					    #- { src: 'php.ini.j2', dest: '/etc/php.ini', mode: '0644' }    # @jvonau suggests removing this in https://github.com/iiab/iiab/issues/1147
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# For schools that use WordPress/Nextcloud/Moodle intensively.  iiab/iiab#1147
 | 
					# For schools that use WordPress/Nextcloud/Moodle intensively.  iiab/iiab#1147
 | 
				
			||||||
# WARNING: Enabling this might cause excess use of RAM/disk or other resources!
 | 
					# WARNING: Enabling this might cause excess use of RAM/disk or other resources!
 | 
				
			||||||
- name: Enact high limits in /etc/php/{{ php_version }}/{{ apache_service }}/php.ini if using WordPress and/or Moodle intensively
 | 
					- name: Enact high limits in /etc/php/{{ php_version }}/{{ apache_service }}/php.ini if using WordPress/Nextcloud/Moodle intensively
 | 
				
			||||||
  lineinfile:
 | 
					  lineinfile:
 | 
				
			||||||
    path: "/etc/php/{{ php_version }}/{{ apache_service }}/php.ini"
 | 
					    path: "/etc/php/{{ php_version }}/{{ apache_service }}/php.ini"
 | 
				
			||||||
    regexp: "{{ item.regexp }}"
 | 
					    regexp: "{{ item.regexp }}"
 | 
				
			||||||
| 
						 | 
					@ -80,7 +79,7 @@
 | 
				
			||||||
  with_items:
 | 
					  with_items:
 | 
				
			||||||
    - { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 500M    ; default is 2M' }
 | 
					    - { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 500M    ; default is 2M' }
 | 
				
			||||||
    - { regexp: '^post_max_size', line: 'post_max_size = 500M    ; default is 8M' }
 | 
					    - { regexp: '^post_max_size', line: 'post_max_size = 500M    ; default is 8M' }
 | 
				
			||||||
    - { regexp: '^memory_limit', line: 'memory_limit = 256M    ; default is 128M' }
 | 
					    - { regexp: '^memory_limit', line: 'memory_limit = 256M    ; default is 128M / Nextcloud requests 512M' }
 | 
				
			||||||
    - { regexp: '^max_execution_time', line: 'max_execution_time = 300    ; default is 30' }
 | 
					    - { regexp: '^max_execution_time', line: 'max_execution_time = 300    ; default is 30' }
 | 
				
			||||||
    - { regexp: '^max_input_time', line: 'max_input_time = 300    ; default is 60' }
 | 
					    - { regexp: '^max_input_time', line: 'max_input_time = 300    ; default is 60' }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -124,7 +123,6 @@
 | 
				
			||||||
    - headers
 | 
					    - headers
 | 
				
			||||||
    - proxy
 | 
					    - proxy
 | 
				
			||||||
    - proxy_html
 | 
					    - proxy_html
 | 
				
			||||||
    - headers
 | 
					 | 
				
			||||||
    - proxy_http
 | 
					    - proxy_http
 | 
				
			||||||
    - rewrite
 | 
					    - rewrite
 | 
				
			||||||
  when: is_debuntu | bool
 | 
					  when: is_debuntu | bool
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -110,11 +110,6 @@
 | 
				
			||||||
    src: lokole.conf.j2
 | 
					    src: lokole.conf.j2
 | 
				
			||||||
    dest: "/etc/{{ apache_config_dir }}/lokole.conf"
 | 
					    dest: "/etc/{{ apache_config_dir }}/lokole.conf"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/lokole-nginx.conf from template, for http://box/lokole
 | 
					 | 
				
			||||||
  template:
 | 
					 | 
				
			||||||
    src: lokole-nginx.conf.j2
 | 
					 | 
				
			||||||
    dest: "/etc/nginx/conf.d/lokole-nginx.conf"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Symlink /etc/apache2/sites-enabled/lokole.conf to /etc/{{ apache_config_dir }}/lokole.conf, if lokole_enabled (debuntu)
 | 
					- name: Symlink /etc/apache2/sites-enabled/lokole.conf to /etc/{{ apache_config_dir }}/lokole.conf, if lokole_enabled (debuntu)
 | 
				
			||||||
  file:
 | 
					  file:
 | 
				
			||||||
    src: "/etc/{{ apache_config_dir }}/lokole.conf"
 | 
					    src: "/etc/{{ apache_config_dir }}/lokole.conf"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -72,12 +72,6 @@
 | 
				
			||||||
    state: link
 | 
					    state: link
 | 
				
			||||||
  when: mediawiki_enabled and is_debuntu
 | 
					  when: mediawiki_enabled and is_debuntu
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install nginx config file, if mediawiki_enabled (debuntu)
 | 
					 | 
				
			||||||
  template:
 | 
					 | 
				
			||||||
    src: mediawiki-nginx.conf.j2
 | 
					 | 
				
			||||||
    dest: /etc/nginx/conf.d/mediawiki-nginx.conf
 | 
					 | 
				
			||||||
  when: mediawiki_enabled and is_debuntu
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Remove mediawiki.conf if not mediawiki_enabled (debuntu)
 | 
					- name: Remove mediawiki.conf if not mediawiki_enabled (debuntu)
 | 
				
			||||||
  file:
 | 
					  file:
 | 
				
			||||||
    path: /etc/apache2/sites-enabled/mediawiki.conf
 | 
					    path: /etc/apache2/sites-enabled/mediawiki.conf
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# nextcloud_install: False
 | 
					# nextcloud_install: False
 | 
				
			||||||
# nextcloud_enabled: False
 | 
					# nextcloud_enabled: False
 | 
				
			||||||
nextcloud_force_install: False
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# nextcloud_allow_public_ips: False
 | 
					# nextcloud_allow_public_ips: False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,17 +33,6 @@
 | 
				
			||||||
    state: absent
 | 
					    state: absent
 | 
				
			||||||
  when: not nextcloud_enabled and is_redhat
 | 
					  when: not nextcloud_enabled and is_redhat
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Enable the nginx proxying to apache
 | 
					 | 
				
			||||||
  template: src=nextcloud-nginx.conf dest=/etc/nginx/conf.d/nextcloud-nginx.conf
 | 
					 | 
				
			||||||
  when: nextcloud_enabled | bool
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Restart apache, so it picks up the new aliases
 | 
					 | 
				
			||||||
  service: name={{ apache_service }} state=restarted
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Restart nnginx
 | 
					 | 
				
			||||||
  service: name=nginx state=restarted
 | 
					 | 
				
			||||||
  when: nginx_enabled | bool
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Restart Apache, enabling/disabling http://box/nextcloud
 | 
					- name: Restart Apache, enabling/disabling http://box/nextcloud
 | 
				
			||||||
  service:
 | 
					  service:
 | 
				
			||||||
    name: "{{ apache_service }}"
 | 
					    name: "{{ apache_service }}"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@
 | 
				
			||||||
  #set_fact:
 | 
					  #set_fact:
 | 
				
			||||||
  #  nextcloud_force_install: True
 | 
					  #  nextcloud_force_install: True
 | 
				
			||||||
  include_tasks: install.yml
 | 
					  include_tasks: install.yml
 | 
				
			||||||
  when: (nextcloud_install and not nextcloud_page.stat.exists) or nextcloud_force_install
 | 
					  when: nextcloud_install and not nextcloud_page.stat.exists
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# - debug:
 | 
					# - debug:
 | 
				
			||||||
#     var: nextcloud_force_install
 | 
					#     var: nextcloud_force_install
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,6 +48,53 @@
 | 
				
			||||||
      name: uwsgi
 | 
					      name: uwsgi
 | 
				
			||||||
      state: started
 | 
					      state: started
 | 
				
			||||||
      enabled: True
 | 
					      enabled: True
 | 
				
			||||||
 | 
					- name: Install ports.conf when nginx_enabled, from templates
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    src: "{{ item.src }}"
 | 
				
			||||||
 | 
					    dest: "{{ item.dest }}"
 | 
				
			||||||
 | 
					    owner: root
 | 
				
			||||||
 | 
					    group: root
 | 
				
			||||||
 | 
					    mode: 0644
 | 
				
			||||||
 | 
					  with_items:
 | 
				
			||||||
 | 
					    - { src: 'ports.conf' , dest: '/etc/{{ apache_service }}/' , mode: '0644' }
 | 
				
			||||||
 | 
					  when: is_debuntu | bool and nginx_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Install /etc/nginx/conf.d/elgg-nginx.conf from template
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    src: elgg-nginx.conf
 | 
				
			||||||
 | 
					    dest: "/etc/nginx/conf.d/elgg-nginx.conf"
 | 
				
			||||||
 | 
					  when: elgg_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Install /etc/nginx/lokole-nginx.conf from template
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    src: lokole-nginx.conf.j2
 | 
				
			||||||
 | 
					    dest: "/etc/nginx/conf.d/lokole-nginx.conf"
 | 
				
			||||||
 | 
					  when: lokole_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Install MediaWiki's nginx conf.d file from template
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    src: mediawiki-nginx.conf.j2
 | 
				
			||||||
 | 
					    dest: /etc/nginx/conf.d/mediawiki-nginx.conf
 | 
				
			||||||
 | 
					  when: mediawiki_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Install WordPress's nginx conf.d file from template
 | 
				
			||||||
 | 
					  template: src=nextcloud-nginx.conf dest=/etc/nginx/conf.d/nextcloud-nginx.conf
 | 
				
			||||||
 | 
					  when: nextcloud_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Install NodeRed's nginx conf.d file from template
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    src: nodered-nginx.conf.j2
 | 
				
			||||||
 | 
					    dest: /etc/nginx/conf.d/nodered-nginx.conf
 | 
				
			||||||
 | 
					    owner: root
 | 
				
			||||||
 | 
					    group: root
 | 
				
			||||||
 | 
					    mode: 0666
 | 
				
			||||||
 | 
					  when: nodered_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Install WordPress's nginx conf.d file from template
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					      src: wordpress-nginx.conf
 | 
				
			||||||
 | 
					      dest: /etc/nginx/conf.d/
 | 
				
			||||||
 | 
					  when: wordpress_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Make sure nginx picks up the config 
 | 
					- name: Make sure nginx picks up the config 
 | 
				
			||||||
  service: 
 | 
					  service: 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -171,15 +171,6 @@
 | 
				
			||||||
    mode: 0666
 | 
					    mode: 0666
 | 
				
			||||||
  when: nodered_install | bool
 | 
					  when: nodered_install | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install nginx's conf.d file from template
 | 
					 | 
				
			||||||
  template:
 | 
					 | 
				
			||||||
    src: nodered-nginx.conf.j2
 | 
					 | 
				
			||||||
    dest: /etc/nginx/conf.d/nodered-nginx.conf
 | 
					 | 
				
			||||||
    owner: root
 | 
					 | 
				
			||||||
    group: root
 | 
					 | 
				
			||||||
    mode: 0666
 | 
					 | 
				
			||||||
  when: nodered_install | bool
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Create symlink nodered.conf from sites-enabled to sites-available, for short URL http://box/nodered (if nodered_enabled)
 | 
					- name: Create symlink nodered.conf from sites-enabled to sites-available, for short URL http://box/nodered (if nodered_enabled)
 | 
				
			||||||
  file:
 | 
					  file:
 | 
				
			||||||
    src: /etc/apache2/sites-available/nodered.conf
 | 
					    src: /etc/apache2/sites-available/nodered.conf
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -118,18 +118,6 @@
 | 
				
			||||||
    dest: "/etc/{{ apache_config_dir }}/wordpress.conf"
 | 
					    dest: "/etc/{{ apache_config_dir }}/wordpress.conf"
 | 
				
			||||||
  when: apache_enabled
 | 
					  when: apache_enabled
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Copy the nginx location info
 | 
					 | 
				
			||||||
  template: 
 | 
					 | 
				
			||||||
      src: wordpress-nginx.conf 
 | 
					 | 
				
			||||||
      dest: /etc/nginx/conf.d/
 | 
					 | 
				
			||||||
  when: nginx_enabled
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Notify nginx service of changes
 | 
					 | 
				
			||||||
  service: 
 | 
					 | 
				
			||||||
      name: nginx 
 | 
					 | 
				
			||||||
      state: restarted
 | 
					 | 
				
			||||||
  when: nginx_enabled
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Create symlink wordpress.conf from sites-enabled to sites-available, if wordpress_enabled (debuntu)
 | 
					- name: Create symlink wordpress.conf from sites-enabled to sites-available, if wordpress_enabled (debuntu)
 | 
				
			||||||
  file:
 | 
					  file:
 | 
				
			||||||
    src: /etc/apache2/sites-available/wordpress.conf
 | 
					    src: /etc/apache2/sites-available/wordpress.conf
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue