instance-kvm-http.cfg.in 1.83 KB
Newer Older
1 2 3 4
[buildout]

parts = 
  httpd
5
  httpd-graceful
6 7 8 9 10 11 12 13 14 15
  httpd-promise

[directory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
bin = ${buildout:directory}/bin
srv = ${buildout:directory}/srv
public = ${:srv}/public/
log = ${:var}/log
services = ${:etc}/service
16
scripts = ${:etc}/run
17 18
promises = ${:etc}/promise
run = ${:var}/run
19 20
document = ${:srv}/document
ssl = ${:etc}/ssl
21 22 23 24 25

[apache-conf]
recipe = slapos.recipe.template:jinja2
template = {{ template_apache_conf }}
rendered = ${directory:etc}/apache.conf
26 27
ip = ${slap-network-information:global-ipv6}
#ipv4 = ${slap-network-information:local-ipv4}
28 29 30 31 32
port = ${slap-parameter:httpd-port}
error-log = ${directory:log}/apache-error.log
access-log = ${directory:log}/apache-access.log
pid-file = ${directory:run}/apache.pid
index = ${directory:public}
33 34
root = {:index}
denied-root-access = false
35 36
context = 
  key port :port
37
  key ip :ip
38 39 40 41
  key access_log :access-log
  key error_log :error-log
  key pid_file :pid-file
  key index_folder :index
42 43 44
  key cert httpd-ssl:cert
  key key httpd-ssl:key
  key document_root :root
45 46 47 48 49 50

[httpd]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:services}/httpd
command-line = "{{ apache_location }}/bin/httpd" -f "${apache-conf:rendered}" -DFOREGROUND

51 52 53 54 55 56 57 58
[httpd-graceful]
recipe = collective.recipe.template
input = inline:
  #!/bin/sh
  exec kill -USR1 $(cat ${apache-conf:pid-file})
output = ${directory:scripts}/httpd-graceful
mode = 700

59 60 61 62 63 64 65 66
[httpd-ssl]
recipe = plone.recipe.command
command = "{{ openssl_executable_location }}" req -newkey rsa -batch -new -x509 -days 3650 -nodes -keyout "${:key}" -out "${:cert}"
key = ${directory:ssl}/key
cert = ${directory:ssl}/cert
update-command = 
stop-on-error = true

67 68 69
[httpd-promise]
recipe = slapos.cookbook:check_port_listening
path = ${directory:promises}/apache-httpd
70
hostname = ${apache-conf:ip}
71
port = ${apache-conf:port}