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