Преглед на файлове

Merge pull request #112 from brucespang/owncloud-speed

OwnCloud speed
Alex Payne преди 11 години
родител
ревизия
6b0a28e7db
променени са 2 файла, в които са добавени 26 реда и са изтрити 2 реда
  1. 9
    2
      roles/owncloud/tasks/owncloud.yml
  2. 17
    0
      roles/owncloud/templates/etc_apache2_sites-available_owncloud.j2

+ 9
- 2
roles/owncloud/tasks/owncloud.yml Целия файл

15
   apt_repository: repo='deb http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/ /'
15
   apt_repository: repo='deb http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/ /'
16
 
16
 
17
 - name: Install ownCloud from OpenSuSE repository
17
 - name: Install ownCloud from OpenSuSE repository
18
-  apt: pkg=owncloud update_cache=yes
18
+  apt: pkg=owncloud
19
+
20
+- name: Install PHP-APC
21
+  apt: pkg=php-apc
19
 
22
 
20
 - name: Store ownCloud data securely
23
 - name: Store ownCloud data securely
21
   command: mv /var/www/owncloud/data /decrypted/owncloud-data creates=/decrypted/owncloud-data
24
   command: mv /var/www/owncloud/data /decrypted/owncloud-data creates=/decrypted/owncloud-data
29
   command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
32
   command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
30
   notify: restart apache
33
   notify: restart apache
31
 
34
 
35
+- name: Enable Apache expires module
36
+  command: a2enmod expires creates=/etc/apache2/mods-enabled/expires.load
37
+  notify: restart apache
38
+
32
 - name: Configure the Apache HTTP server for ownCloud
39
 - name: Configure the Apache HTTP server for ownCloud
33
   template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud group=www-data owner=www-data
40
   template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud group=www-data owner=www-data
41
+  notify: restart apache
34
 
42
 
35
 - name: Enable the owncloud site
43
 - name: Enable the owncloud site
36
   command: a2ensite owncloud creates=/etc/apache2/sites-enabled/owncloud
44
   command: a2ensite owncloud creates=/etc/apache2/sites-enabled/owncloud
38
 
46
 
39
 - name: Install ownCloud cronjob
47
 - name: Install ownCloud cronjob
40
   cron: name="ownCloud" user="www-data" minute="*/5" job="php -f /var/www/owncloud/cron.php > /dev/null"
48
   cron: name="ownCloud" user="www-data" minute="*/5" job="php -f /var/www/owncloud/cron.php > /dev/null"
41
-

+ 17
- 0
roles/owncloud/templates/etc_apache2_sites-available_owncloud.j2 Целия файл

22
     ErrorLog                /var/log/apache2/owncloud.info-error_log
22
     ErrorLog                /var/log/apache2/owncloud.info-error_log
23
     CustomLog               /var/log/apache2/owncloud.info-access_log common
23
     CustomLog               /var/log/apache2/owncloud.info-access_log common
24
 
24
 
25
+    php_value session_cache_limiter "public"
26
+
25
     <Directory /var/www/owncloud>
27
     <Directory /var/www/owncloud>
26
         AllowOverride All
28
         AllowOverride All
27
         Order allow,deny
29
         Order allow,deny
28
         allow from all
30
         allow from all
31
+        DirectoryIndex index.php
32
+
33
+        SetOutputFilter DEFLATE
34
+
35
+        ExpiresActive On
36
+        ExpiresDefault "access plus 2 weeks"
37
+        ExpiresByType text/css "access plus 2 weeks"
38
+        ExpiresByType image/svg+xml "access plus 2 weeks"
39
+        ExpiresByType image/png "access plus 2 weeks"
40
+        ExpiresByType text/javascript "access plus 2 weeks"
41
+        ExpiresByType application/x-javascript "access plus 2 weeks"
42
+        ExpiresByType application/javascript "access plus 2 weeks"
43
+        ExpiresByType application/x-icon "access plus 2 weeks"
44
+
45
+        Header set Cache-Control "public"
29
     </Directory>
46
     </Directory>
30
 </VirtualHost>
47
 </VirtualHost>

Loading…
Отказ
Запис