Bläddra i källkod

Update ownCloud role for ownCloud 8.2

- Remove unnecessary dependencies
- Clean up postgresql server setup
- Install from official package repository
- Expect package installer to enable modules that are needed
- Update virtual host config with owncloud 8.2 configuration
- Update post-deploy instructions
Mike Ashley 8 år sedan
förälder
incheckning
a17b576e78

+ 1
- 1
README.md Visa fil

@@ -221,7 +221,7 @@ Similarly, to access the server monitoring page, use another SSH tunnel:
221 221
 
222 222
 Again proceeding to http://localhost:2812 in your web browser.
223 223
 
224
-Finally, sign into ownCloud to set it up. You should select PostgreSQL as the configuration backend.
224
+Finally, sign into ownCloud with a new administrator account to set it up. You should select PostgreSQL as the configuration backend. Use `owncloud` as the database user and the database name. For the database password use the password you set for `owncloud_db_password` in `vars/user.yml`.
225 225
 
226 226
 How To Use Your New Personal Cloud
227 227
 ----------------------------------

+ 10
- 30
roles/owncloud/tasks/owncloud.yml Visa fil

@@ -1,32 +1,27 @@
1 1
 ---
2 2
 # Installs the ownCloud personal cloud software.
3 3
 
4
-- name: Install ownCloud  dependencies
4
+- name: Install ownCloud dependencies
5 5
   apt: pkg={{ item }} state=present
6 6
   with_items:
7 7
     - postgresql
8
-    - libapache2-mod-php5
9
-    - php-apc
10 8
     - python-psycopg2
11 9
   tags:
12 10
     - dependencies
13 11
 
14
-- name: Set postgres password
15
-  command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with  password '{{ db_admin_password }}';"
12
+- name: Set postgres administrator password
13
+  command: sudo -u {{ db_admin_username }} psql -c "ALTER USER postgres with password '{{ db_admin_password }}';"
16 14
 
17 15
 - name: Create database user for ownCloud
18
-  postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ owncloud_db_username }} password="{{ owncloud_db_password }}" state=present
19
-
20
-- name: Create database for ownCloud
21
-  postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ owncloud_db_database }} state=present owner={{ owncloud_db_username }}
16
+  postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ owncloud_db_username }} password="{{ owncloud_db_password }}" role_attr_flags=CREATEDB state=present
22 17
 
23 18
 - name: Ensure repository key for ownCloud is in place
24
-  apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_8.0/Release.key state=present
19
+  apt_key: url=https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key state=present
25 20
   tags:
26 21
     - dependencies
27 22
 
28
-- name: Add ownCloud OpenSuSE repository
29
-  apt_repository: repo='deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_8.0/ /'
23
+- name: Add ownCloud repository
24
+  apt_repository: repo='deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /'
30 25
   tags:
31 26
     - dependencies
32 27
 
@@ -42,27 +37,12 @@
42 37
   command: mv /var/www/owncloud/data /decrypted/owncloud-data creates=/decrypted/owncloud-data
43 38
 - file: src=/decrypted/owncloud-data dest=/var/www/owncloud/data owner=www-data group=www-data state=link
44 39
 
45
-- name: Enable Apache rewrite module
46
-  command: a2enmod rewrite creates=/etc/apache2/mods-enabled/rewrite.load
47
-  notify: restart apache
48
-
49
-- name: Enable Apache headers module
50
-  command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
51
-  notify: restart apache
52
-
53
-- name: Enable Apache expires module
54
-  command: a2enmod expires creates=/etc/apache2/mods-enabled/expires.load
40
+- name: Remove conf-enabled/owncloud symlink
41
+  file: path=/etc/apache2/conf-enabled/owncloud.conf state=absent
55 42
   notify: restart apache
56 43
 
57
-- name: Rename existing Apache owncloud virtualhost
58
-  command: mv /etc/apache2/sites-available/owncloud /etc/apache2/sites-available/owncloud.conf removes=/etc/apache2/sites-available/owncloud
59
-
60
-- name: Remove old sites-enabled/owncloud symlink (new one will be created by a2ensite)
61
-  file: path=/etc/apache2/sites-enabled/owncloud state=absent
62
-
63 44
 - name: Configure the Apache HTTP server for ownCloud
64
-  template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud.conf group=root owner=root
65
-
45
+  template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud.conf group=root
66 46
 - name: Enable the owncloud site
67 47
   command: a2ensite owncloud.conf creates=/etc/apache2/sites-enabled/owncloud.conf
68 48
   notify: restart apache

+ 19
- 18
roles/owncloud/templates/etc_apache2_sites-available_owncloud.j2 Visa fil

@@ -16,24 +16,25 @@
16 16
 
17 17
     php_value session_cache_limiter "public"
18 18
 
19
-    <Directory /var/www/owncloud>
19
+    <Directory "/var/www/owncloud">
20
+        Options +FollowSymLinks
20 21
         AllowOverride All
21
-        Order allow,deny
22
-        allow from all
23
-        DirectoryIndex index.php
24
-
25
-        SetOutputFilter DEFLATE
26
-
27
-        ExpiresActive On
28
-        ExpiresDefault "access plus 2 weeks"
29
-        ExpiresByType text/css "access plus 2 weeks"
30
-        ExpiresByType image/svg+xml "access plus 2 weeks"
31
-        ExpiresByType image/png "access plus 2 weeks"
32
-        ExpiresByType text/javascript "access plus 2 weeks"
33
-        ExpiresByType application/x-javascript "access plus 2 weeks"
34
-        ExpiresByType application/javascript "access plus 2 weeks"
35
-        ExpiresByType application/x-icon "access plus 2 weeks"
36
-
37
-        Header set Cache-Control "public"
22
+
23
+        <IfModule mod_dav.c>
24
+          Dav off
25
+        </IfModule>
26
+
27
+        SetEnv HOME /var/www/owncloud
28
+        SetEnv HTTP_HOME /var/www/owncloud
38 29
     </Directory>
30
+
31
+    <Directory "/var/www/owncloud/data/">
32
+      # just in case if .htaccess gets disabled
33
+      Require all denied
34
+    </Directory>
35
+
36
+    ## Please enable this manually, if needed. See also
37
+    ## https://doc.owncloud.org/server/8.2/admin_manual/issues/index.html#apple-ios
38
+    # Redirect 301 /.well-known/carddav /owncloud/remote.php/carddav
39
+    # Redirect 301 /.well-known/caldav  /owncloud/remote.php/caldav
39 40
 </VirtualHost>

Laddar…
Avbryt
Spara