|
@ -93,7 +93,7 @@ impl<'b, C: 'b + CommandRunner, P: 'b + Policy> SymbolFactory<'b, C, P> { |
|
|
format!("/run/php/{}.sock", user_name).into()
|
|
|
format!("/run/php/{}.sock", user_name).into()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
fn get_php_fpm_pool<'a>(&'a self, user_name: &str) -> impl Symbol + 'a {
|
|
|
|
|
|
|
|
|
fn get_php_fpm_pool<'a>(&'a self, user_name: &str, max_children: usize) -> impl Symbol + 'a {
|
|
|
let socket = self.get_php_fpm_pool_socket_path(user_name);
|
|
|
let socket = self.get_php_fpm_pool_socket_path(user_name);
|
|
|
let php_version = self.policy.php_version();
|
|
|
let php_version = self.policy.php_version();
|
|
|
Hook::new(
|
|
|
Hook::new(
|
|
@ -107,12 +107,13 @@ group = www-data |
|
|
listen = {1}
|
|
|
listen = {1}
|
|
|
listen.owner = www-data
|
|
|
listen.owner = www-data
|
|
|
pm = ondemand
|
|
|
pm = ondemand
|
|
|
pm.max_children = 10
|
|
|
|
|
|
|
|
|
pm.max_children = {2}
|
|
|
catch_workers_output = yes
|
|
|
catch_workers_output = yes
|
|
|
env[PATH] = /usr/local/bin:/usr/bin:/bin
|
|
|
env[PATH] = /usr/local/bin:/usr/bin:/bin
|
|
|
",
|
|
|
",
|
|
|
user_name,
|
|
|
user_name,
|
|
|
socket.to_str().unwrap()
|
|
|
|
|
|
|
|
|
socket.to_str().unwrap(),
|
|
|
|
|
|
max_children
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
ReloadService::new(format!("php{}-fpm", php_version), self.command_runner),
|
|
|
ReloadService::new(format!("php{}-fpm", php_version), self.command_runner),
|
|
@ -123,12 +124,13 @@ env[PATH] = /usr/local/bin:/usr/bin:/bin |
|
|
&'a self,
|
|
|
&'a self,
|
|
|
host_name: &'static str,
|
|
|
host_name: &'static str,
|
|
|
root_dir: ROOT,
|
|
|
root_dir: ROOT,
|
|
|
|
|
|
max_children: usize,
|
|
|
additional_config: &'a str,
|
|
|
additional_config: &'a str,
|
|
|
) -> impl Symbol + 'a {
|
|
|
) -> impl Symbol + 'a {
|
|
|
let user_name = self.policy.user_name_for_host(host_name);
|
|
|
let user_name = self.policy.user_name_for_host(host_name);
|
|
|
let socket = self.get_php_fpm_pool_socket_path(&user_name);
|
|
|
let socket = self.get_php_fpm_pool_socket_path(&user_name);
|
|
|
List::from((
|
|
|
List::from((
|
|
|
self.get_php_fpm_pool(&user_name),
|
|
|
|
|
|
|
|
|
self.get_php_fpm_pool(&user_name, max_children),
|
|
|
self.get_nginx_acme_server(
|
|
|
self.get_nginx_acme_server(
|
|
|
host_name,
|
|
|
host_name,
|
|
|
NginxServer::new_php(
|
|
|
NginxServer::new_php(
|
|
@ -150,6 +152,7 @@ env[PATH] = /usr/local/bin:/usr/bin:/bin |
|
|
self.serve_php(
|
|
|
self.serve_php(
|
|
|
host_name,
|
|
|
host_name,
|
|
|
root_dir,
|
|
|
root_dir,
|
|
|
|
|
|
10,
|
|
|
"
|
|
|
"
|
|
|
location / {{
|
|
|
location / {{
|
|
|
try_files $uri $uri/ /index.php?$args;
|
|
|
try_files $uri $uri/ /index.php?$args;
|
|
@ -166,7 +169,7 @@ env[PATH] = /usr/local/bin:/usr/bin:/bin |
|
|
let user_name = self.policy.user_name_for_host(host_name);
|
|
|
let user_name = self.policy.user_name_for_host(host_name);
|
|
|
let socket = self.get_php_fpm_pool_socket_path(&user_name);
|
|
|
let socket = self.get_php_fpm_pool_socket_path(&user_name);
|
|
|
List::from((
|
|
|
List::from((
|
|
|
self.get_php_fpm_pool(&user_name),
|
|
|
|
|
|
|
|
|
self.get_php_fpm_pool(&user_name, 10),
|
|
|
self.get_nginx_acme_server(host_name,
|
|
|
self.get_nginx_acme_server(host_name,
|
|
|
NginxServer::new(
|
|
|
NginxServer::new(
|
|
|
host_name,
|
|
|
host_name,
|
|
@ -205,6 +208,7 @@ env[PATH] = /usr/local/bin:/usr/bin:/bin |
|
|
self.serve_php(
|
|
|
self.serve_php(
|
|
|
host_name,
|
|
|
host_name,
|
|
|
root_dir,
|
|
|
root_dir,
|
|
|
|
|
|
25,
|
|
|
"
|
|
|
"
|
|
|
client_max_body_size 500M;
|
|
|
client_max_body_size 500M;
|
|
|
|
|
|
|
|
|