Merge branch 'erp5-component' into erp5
[slapos.git] / software / ajaxplorer / instance-apachephp.cfg
1 [buildout]
2
3 parts =
4   certificate-authority
5   ca-stunnel
6   logrotate
7   logrotate-entry-apache
8   logrotate-entry-stunnel
9   cron
10   cron-entry-logrotate
11   promise
12
13   frontend-ajaxupload-promise
14   frontend-website2-promise
15   frontend-website-promise
16 #  content-promise
17   publish-connection-informations
18
19 eggs-directory = ${buildout:eggs-directory}
20 develop-eggs-directory = ${buildout:develop-eggs-directory}
21 offline = true
22
23
24 #----------------
25 #--
26 #-- Creation of all needed directories.
27
28 [rootdirectory]
29 recipe = slapos.cookbook:mkdirectory
30 etc = $${buildout:directory}/etc
31 var = $${buildout:directory}/var
32 srv = $${buildout:directory}/srv
33 bin = $${buildout:directory}/bin
34 tmp = $${buildout:directory}/tmp
35
36 [basedirectory]
37 recipe = slapos.cookbook:mkdirectory
38 log = $${rootdirectory:var}/log
39 services = $${rootdirectory:etc}/service
40 run = $${rootdirectory:var}/run
41 backup = $${rootdirectory:srv}/backup
42 promises = $${rootdirectory:etc}/promise
43
44 [directory]
45 recipe = slapos.cookbook:mkdirectory
46 cron-entries = $${rootdirectory:etc}/cron.d
47 crontabs = $${rootdirectory:etc}/crontabs
48 cronstamps = $${rootdirectory:etc}/cronstamps
49 ca-dir = $${rootdirectory:srv}/ssl
50 httpd-log = $${basedirectory:log}/apache
51 php-ini-dir = $${rootdirectory:etc}/php
52 tmp-php = $${rootdirectory:tmp}/php
53 logrotate-entries = $${rootdirectory:etc}/logrotate.d
54 logrotate-backup = $${basedirectory:backup}/logrotate
55 report = $${rootdirectory:etc}/report
56 stunnel-conf = $${rootdirectory:etc}/stunnel
57 xml-report = $${rootdirectory:var}/xml_report
58 www = $${rootdirectory:srv}/www/
59
60 [cadirectory]
61 recipe = slapos.cookbook:mkdirectory
62 requests = $${directory:ca-dir}/requests
63 private = $${directory:ca-dir}/private
64 certs = $${directory:ca-dir}/certs
65 newcerts = $${directory:ca-dir}/newcerts
66 crl = $${directory:ca-dir}/crl
67
68
69 #----------------
70 #--
71 #-- Deploy cron.
72
73 [cron]
74 recipe = slapos.cookbook:cron
75 dcrond-binary = ${dcron:location}/sbin/crond
76 cron-entries = $${directory:cron-entries}
77 crontabs = $${directory:crontabs}
78 cronstamps = $${directory:cronstamps}
79 catcher = $${cron-simplelogger:wrapper}
80 binary = $${basedirectory:services}/crond
81
82 [cron-simplelogger]
83 recipe = slapos.cookbook:simplelogger
84 wrapper = $${rootdirectory:bin}/cron_simplelogger
85 log = $${basedirectory:log}/crond.log
86
87
88 #----------------
89 #--
90 #-- Deploy logrotate.
91
92 [cron-entry-logrotate]
93 <= cron
94 recipe = slapos.cookbook:cron.d
95 name = logrotate
96 frequency = 0 0 * * *
97 command = $${logrotate:wrapper}
98
99 [logrotate]
100 recipe = slapos.cookbook:logrotate
101 # Binaries
102 logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
103 gzip-binary = ${gzip:location}/bin/gzip
104 gunzip-binary = ${gzip:location}/bin/gunzip
105 # Directories
106 wrapper = $${rootdirectory:bin}/logrotate
107 conf = $${rootdirectory:etc}/logrotate.conf
108 logrotate-entries = $${directory:logrotate-entries}
109 backup = $${directory:logrotate-backup}
110 state-file = $${rootdirectory:srv}/logrotate.status
111
112
113 #----------------
114 #--
115 #-- Deploy stunnel.
116
117 [stunnel]
118 recipe = slapos.cookbook:stunnel
119 client = true
120 stunnel-binary = ${stunnel:location}/bin/stunnel
121 remote-host = $${mariadb-urlparse:host}
122 remote-port = $${mariadb-urlparse:port}
123 local-host = $${slap-network-information:local-ipv4}
124 local-port = 3306
125 log-file = $${basedirectory:log}/stunnel.log
126 config-file = $${directory:stunnel-conf}/stunnel.conf
127 key-file = $${directory:stunnel-conf}/stunnel.key
128 cert-file = $${directory:stunnel-conf}/stunnel.crt
129 pid-file = $${basedirectory:run}/stunnel.pid
130 wrapper = $${rootdirectory:bin}/raw_stunnel
131 post-rotate-script = $${rootdirectory:bin}/stunnel_post_rotate
132
133 [logrotate-entry-stunnel]
134 <= logrotate
135 recipe = slapos.cookbook:logrotate.d
136 name = stunnel
137 log = $${stunnel:log-file}
138 frequency = daily
139 rotate-num = 30
140 notifempty = true
141 create = true
142 post = $${stunnel:post-rotate-script}
143
144
145 #----------------
146 #--
147 #-- Certificate stuff.
148
149 [certificate-authority]
150 recipe = slapos.cookbook:certificate_authority
151 openssl-binary = ${openssl:location}/bin/openssl
152 ca-dir = $${directory:ca-dir}
153 requests-directory = $${cadirectory:requests}
154 wrapper = $${basedirectory:services}/ca
155 ca-private = $${cadirectory:private}
156 ca-certs = $${cadirectory:certs}
157 ca-newcerts = $${cadirectory:newcerts}
158 ca-crl = $${cadirectory:crl}
159
160 [ca-stunnel]
161 <= certificate-authority
162 recipe = slapos.cookbook:certificate_authority.request
163 executable = $${stunnel:wrapper}
164 wrapper = $${basedirectory:services}/stunnel
165 key-file = $${stunnel:key-file}
166 cert-file = $${stunnel:cert-file}
167
168
169 #----------------
170 #--
171 #-- Request MariaDB instance and parse its URL.
172
173 [request-mariadb]
174 <= slap-connection
175 recipe = slapos.cookbook:request
176 name = MariaDB
177 software-url = $${slap-connection:software-release-url}
178 software-type = mariadb
179 return = url
180 sla = computer_guid
181 sla-computer_guid = $${slap-connection:computer-id}
182
183 [mariadb-urlparse]
184 recipe = slapos.cookbook:urlparse
185 url = $${request-mariadb:connection-url}
186
187
188 #----------------
189 #--
190 #-- Deploy Apache + PHP application.
191 [httpd-conf]
192 recipe = slapos.recipe.template
193 url = ${template-httpd-conf:location}/${template-httpd-conf:filename}
194 output = $${rootdirectory:etc}/apache.conf
195 mode = 0600
196
197 document_root = $${rootdirectory:srv}/www/
198 pid_file = $${basedirectory:run}/apache.pid
199 lock_file = $${basedirectory:run}/apache.lock
200 ip = $${slap-network-information:global-ipv6}
201 port = 8080
202 port2 = 8070
203 port3 = 8090
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
208
209 # Deploy Apache + PHP application
210 [apache-php]
211 recipe = slapos.cookbook:apachephp
212 source = ${application:location}
213 template = 
214 configuration = 
215
216 htdocs = $${directory:www}
217 pid-file = $${basedirectory:run}/apache.pid
218 lock-file = $${basedirectory:run}/apache.lock
219 ip = $${httpd-conf:ip}
220 port = $${httpd-conf:port}
221 url = http://[$${:ip}]:$${:port}/
222 error-log = $${directory:httpd-log}/error.log
223 access-log = $${directory:httpd-log}/access.log
224 php-ini-dir = $${directory:php-ini-dir}
225 tmp-dir = $${directory:tmp-php}
226 wrapper = $${basedirectory:services}/apache
227
228 httpd-binary = ${apache:location}/bin/httpd
229
230 default-conf = false
231 httpd-conf = $${httpd-conf:output}
232
233 mysql-username = $${mariadb-urlparse:username}
234 mysql-password = $${mariadb-urlparse:password}
235 mysql-database = $${mariadb-urlparse:path}
236 mysql-host = $${stunnel:local-host}
237 mysql-port = $${stunnel:local-port}
238
239
240 [logrotate-entry-apache]
241 <= logrotate
242 recipe = slapos.cookbook:logrotate.d
243 name = apache
244 log = $${apache-php:error-log} $${apache-php:access-log}
245 frequency = daily
246 rotate-num = 30
247 sharedscripts = true
248 notifempty = true
249 create = true
250
251
252 #----------------
253 #--
254 #-- Request frontends.
255
256 [request-frontend]
257 <= slap-connection
258 recipe = slapos.cookbook:requestoptional
259 name = Frontend-Website
260 # XXX We have hardcoded SR URL here.
261 software-url = $${slap-parameter:frontend-software-url}
262 slave = true
263 config = url custom_domain
264 config-url = http://[$${apache-php:ip}]:$${apache-php:port}/
265 return = site_url
266 config-custom_domain = $${slap-parameter:domain}
267
268 [request-frontend-ajaxupload]
269 <= slap-connection
270 recipe = slapos.cookbook:requestoptional
271 name = Frontend-FileManager
272 # XXX We have hardcoded SR URL here.
273 software-url = $${slap-parameter:frontend-software-url}
274 slave = true
275 config = url custom_domain
276 config-url = http://[$${httpd-conf:ip}]:$${httpd-conf:port2}/
277 return = site_url
278 config-custom_domain = $${slap-parameter:domain2}
279
280 [request-frontend2]
281 <= slap-connection
282 recipe = slapos.cookbook:requestoptional
283 name = Frontend-Website2
284 # XXX We have hardcoded SR URL here.
285 software-url = $${slap-parameter:frontend-software-url}
286 slave = true
287 config = url custom_domain
288 config-url = http://[$${httpd-conf:ip}]:$${httpd-conf:port3}/
289 return = site_url
290 config-custom_domain = $${slap-parameter:domain3}
291
292
293 #----------------
294 #--
295 #-- Deploy slapmonitor.
296
297 #[slapmonitor]
298 #recipe = slapos.cookbook:slapmonitor
299 #pid-file = $${basedirectory:run}/apache.pid
300 #database-path = $${basedirectory:log}/slapmonitor.db
301 #slapmonitor-path = ${buildout:bin-directory}/slapmonitor
302 #path = $${basedirectory:services}/slapmonitor
303 #
304 #[slapmonitor-xml]
305 #recipe = slapos.cookbook:slapmonitor-xml
306 #database-path = $${basedirectory:log}/slapmonitor.db
307 #slapmonitor-xml-path = ${buildout:bin-directory}/slapmonitor-xml
308 #path = $${directory:report}/slapmonitor-xml
309
310
311 #----------------
312 #--
313 #-- Publish instance parameters.
314
315 [publish-connection-informations]
316 recipe = slapos.cookbook:publish
317 website-backend-url = $${apache-php:url}
318 website-url = $${request-frontend:connection-site_url}
319 website2-backend-url = http://[$${apache-php:ip}]:$${httpd-conf:port3}
320 website2-url  = $${request-frontend2:connection-site_url}
321 filemanager-backend-url = http://[$${apache-php:ip}]:$${httpd-conf:port2}
322 fileManager-url = $${request-frontend-ajaxupload:connection-site_url}
323 mysql-username = $${mariadb-urlparse:username}
324 mysql-password = $${mariadb-urlparse:password}
325 mysql-database = $${mariadb-urlparse:path}
326 mysql-host = $${stunnel:local-host}
327 mysql-port = $${stunnel:local-port}
328
329
330 #----------------
331 #--
332 #-- Deploy promises scripts.
333
334 [promise]
335 recipe = slapos.cookbook:check_port_listening
336 path = $${basedirectory:promises}/apache
337 hostname = $${apache-php:ip}
338 port = $${apache-php:port}
339
340 [frontend-website-promise]
341 recipe = slapos.cookbook:check_url_available
342 path = $${basedirectory:promises}/frontend-website
343 url = $${request-frontend:connection-site_url}
344 dash_path = ${dash:location}/bin/dash
345 curl_path = ${curl:location}/bin/curl
346
347 [frontend-website2-promise]
348 recipe = slapos.cookbook:check_url_available
349 path = $${basedirectory:promises}/frontend-website2
350 url = $${request-frontend2:connection-site_url}
351 dash_path = ${dash:location}/bin/dash
352 curl_path = ${curl:location}/bin/curl
353
354 [frontend-ajaxupload-promise]
355 recipe = slapos.cookbook:check_url_available
356 path = $${basedirectory:promises}/frontend-ajaxupload
357 url = $${request-frontend-ajaxupload:connection-site_url}
358 dash_path = ${dash:location}/bin/dash
359 curl_path = ${curl:location}/bin/curl
360
361 [content-promise]
362 recipe = slapos.cookbook:check_page_content
363 path = $${basedirectory:promises}/content
364 url = $${request-frontend-ajaxupload:connection-site_url}
365 match = AjaXplorer
366 dash_path = ${dash:location}/bin/dash
367 curl_path = ${curl:location}/bin/curl
368
369
370
371
372 [slap-parameter]
373 # Default value if no domain is specified
374 domain =
375 domain2 =
376 domain3 =
377 frontend-software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
378 # Default value if no ssh parameter is specified
379 logbox-ip =
380 logbox-port =
381 logbox-user =
382 logbox-passwd =