Browse Source

More apache fixes.

The virtual site files must be owned by root (serious security issue)
and they must have the .conf filename suffix for a2ensite on
Ubuntu 14.04LTS (apache 2.4.7).
Sven Neuhaus 11 years ago
parent
commit
0f6dfdc6ca

+ 2
- 2
roles/blog/tasks/blog.yml View File

2
   file: state=directory path=/var/www/{{ domain }} group=www-data owner=www-data
2
   file: state=directory path=/var/www/{{ domain }} group=www-data owner=www-data
3
 
3
 
4
 - name: Configure the Apache HTTP server for the blog
4
 - name: Configure the Apache HTTP server for the blog
5
-  template: src=etc_apache2_sites-available_blog.j2 dest=/etc/apache2/sites-available/{{ domain }} group=www-data owner=www-data
5
+  template: src=etc_apache2_sites-available_blog.j2 dest=/etc/apache2/sites-available/{{ domain }}.conf group=root owner=root
6
   notify: restart apache
6
   notify: restart apache
7
 
7
 
8
 - name: Enable blog site
8
 - name: Enable blog site
9
-  command: a2ensite {{ domain }} creates=/etc/apache2/sites-enabled/{{ domain }}
9
+  command: a2ensite {{ domain }}.conf creates=/etc/apache2/sites-enabled/{{ domain }}.conf
10
   notify: restart apache
10
   notify: restart apache
11
 
11
 

+ 4
- 4
roles/git/tasks/cgit.yml View File

34
 
34
 
35
 - name: Configure the Apache HTTP server for cgit
35
 - name: Configure the Apache HTTP server for cgit
36
   template: src=etc_apache2_sites-available_cgit.j2
36
   template: src=etc_apache2_sites-available_cgit.j2
37
-            dest=/etc/apache2/sites-available/cgit
38
-            group=www-data
39
-            owner=www-data
37
+            dest=/etc/apache2/sites-available/cgit.conf
38
+            group=root
39
+            owner=root
40
   notify: restart apache
40
   notify: restart apache
41
 
41
 
42
 - name: Enable Apache cgi module
42
 - name: Enable Apache cgi module
48
   notify: restart apache
48
   notify: restart apache
49
 
49
 
50
 - name:  Enable cgit site
50
 - name:  Enable cgit site
51
-  command: a2ensite cgit creates=/etc/apache2/sites-enabled/cgit
51
+  command: a2ensite cgit.conf creates=/etc/apache2/sites-enabled/cgit.conf
52
   notify: restart apache
52
   notify: restart apache

+ 5
- 5
roles/newebe/tasks/main.yml View File

73
 #
73
 #
74
 - name: Configure the Apache HTTP server for Newebe
74
 - name: Configure the Apache HTTP server for Newebe
75
   template: src=etc_apache2_sites-available_newebe.j2
75
   template: src=etc_apache2_sites-available_newebe.j2
76
-            dest=/etc/apache2/sites-available/newebe
77
-            group=www-data
78
-            owner=www-data
76
+            dest=/etc/apache2/sites-available/newebe.conf
77
+            group=root
78
+            owner=root
79
   notify: restart apache
79
   notify: restart apache
80
 
80
 
81
 - name: Enable the site
81
 - name: Enable the site
82
-  command: a2ensite newebe
83
-           creates=/etc/apache2/sites-enabled/newebe
82
+  command: a2ensite newebe.conf
83
+           creates=/etc/apache2/sites-enabled/newebe.conf
84
   notify: restart apache
84
   notify: restart apache

+ 2
- 2
roles/news/tasks/selfoss.yml View File

27
   notify: restart apache
27
   notify: restart apache
28
 
28
 
29
 - name: Configure the Apache HTTP server for selfoss
29
 - name: Configure the Apache HTTP server for selfoss
30
-  template: src=etc_apache2_sites-available_selfoss.j2 dest=/etc/apache2/sites-available/selfoss group=www-data owner=www-data
30
+  template: src=etc_apache2_sites-available_selfoss.j2 dest=/etc/apache2/sites-available/selfoss.conf group=root owner=root
31
   notify: restart apache
31
   notify: restart apache
32
 
32
 
33
 - name: Enable the selfoss site
33
 - name: Enable the selfoss site
34
-  command: a2ensite selfoss creates=/etc/apache2/sites-enabled/selfoss
34
+  command: a2ensite selfoss.conf creates=/etc/apache2/sites-enabled/selfoss.conf
35
   notify: restart apache
35
   notify: restart apache
36
 
36
 
37
 - name: Install selfoss cronjob
37
 - name: Install selfoss cronjob

+ 2
- 2
roles/owncloud/tasks/owncloud.yml View File

37
   notify: restart apache
37
   notify: restart apache
38
 
38
 
39
 - name: Configure the Apache HTTP server for ownCloud
39
 - name: Configure the Apache HTTP server for ownCloud
40
-  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.conf group=root owner=root
41
   notify: restart apache
41
   notify: restart apache
42
 
42
 
43
 - name: Enable the owncloud site
43
 - name: Enable the owncloud site
44
-  command: a2ensite owncloud creates=/etc/apache2/sites-enabled/owncloud
44
+  command: a2ensite owncloud.conf creates=/etc/apache2/sites-enabled/owncloud.conf
45
   notify: restart apache
45
   notify: restart apache
46
 
46
 
47
 - name: Install ownCloud cronjob
47
 - name: Install ownCloud cronjob

+ 5
- 5
roles/readlater/tasks/wallabag.yml View File

54
 
54
 
55
 - name: Configure the Apache HTTP server for wallabag
55
 - name: Configure the Apache HTTP server for wallabag
56
   template: src=etc_apache2_sites-available_wallabag.j2
56
   template: src=etc_apache2_sites-available_wallabag.j2
57
-            dest=/etc/apache2/sites-available/wallabag
58
-            owner=www-data
59
-            group=www-data
57
+            dest=/etc/apache2/sites-available/wallabag.conf
58
+            owner=root
59
+            group=root
60
   notify: restart apache
60
   notify: restart apache
61
 
61
 
62
 - name: Enable the wallabag site
62
 - name: Enable the wallabag site
63
-  command: a2ensite wallabag
64
-           creates=/etc/apache2/sites-enabled/wallabag
63
+  command: a2ensite wallabag.conf
64
+           creates=/etc/apache2/sites-enabled/wallabag.conf
65
   notify: restart apache
65
   notify: restart apache

Loading…
Cancel
Save