request: drop redundant 'config' & 'sla' options
[slapos.git] / stack / lamp / 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
14   frontend-promise
15   content-promise
16   publish-connection-informations
17   ${custom-application-deployment:part-list}
18
19
20 eggs-directory = ${buildout:eggs-directory}
21 develop-eggs-directory = ${buildout:develop-eggs-directory}
22 offline = true
23
24
25 #----------------
26 #--
27 #-- Creation of all needed directories.
28
29 [rootdirectory]
30 recipe = slapos.cookbook:mkdirectory
31 etc = $${buildout:directory}/etc
32 var = $${buildout:directory}/var
33 srv = $${buildout:directory}/srv
34 bin = $${buildout:directory}/bin
35 tmp = $${buildout:directory}/tmp
36
37 [basedirectory]
38 recipe = slapos.cookbook:mkdirectory
39 log = $${rootdirectory:var}/log
40 services = $${rootdirectory:etc}/service
41 scripts = $${rootdirectory:etc}/run
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 = $${mariadb-urlparse:host}
124 remote-port = $${mariadb-urlparse:port}
125 local-host = $${slap-network-information:local-ipv4}
126 local-port = 3306
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 MariaDB instance and parse its URL.
174
175 [request-mariadb]
176 <= slap-connection
177 recipe = slapos.cookbook:request
178 name = MariaDB
179 software-url = $${slap-connection:software-release-url}
180 software-type = mariadb
181 return = url
182 sla-computer_guid = $${slap-connection:computer-id}
183
184 [mariadb-urlparse]
185 recipe = slapos.cookbook:urlparse
186 url = $${request-mariadb:connection-url}
187
188
189
190 #----------------
191 #--
192 #-- Common network parameters
193 [apache-network-configuration]
194 listening-ip = $${slap-network-information:global-ipv6}
195 listening-port = 8080
196
197
198 #----------------
199 #--
200 #-- Deploy Apache + PHP application.
201
202 [apache-php]
203 recipe = slapos.cookbook:apachephp
204 source = ${application:location}
205 template = ${application-template:location}/${application-template:filename}
206 configuration = ${application-configuration:location}
207
208 htdocs = $${directory:www}
209 pid-file = $${basedirectory:run}/apache.pid
210 lock-file = $${basedirectory:run}/apache.lock
211 ip = $${apache-network-configuration:listening-ip}
212 port = $${apache-network-configuration:listening-port}
213 url = http://[$${:ip}]:$${:port}/
214 error-log = $${directory:httpd-log}/error.log
215 access-log = $${directory:httpd-log}/access.log
216 php-ini-dir = $${directory:php-ini-dir}
217 tmp-dir = $${directory:tmp-php}
218 httpd-conf = $${rootdirectory:etc}/apache.conf
219 wrapper = $${basedirectory:services}/apache
220
221 httpd-binary = ${apache:location}/bin/httpd
222
223 mysql-username = $${mariadb-urlparse:username}
224 mysql-password = $${mariadb-urlparse:password}
225 mysql-database = $${mariadb-urlparse:path}
226 mysql-host = $${stunnel:local-host}
227 mysql-port = $${stunnel:local-port}
228
229 [logrotate-entry-apache]
230 <= logrotate
231 recipe = slapos.cookbook:logrotate.d
232 name = apache
233 log = $${apache-php:error-log} $${apache-php:access-log}
234 frequency = daily
235 rotate-num = 30
236 sharedscripts = true
237 notifempty = true
238 create = true
239
240
241 #----------------
242 #--
243 #-- Request frontend.
244
245 [request-frontend]
246 <= slap-connection
247 recipe = slapos.cookbook:requestoptional
248 name = Frontend
249 # XXX We have hardcoded SR URL here.
250 software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
251 slave = true
252 config-url = http://[$${apache-network-configuration:listening-ip}]:$${apache-network-configuration:listening-port}/
253 return = site_url
254 config-custom_domain = $${slap-parameter:domain}
255
256
257 #----------------
258 #--
259 #-- Deploy slapmonitor.
260
261 #[slapmonitor]
262 #recipe = slapos.cookbook:slapmonitor
263 #pid-file = $${basedirectory:run}/apache.pid
264 #database-path = $${basedirectory:log}/slapmonitor.db
265 #slapmonitor-path = ${buildout:bin-directory}/slapmonitor
266 #path = $${basedirectory:services}/slapmonitor
267 #
268 #[slapmonitor-xml]
269 #recipe = slapos.cookbook:slapmonitor-xml
270 #database-path = $${basedirectory:log}/slapmonitor.db
271 #slapmonitor-xml-path = ${buildout:bin-directory}/slapmonitor-xml
272 #path = $${directory:report}/slapmonitor-xml
273
274
275 #----------------
276 #--
277 #-- Publish instance parameters.
278
279 [publish-connection-informations]
280 recipe = slapos.cookbook:publish
281 backend_url = $${apache-php:url}
282 url = $${request-frontend:connection-site_url}
283
284
285 #----------------
286 #--
287 #-- Deploy promises scripts.
288
289 [promise]
290 recipe = slapos.cookbook:check_port_listening
291 path = $${basedirectory:promises}/apache
292 hostname = $${apache-php:ip}
293 port = $${apache-php:port}
294
295 [frontend-promise]
296 recipe = slapos.cookbook:check_url_available
297 path = $${basedirectory:promises}/frontend
298 url = $${request-frontend:connection-site_url}
299 dash_path = ${dash:location}/bin/dash
300 curl_path = ${curl:location}/bin/curl
301
302 [content-promise]
303 recipe = slapos.cookbook:check_page_content
304 path = $${basedirectory:promises}/content
305 url = $${request-frontend:connection-site_url}
306 dash_path = ${dash:location}/bin/dash
307 curl_path = ${curl:location}/bin/curl
308
309
310
311
312 [slap-parameter]
313 # Default value if no domain is specified
314 domain =
315 # Default value if no ssh parameter is specified
316 logbox-ip =
317 logbox-port =
318 logbox-user =
319 logbox-passwd =
320