1 "$tool"/local
/runit-sv-configure php5-fpm
'*'
2 "$tool"/local
/runit-sv-start php5-fpm
3 "$tool"/local
/apt-get-install nginx spawn-fcgi fcgiwrap
4 "$tool"/local
/insserv-remove nginx
5 "$tool"/local
/insserv-remove fcgiwrap
9 sudo
install -d -m 770 -o www
-g www \
17 sudo
install -m 660 -o www
-g www \
18 "$tool"/etc
/nginx
/nginx.conf \
21 for conf
in $
(find "$tool"/etc
/nginx
/conf.d \
22 -mindepth 1 -maxdepth 1 -type f \
26 sudo
install -m 660 -o www
-g www \
27 "$tool"/etc
/nginx
/conf.d
/"$conf" \
28 /etc
/nginx
/conf.d
/"$conf"
31 for site
in $
(find "$tool"/etc
/nginx
/site.d \
32 -mindepth 1 -maxdepth 1 -type d \
33 -false ${@:+$(printf -- '-or -name %s\n' "$@")} \
36 "$tool"/local
/adduser www-
"$site" \
40 --home /home
/www
/pub
/"$site" \
43 "$tool"/local
/adduser log-www-
"$site" \
47 --home /home
/www
/log
/"$site"/nginx \
50 sudo
install -d -m 771 -o log-www
-g log-www \
52 sudo
install -d -m 770 -o www
-g www \
53 /etc
/nginx
/site.d
/"$site"
54 sudo
install -d -m 770 -o www
-g www \
55 /etc
/nginx
/x509.d
/"$site"
56 sudo
test -L /home
/www
/pub
/"$site" ||
57 sudo
install -d -m 2770 -o www-
"$site" -g www-
"$site" \
59 sudo adduser www-data www-
"$site"
60 sudo adduser www-data log-www-
"$site"
61 sudo
install -m 660 -o www
-g www \
62 "$tool"/etc
/nginx
/site.d
/"$site"/local.conf \
63 /etc
/nginx
/site.d
/"$site"/local.conf
64 test ! -e "$tool"/etc
/nginx
/site.d
/"$site"/http.conf ||
65 sudo
install -m 660 -o www
-g www \
66 "$tool"/etc
/nginx
/site.d
/"$site"/http.conf \
67 /etc
/nginx
/site.d
/"$site"/http.conf
68 if test -L "$tool"/etc
/nginx
/site.d
/"$site"/site.conf
70 sudo
cp --force --preserve=links
--no-dereference \
71 "$tool"/etc
/nginx
/site.d
/"$site"/site.conf \
72 /etc
/nginx
/site.d
/"$site"/site.conf
74 sudo
install -m 660 -o www
-g www \
75 "$tool"/etc
/nginx
/site.d
/"$site"/site.conf \
76 /etc
/nginx
/site.d
/"$site"/site.conf
78 sudo
install -m 660 -o www
-g www
/dev
/stdin \
79 /etc
/nginx
/site.d
/"$site"/server.conf
<<-EOF
81 access_log /home/www/log/$site/nginx/access.log main;
82 error_log /home/www/log/$site/nginx/error.log warn;
83 root /home/www/pub/$site;
84 include /etc/nginx/site.d/$site/local.conf;
85 include /etc/nginx/site.d/$site/site.conf;
90 test ! -r "$tool"/etc
/nginx
/site.d
/"$site"/local.sh ||
91 .
"$tool"/etc
/nginx
/site.d
/"$site"/local.sh ||
return 1