Skip to content

Commit b4b8f38

Browse files
committed
Using sury php packages for php-fpm.
1 parent 4fa73ff commit b4b8f38

File tree

22 files changed

+805
-94
lines changed

22 files changed

+805
-94
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
# Adding php pool conf
3+
user="$1"
4+
domain="$2"
5+
ip="$3"
6+
home_dir="$4"
7+
docroot="$5"
8+
9+
pool_conf="[$2]
10+
11+
listen = /run/php/php7.2-fpm-$2.sock
12+
listen.owner = $1
13+
listen.group = $1
14+
listen.mode = 0666
15+
16+
user = $1
17+
group = $1
18+
19+
pm = ondemand
20+
pm.max_children = 4
21+
pm.max_requests = 4000
22+
pm.process_idle_timeout = 10s
23+
pm.status_path = /status
24+
25+
php_admin_value[upload_tmp_dir] = /home/$1/tmp
26+
php_admin_value[session.save_path] = /home/$1/tmp
27+
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcubemail
28+
php_admin_value[upload_max_filesize] = 80M
29+
php_admin_value[max_execution_time] = 20
30+
php_admin_value[post_max_size] = 80M
31+
php_admin_value[memory_limit] = 256M
32+
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
33+
php_admin_flag[mysql.allow_persistent] = off
34+
php_admin_flag[safe_mode] = off
35+
36+
env[PATH] = /usr/local/bin:/usr/bin:/bin
37+
env[TMP] = /home/$1/tmp
38+
env[TMPDIR] = /home/$1/tmp
39+
env[TEMP] = /home/$1/tmp
40+
"
41+
42+
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
43+
44+
if [ ! -f "$pool_file_72" ]; then
45+
echo "$pool_conf" > $pool_file_72
46+
service php7.2-fpm restart
47+
fi
48+
49+
exit 0
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
server {
2+
listen %ip%:%web_ssl_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %sdocroot%;
5+
index index.php index.html index.htm;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8+
error_log /var/log/nginx/domains/%domain%.error.log error;
9+
10+
ssl on;
11+
ssl_certificate %ssl_pem%;
12+
ssl_certificate_key %ssl_key%;
13+
14+
location / {
15+
16+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
17+
expires max;
18+
}
19+
20+
location ~ [^/]\.php(/|$) {
21+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
22+
if (!-f $document_root$fastcgi_script_name) {
23+
return 404;
24+
}
25+
26+
fastcgi_pass unix:/run/php/php7.2-fpm-%domain%.sock;
27+
fastcgi_index index.php;
28+
include /etc/nginx/fastcgi_params;
29+
}
30+
}
31+
32+
error_page 403 /error/404.html;
33+
error_page 404 /error/404.html;
34+
error_page 500 502 503 504 /error/50x.html;
35+
36+
location /error/ {
37+
alias %home%/%user%/web/%domain%/document_errors/;
38+
}
39+
40+
location ~* "/\.(htaccess|htpasswd)$" {
41+
deny all;
42+
return 404;
43+
}
44+
45+
location /vstats/ {
46+
alias %home%/%user%/web/%domain%/stats/;
47+
include %home%/%user%/conf/web/%domain%.auth*;
48+
}
49+
50+
include /etc/nginx/conf.d/phpmyadmin.inc*;
51+
include /etc/nginx/conf.d/phppgadmin.inc*;
52+
include /etc/nginx/conf.d/webmail.inc*;
53+
54+
include %home%/%user%/conf/web/snginx.%domain%.conf*;
55+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
server {
2+
listen %ip%:%web_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %docroot%;
5+
index index.php index.html index.htm;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8+
error_log /var/log/nginx/domains/%domain%.error.log error;
9+
10+
location / {
11+
12+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
13+
expires max;
14+
}
15+
16+
location ~ [^/]\.php(/|$) {
17+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
18+
if (!-f $document_root$fastcgi_script_name) {
19+
return 404;
20+
}
21+
22+
fastcgi_pass unix:/run/php/php7.2-fpm-%domain%.sock;
23+
fastcgi_index index.php;
24+
include /etc/nginx/fastcgi_params;
25+
}
26+
}
27+
28+
error_page 403 /error/404.html;
29+
error_page 404 /error/404.html;
30+
error_page 500 502 503 504 /error/50x.html;
31+
32+
location /error/ {
33+
alias %home%/%user%/web/%domain%/document_errors/;
34+
}
35+
36+
location ~* "/\.(htaccess|htpasswd)$" {
37+
deny all;
38+
return 404;
39+
}
40+
41+
location /vstats/ {
42+
alias %home%/%user%/web/%domain%/stats/;
43+
include %home%/%user%/conf/web/%domain%.auth*;
44+
}
45+
46+
include /etc/nginx/conf.d/phpmyadmin.inc*;
47+
include /etc/nginx/conf.d/phppgadmin.inc*;
48+
include /etc/nginx/conf.d/webmail.inc*;
49+
50+
include %home%/%user%/conf/web/nginx.%domain%.conf*;
51+
}

