request: drop redundant 'config' & 'sla' options
[slapos.git] / stack / lapp / apache / instance-apache-php.cfg.in
1 [buildout]
2 extends = ${custom-application-deployment:path}
3
4 parts =
5   certificate-authority
6   ca-stunnel
7   logrotate
8   logrotate-entry-apache
9   logrotate-entry-stunnel
10   cron
11   cron-entry-logrotate
12   promise
13   slapmonitor
14   slapmonitor-xml
15
16   frontend-promise
17   content-promise
18   publish-connection-informations
19   ${custom-application-deployment:part-list}
20
21 eggs-directory = ${buildout:eggs-directory}
22 develop-eggs-directory = ${buildout:develop-eggs-directory}
23 offline = true
24
25
26 #----------------
27 #--
28 #-- Creation of all needed directories.
29
30 [rootdirectory]
31 recipe = slapos.cookbook:mkdirectory
32 etc = $${buildout:directory}/etc
33 var = $${buildout:directory}/var
34 srv = $${buildout:directory}/srv
35 bin = $${buildout:directory}/bin
36 tmp = $${buildout:directory}/tmp
37
38 [basedirectory]
39 recipe = slapos.cookbook:mkdirectory
40 log = $${rootdirectory:var}/log
41 services = $${rootdirectory:etc}/service
42 run = $${rootdirectory:var}/run
43 backup = $${rootdirectory:srv}/backup
44 promises = $${rootdirectory:etc}/promise
45
46 [directory]
47 recipe = slapos.cookbook:mkdirectory
48 cron-entries = $${rootdirectory:etc}/cron.d
49 crontabs = $${rootdirectory:etc}/crontabs
50 cronstamps = $${rootdirectory:etc}/cronstamps
51 ca-dir = $${rootdirectory:srv}/ssl
52 httpd-log = $${basedirectory:log}/apache
53 php-ini-dir = $${rootdirectory:etc}/php
54 tmp-php = $${rootdirectory:tmp}/php
55 logrotate-entries = $${rootdirectory:etc}/logrotate.d
56 logrotate-backup = $${basedirectory:backup}/logrotate
57 report = $${rootdirectory:etc}/report
58 stunnel-conf = $${rootdirectory:etc}/stunnel
59 xml-report = $${rootdirectory:var}/xml_report
60 www = $${rootdirectory:srv}/www/
61
62 [cadirectory]
63 recipe = slapos.cookbook:mkdirectory
64 requests = $${directory:ca-dir}/requests
65 private = $${directory:ca-dir}/private
66 certs = $${directory:ca-dir}/certs
67 newcerts = $${directory:ca-dir}/newcerts
68 crl = $${directory:ca-dir}/crl
69
70
71 #----------------
72 #--
73 #-- Deploy cron.
74
75 [cron]
76 recipe = slapos.cookbook:cron
77 dcrond-binary = ${dcron:location}/sbin/crond
78 cron-entries = $${directory:cron-entries}
79 crontabs = $${directory:crontabs}
80 cronstamps = $${directory:cronstamps}
81 catcher = $${cron-simplelogger:wrapper}
82 binary = $${basedirectory:services}/crond
83
84 [cron-simplelogger]
85 recipe = slapos.cookbook:simplelogger
86 wrapper = $${rootdirectory:bin}/cron_simplelogger
87 log = $${basedirectory:log}/crond.log
88
89
90 #----------------
91 #--
92 #-- Deploy logrotate.
93
94 [cron-entry-logrotate]
95 <= cron
96 recipe = slapos.cookbook:cron.d
97 name = logrotate
98 frequency = 0 0 * * *
99 command = $${logrotate:wrapper}
100
101 [logrotate]
102 recipe = slapos.cookbook:logrotate
103 # Binaries
104 logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
105 gzip-binary = ${gzip:location}/bin/gzip
106 gunzip-binary = ${gzip:location}/bin/gunzip
107 # Directories
108 wrapper = $${rootdirectory:bin}/logrotate
109 conf = $${rootdirectory:etc}/logrotate.conf
110 logrotate-entries = $${directory:logrotate-entries}
111 backup = $${directory:logrotate-backup}
112 state-file = $${rootdirectory:srv}/logrotate.status
113
114
115 #----------------
116 #--
117 #-- Deploy stunnel.
118
119 [stunnel]
120 recipe = slapos.cookbook:stunnel
121 client = true
122 stunnel-binary = ${stunnel:location}/bin/stunnel
123 remote-host = $${postgres-urlparse:host}
124 remote-port = $${postgres-urlparse:port}
125 local-host = $${slap-network-information:local-ipv4}
126 local-port = 33060
127 log-file = $${basedirectory:log}/stunnel.log
128 config-file = $${directory:stunnel-conf}/stunnel.conf
129 key-file = $${directory:stunnel-conf}/stunnel.key
130 cert-file = $${directory:stunnel-conf}/stunnel.crt
131 pid-file = $${basedirectory:run}/stunnel.pid
132 wrapper = $${rootdirectory:bin}/raw_stunnel
133 post-rotate-script = $${rootdirectory:bin}/stunnel_post_rotate
134
135 [logrotate-entry-stunnel]
136 <= logrotate
137 recipe = slapos.cookbook:logrotate.d
138 name = stunnel
139 log = $${stunnel:log-file}
140 frequency = daily
141 rotate-num = 30
142 notifempty = true
143 create = true
144 post = $${stunnel:post-rotate-script}
145
146
147 #----------------
148 #--
149 #-- Certificate stuff.
150
151 [certificate-authority]
152 recipe = slapos.cookbook:certificate_authority
153 openssl-binary = ${openssl:location}/bin/openssl
154 ca-dir = $${directory:ca-dir}
155 requests-directory = $${cadirectory:requests}
156 wrapper = $${basedirectory:services}/ca
157 ca-private = $${cadirectory:private}
158 ca-certs = $${cadirectory:certs}
159 ca-newcerts = $${cadirectory:newcerts}
160 ca-crl = $${cadirectory:crl}
161
162 [ca-stunnel]
163 <= certificate-authority
164 recipe = slapos.cookbook:certificate_authority.request
165 executable = $${stunnel:wrapper}
166 wrapper = $${basedirectory:services}/stunnel
167 key-file = $${stunnel:key-file}
168 cert-file = $${stunnel:cert-file}
169
170
171 #----------------
172 #--
173 #-- Request Postgres instance and parse its URL.
174
175 [request-postgres]
176 <= slap-connection
177 recipe = slapos.cookbook:request
178 name = Postgres
179 software-url = $${slap-connection:software-release-url}
180 software-type = postgres
181 return = url
182 sla-computer_guid = $${slap-connection:computer-id}
183
184 [postgres-urlparse]
185 recipe = slapos.cookbook:urlparse
186 url = $${request-postgres:connection-url}
187
188
189 #----------------
190 #--
191 #-- Deploy Apache + PHP application.
192 #-- Despite the names of mysql-* parameters, they are not really specific to mysql.
193
194 [apache-php]
195 recipe = slapos.cookbook:apachephp
196 source = ${application:location}
197
198 htdocs = $${directory:www}
199 pid-file = $${basedirectory:run}/apache.pid
200 lock-file = $${basedirectory:run}/apache.lock
201 ip = $${slap-network-information:global-ipv6}
202 port = 8080
203 url = http://[$${:ip}]:$${:port}/
204 error-log = $${directory:httpd-log}/error.log
205 access-log = $${directory:httpd-log}/access.log
206 php-ini-dir = $${directory:php-ini-dir}
207 tmp-dir = $${directory:tmp-php}
208 httpd-conf = $${rootdirectory:etc}/apache.conf
209 wrapper = $${basedirectory:services}/apache
210
211 httpd-binary = ${apache:location}/bin/httpd
212
213
214 [logrotate-entry-apache]
215 <= logrotate
216 recipe = slapos.cookbook:logrotate.d
217 name = apache
218 log = $${apache-php:error-log} $${apache-php:access-log}
219 frequency = daily
220 rotate-num = 30
221 sharedscripts = true
222 notifempty = true
223 create = true
224
225
226 #----------------
227 #--
228 #-- Request frontend.
229
230 [request-frontend]
231 <= slap-connection
232 recipe = slapos.cookbook:requestoptional
233 name = Frontend
234 # XXX We have hardcoded SR URL here.
235 software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
236 slave = true
237 config-url = http://[$${apache-php:ip}]:$${apache-php:port}/
238 return = site_url
239 config-custom_domain = $${slap-parameter:domain}
240
241
242 #----------------
243 #--
244 #-- Deploy slapmonitor.
245
246 [slapmonitor]
247 recipe = slapos.cookbook:slapmonitor
248 pid-file = $${basedirectory:run}/apache.pid
249 database-path = $${basedirectory:log}/slapmonitor.db
250 slapmonitor-path = ${buildout:bin-directory}/slapmonitor
251 path = $${basedirectory:services}/slapmonitor
252
253 [slapmonitor-xml]
254 recipe = slapos.cookbook:slapmonitor-xml
255 database-path = $${basedirectory:log}/slapmonitor.db
256 slapmonitor-xml-path = ${buildout:bin-directory}/slapmonitor-xml
257 path = $${directory:report}/slapmonitor-xml
258
259
260 #----------------
261 #--
262 #-- Publish instance parameters.
263
264 [publish-connection-informations]
265 recipe = slapos.cookbook:publish
266 backend_url = $${apache-php:url}
267 url = $${request-frontend:connection-site_url}
268
269
270 #----------------
271 #--
272 #-- Deploy promises scripts.
273
274 [promise]
275 recipe = slapos.cookbook:check_port_listening
276 path = $${basedirectory:promises}/apache
277 hostname = $${apache-php:ip}
278 port = $${apache-php:port}
279
280 [frontend-promise]
281 recipe = slapos.cookbook:check_url_available
282 path = $${basedirectory:promises}/frontend
283 url = $${request-frontend:connection-site_url}
284 dash_path = ${dash:location}/bin/dash
285 curl_path = ${curl:location}/bin/curl
286
287 [content-promise]
288 recipe = slapos.cookbook:check_page_content
289 path = $${basedirectory:promises}/content
290 url = $${request-frontend:connection-site_url}
291 dash_path = ${dash:location}/bin/dash
292 curl_path = ${curl:location}/bin/curl
293
294
295
296
297 [slap-parameter]
298 # Default value if no domain is specified
299 domain =
300 # Default value if no ssh parameter is specified
301 logbox-ip =
302 logbox-port =
303 logbox-user =
304 logbox-passwd =
305