apache.cfg 1.3 KB
Newer Older
1 2 3 4 5 6 7 8 9
[buildout]
parts = apache-instance

[configuration]
httpd_port = 8181
#httpd_host = 127.0.0.1
httpd_datadir = ${buildout:var-directory}/httpd
httpd_htdocs = ${:httpd_datadir}/htdocs
httpd_cgibin = ${:httpd_datadir}/cgi-bin
10 11
httpd_vhost_rewrite_rules =
  RewriteRule      ^/static(.*) ${configuration:httpd_htdocs}$1 [L]
12 13 14

[apache-httpd]
recipe = collective.recipe.template
15
input = ${software_definition:software_home}/templates/httpd.in
16 17 18
output = ${buildout:data-bin-directory}/httpd
config-path = ${apache-conf:output}

19 20 21 22 23
[apache-vhost]
recipe = collective.recipe.template
input = ${software_definition:software_home}/templates/httpd.vhost.conf.in
output = ${buildout:var-directory}/etc/httpd.vhost.conf

24 25
[apache-conf]
recipe = collective.recipe.template
26
input = ${software_definition:software_home}/templates/httpd.conf.in
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
output = ${buildout:var-directory}/etc/httpd.conf

[apache-instance]
depends =
  ${create-directories:command}
  ${apache-httpd:output}
  ${apache-conf:output}

recipe = plone.recipe.command
command =
    mkdir -p ${configuration:httpd_htdocs}
    mkdir -p ${configuration:httpd_cgibin}
    mkdir -p ${buildout:log-directory}/httpd
    [ -f ${configuration:httpd_htdocs}/index.html ] || echo "<html><body><h1>It works!</h1></body></html>" > ${configuration:httpd_htdocs}/index.html

update-command = ${:command}