install/debian/8/php5-fpm/www.conf

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
# Adding php pool conf
3+
user="$1"
4+
domain="$2"
5+
ip="$3"
6+
home_dir="$4"
7+
docroot="$5"
8+
9+
pool_conf="[$2]
10+
11+
listen = /run/php/php7.2-fpm-$2.sock
12+
listen.owner = $1
13+
listen.group = $1
14+
listen.mode = 0666
15+
16+
user = $1
17+
group = $1
18+
19+
pm = ondemand
20+
pm.max_children = 4
21+
pm.max_requests = 4000
22+
pm.process_idle_timeout = 10s
23+
pm.status_path = /status
24+
25+
php_admin_value[upload_tmp_dir] = /home/$1/tmp
26+
php_admin_value[session.save_path] = /home/$1/tmp
27+
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcubemail
28+
php_admin_value[upload_max_filesize] = 80M
29+
php_admin_value[max_execution_time] = 20
30+
php_admin_value[post_max_size] = 80M
31+
php_admin_value[memory_limit] = 256M
32+
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
33+
php_admin_flag[mysql.allow_persistent] = off
34+
php_admin_flag[safe_mode] = off
35+
36+
env[PATH] = /usr/local/bin:/usr/bin:/bin
37+
env[TMP] = /home/$1/tmp
38+
env[TMPDIR] = /home/$1/tmp
39+
env[TEMP] = /home/$1/tmp
40+
"
41+
42+
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
43+
44+
if [ ! -f "$pool_file_72" ]; then
45+
echo "$pool_conf" > $pool_file_72
46+
service php7.2-fpm restart
47+
fi
48+
49+
exit 0
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
server {
2+
listen %ip%:%web_ssl_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %sdocroot%;
5+
index index.php index.html index.htm;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8+
error_log /var/log/nginx/domains/%domain%.error.log error;
9+
10+
ssl on;
11+
ssl_certificate %ssl_pem%;
12+
ssl_certificate_key %ssl_key%;
13+
14+
location / {
15+
16+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
17+
expires max;
18+
}
19+
20+
location ~ [^/]\.php(/|$) {
21+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
22+
if (!-f $document_root$fastcgi_script_name) {
23+
return 404;
24+
}
25+
26+
fastcgi_pass unix:/run/php/php7.2-fpm-%domain%.sock;
27+
fastcgi_index index.php;
28+
include /etc/nginx/fastcgi_params;
29+
}
30+
}
31+
32+
error_page 403 /error/404.html;
33+
error_page 404 /error/404.html;
34+
error_page 500 502 503 504 /error/50x.html;
35+
36+
location /error/ {
37+
alias %home%/%user%/web/%domain%/document_errors/;
38+
}
39+
40+
location ~* "/\.(htaccess|htpasswd)$" {
41+
deny all;
42+
return 404;
43+
}
44+
45+
location /vstats/ {
46+
alias %home%/%user%/web/%domain%/stats/;
47+
include %home%/%user%/conf/web/%domain%.auth*;
48+
}
49+
50+
include /etc/nginx/conf.d/phpmyadmin.inc*;
51+
include /etc/nginx/conf.d/phppgadmin.inc*;
52+
include /etc/nginx/conf.d/webmail.inc*;
53+
54+
include %home%/%user%/conf/web/snginx.%domain%.conf*;
55+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
server {
2+
listen %ip%:%web_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %docroot%;
5+
index index.php index.html index.htm;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8+
error_log /var/log/nginx/domains/%domain%.error.log error;
9+
10+
location / {
11+
12+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
13+
expires max;
14+
}
15+
16+
location ~ [^/]\.php(/|$) {
17+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
18+
if (!-f $document_root$fastcgi_script_name) {
19+
return 404;
20+
}
21+
22+
fastcgi_pass unix:/run/php/php7.2-fpm-%domain%.sock;
23+
fastcgi_index index.php;
24+
include /etc/nginx/fastcgi_params;
25+
}
26+
}
27+
28+
error_page 403 /error/404.html;
29+
error_page 404 /error/404.html;
30+
error_page 500 502 503 504 /error/50x.html;
31+
32+
location /error/ {
33+
alias %home%/%user%/web/%domain%/document_errors/;
34+
}
35+
36+
location ~* "/\.(htaccess|htpasswd)$" {
37+
deny all;
38+
return 404;
39+
}
40+
41+
location /vstats/ {
42+
alias %home%/%user%/web/%domain%/stats/;
43+
include %home%/%user%/conf/web/%domain%.auth*;
44+
}
45+
46+
include /etc/nginx/conf.d/phpmyadmin.inc*;
47+
include /etc/nginx/conf.d/phppgadmin.inc*;
48+
include /etc/nginx/conf.d/webmail.inc*;
49+
50+
include %home%/%user%/conf/web/nginx.%domain%.conf*;
51+
}

install/debian/9/php-fpm/www.conf

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)