Move content from htaccess file to site config. Separate krb5 config.
This commit is contained in:
		
							parent
							
								
									e069171539
								
							
						
					
					
						commit
						97e980fbf7
					
				
					 4 changed files with 28 additions and 44 deletions
				
			
		| 
						 | 
					@ -1,8 +0,0 @@
 | 
				
			||||||
<IfModule mod_rewrite.c>
 | 
					 | 
				
			||||||
  RewriteEngine on
 | 
					 | 
				
			||||||
  RewriteRule ^\.well-known/host-meta /nextcloud/public.php?service=host-meta [QSA,L]
 | 
					 | 
				
			||||||
  RewriteRule ^\.well-known/host-meta\.json /nextcloud/public.php?service=host-meta-json [QSA,L]
 | 
					 | 
				
			||||||
  RewriteRule ^\.well-known/webfinger /nextcloud/public.php?service=webfinger [QSA,L]
 | 
					 | 
				
			||||||
  RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav/ [R=301,L]
 | 
					 | 
				
			||||||
  RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav/ [R=301,L]
 | 
					 | 
				
			||||||
</IfModule>
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,3 @@
 | 
				
			||||||
Alias /nextcloud "/var/www/nextcloud/"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<Location "/nextcloud/index.php/apps/user_saml/saml/login" >
 | 
					<Location "/nextcloud/index.php/apps/user_saml/saml/login" >
 | 
				
			||||||
  AuthType             GSSAPI
 | 
					  AuthType             GSSAPI
 | 
				
			||||||
  AuthName             "Login to NextCloud"
 | 
					  AuthName             "Login to NextCloud"
 | 
				
			||||||
| 
						 | 
					@ -11,25 +9,3 @@ Alias /nextcloud "/var/www/nextcloud/"
 | 
				
			||||||
  GssapiBasicAuth      On
 | 
					  GssapiBasicAuth      On
 | 
				
			||||||
  require              valid-user
 | 
					  require              valid-user
 | 
				
			||||||
</Location>
 | 
					</Location>
 | 
				
			||||||
 | 
					 | 
				
			||||||
<Directory /var/www/nextcloud/>
 | 
					 | 
				
			||||||
  Require all granted
 | 
					 | 
				
			||||||
  Options FollowSymlinks MultiViews
 | 
					 | 
				
			||||||
  AllowOverride All
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  <IfModule mod_dav.c>
 | 
					 | 
				
			||||||
    Dav off
 | 
					 | 
				
			||||||
  </IfModule>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  SetEnv HOME /var/www/nextcloud
 | 
					 | 
				
			||||||
  SetEnv HTTP_HOME /var/www/nextcloud
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
</Directory>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<Directory /var/www/html>
 | 
					 | 
				
			||||||
  AllowOverride FileInfo
 | 
					 | 
				
			||||||
</Directory>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<IfModule mod_headers.c>
 | 
					 | 
				
			||||||
  Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
 | 
					 | 
				
			||||||
</IfModule>
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
Alias /nextcloud "/var/www/nextcloud/"
 | 
					Alias /nextcloud "/var/www/nextcloud"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<Directory /var/www/nextcloud/>
 | 
					<Directory /var/www/nextcloud>
 | 
				
			||||||
  Require all granted
 | 
					  Require all granted
 | 
				
			||||||
  Options FollowSymlinks MultiViews
 | 
					  Options FollowSymlinks MultiViews
 | 
				
			||||||
  AllowOverride All
 | 
					  AllowOverride All
 | 
				
			||||||
| 
						 | 
					@ -11,11 +11,17 @@ Alias /nextcloud "/var/www/nextcloud/"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SetEnv HOME /var/www/nextcloud
 | 
					  SetEnv HOME /var/www/nextcloud
 | 
				
			||||||
  SetEnv HTTP_HOME /var/www/nextcloud
 | 
					  SetEnv HTTP_HOME /var/www/nextcloud
 | 
				
			||||||
 | 
					 | 
				
			||||||
