-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02-administration-08-webserver.cfg
executable file
·78 lines (55 loc) · 2.6 KB
/
02-administration-08-webserver.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Buildout Configuration File for Nginx Web Server
# Nginx (engine x) is a web server can be used as standalone HTTP server and
# as a reverse proxy server before some Apache or another big server
# to reduce load to backend servers by many concurrent HTTP-sessions.
# For information see http://nginx.net
[buildout]
extends = 02-administration-07-load-balancers.cfg
parts +=
nginx-requemients
nginx-vhost
# nginx-mime-types
nginx-config
# This recipe is used to install prerequemients to cenditel multimedia products
[nginx-requemients]
recipe = plone.recipe.command
# Command to run when the buildout part is installed.
command =
aptitude install -y nginx
mkdir -p ${buildout:directory}/etc/nginx/sites-enabled
# Command to run when the buildout part is updated. This happens when buildout
# is run but the configuration for this buildout part has not changed.
update-command = ${nginx-requemients:command}
# When yes, on or true, buildout will stop if the command ends with a non zero exit code.
stop-on-error = yes
# This recipe helps to initializes a nginx vhost configuration file for Plone Website
# For options see http://pypi.python.org/pypi/collective.recipe.template
[nginx-vhost]
recipe = collective.recipe.template
# Input path of template file
input = ${buildout:directory}/templates/nginx.vhost.tmpl
# Output path creation
output = ${buildout:directory}/etc/nginx/sites-enabled/${buildout:site-id}
# This recipe helps to initializes a nginx mime types configuration file for Plone Website
# For options see http://pypi.python.org/pypi/collective.recipe.template
#[nginx-mime-types]
#recipe = collective.recipe.template
# Input path of template file
#input = ${buildout:directory}/templates/nginx.mime.types
# Output path creation
#output = ${buildout:directory}/etc/nginx/${buildout:site-id}.mime.types
# This recipe is used enabled the cenditel multimeda Nginx configurations
[nginx-config]
recipe = plone.recipe.command
# Command to run when the buildout part is installed.
command =
ln -s ${nginx-vhost:output} /etc/nginx/sites-enabled/${buildout:site-id}
ln -s /etc/nginx/sites-enabled/${buildout:site-id} /etc/nginx/sites-available/${buildout:site-id}
# ln -s ${nginx-mime-types:output} /etc/nginx/${buildout:site-id}.mime.types
nginx -t
/etc/init.d/nginx reload
# Command to run when the buildout part is updated. This happens when buildout
# is run but the configuration for this buildout part has not changed.
update-command = ${nginx-config:command}
# When yes, on or true, buildout will stop if the command ends with a non zero exit code.
stop-on-error = yes