</Directory>
 | 
					</Directory>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<Directory /var/www/html>
 | 
					<Directory /var/www/html>
 | 
				
			||||||
  AllowOverride FileInfo
 | 
					  <IfModule mod_rewrite.c>
 | 
				
			||||||
 | 
					    RewriteEngine on
 | 
				
			||||||
 | 
					    RewriteRule ^\.well-known/host-meta /nextcloud/public.php?service=host-meta [QSA,L]
 | 
				
			||||||
 | 
					    RewriteRule ^\.well-known/host-meta\.json /nextcloud/public.php?service=host-meta-json [QSA,L]
 | 
				
			||||||
 | 
					    RewriteRule ^\.well-known/webfinger /nextcloud/public.php?service=webfinger [QSA,L]
 | 
				
			||||||
 | 
					    RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav/ [R=301,L]
 | 
				
			||||||
 | 
					    RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav/ [R=301,L]
 | 
				
			||||||
 | 
					  </IfModule> 
 | 
				
			||||||
</Directory>
 | 
					</Directory>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<IfModule mod_headers.c>
 | 
					<IfModule mod_headers.c>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -75,16 +75,13 @@
 | 
				
			||||||
  copy:
 | 
					  copy:
 | 
				
			||||||
    src: nextcloud.conf
 | 
					    src: nextcloud.conf
 | 
				
			||||||
    dest: /etc/apache2/sites-available/nextcloud.conf
 | 
					    dest: /etc/apache2/sites-available/nextcloud.conf
 | 
				
			||||||
 | 
					  notify: "restart apache2"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: provide htaccess file
 | 
					- name: provide kerberos SSO config
 | 
				
			||||||
  copy:
 | 
					  copy:
 | 
				
			||||||
    src: htaccess
 | 
					    src: krb5-nextcloud.conf
 | 
				
			||||||
    dest: /var/www/html/.htaccess
 | 
					    dest: /etc/apache2/sites-available/krb5-nextcloud.conf
 | 
				
			||||||
 | 
					  when: "'kerberize' in role_names"
 | 
				
			||||||
- name: enable https
 | 
					 | 
				
			||||||
  command: a2ensite default-ssl.conf
 | 
					 | 
				
			||||||
  args:
 | 
					 | 
				
			||||||
    creates: /etc/apache2/sites-enabled/default-ssl.conf
 | 
					 | 
				
			||||||
  notify: "restart apache2"
 | 
					  notify: "restart apache2"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: enable nextcloud site
 | 
					- name: enable nextcloud site
 | 
				
			||||||
| 
						 | 
					@ -93,6 +90,19 @@
 | 
				
			||||||
    creates: /etc/apache2/sites-enabled/nextcloud.conf
 | 
					    creates: /etc/apache2/sites-enabled/nextcloud.conf
 | 
				
			||||||
  notify: "restart apache2"
 | 
					  notify: "restart apache2"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: enable kerberos access to nextcloud site
 | 
				
			||||||
 | 
					  command: a2ensite krb5-nextcloud.conf
 | 
				
			||||||
 | 
					  args:
 | 
				
			||||||
 | 
					    creates: /etc/apache2/sites-enabled/krb5-nextcloud.conf
 | 
				
			||||||
 | 
					  notify: "restart apache2"
 | 
				
			||||||
 | 
					  when: "'kerberize' in role_names"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: enable https
 | 
				
			||||||
 | 
					  command: a2ensite default-ssl.conf
 | 
				
			||||||
 | 
					  args:
 | 
				
			||||||
 | 
					    creates: /etc/apache2/sites-enabled/default-ssl.conf
 | 
				
			||||||
 | 
					  notify: "restart apache2"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: make sure data directory exists
 | 
					- name: make sure data directory exists
 | 
				
			||||||
  file:
 | 
					  file:
 | 
				
			||||||
    path: "{{ data_dir }}"
 | 
					    path: "{{ data_dir }}"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue