Skip to content

Commit ef675e1

Browse files
committed
Add MultiPHP switch to installation file, create conf files.
1 parent 9cbaadd commit ef675e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+6572
-3
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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/php5.6-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_56="/etc/php/5.6/fpm/pool.d/$2.conf"
43+
pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
44+
pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
45+
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
46+
47+
if [ ! -f "$pool_file_56" ]; then
48+
echo "$pool_conf" > $pool_file_56
49+
service php5.6-fpm restart
50+
fi
51+
52+
if [ -f "$pool_file_70" ]; then
53+
rm $pool_file_70
54+
service php7.0-fpm restart
55+
fi
56+
57+
if [ -f "$pool_file_71" ]; then
58+
rm $pool_file_71
59+
service php7.1-fpm restart
60+
fi
61+
62+
if [ -f "$pool_file_72" ]; then
63+
rm $pool_file_72
64+
service php7.2-fpm restart
65+
fi
66+
67+
exit 0
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<VirtualHost %ip%:%web_ssl_port%>
2+
3+
ServerName %domain_idn%
4+
%alias_string%
5+
ServerAdmin %email%
6+
DocumentRoot %sdocroot%
7+
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
8+
Alias /vstats/ %home%/%user%/web/%domain%/stats/
9+
Alias /error/ %home%/%user%/web/%domain%/document_errors/
10+
#SuexecUserGroup %user% %group%
11+
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
12+
CustomLog /var/log/%web_system%/domains/%domain%.log combined
13+
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
14+
<Directory %home%/%user%/web/%domain%/stats>
15+
AllowOverride All
16+
</Directory>
17+
<Directory %sdocroot%>
18+
AllowOverride All
19+
SSLRequireSSL
20+
Options +Includes -Indexes +ExecCGI
21+
</Directory>
22+
SSLEngine on
23+
SSLVerifyClient none
24+
SSLCertificateFile %ssl_crt%
25+
SSLCertificateKeyFile %ssl_key%
26+
%ssl_ca_str%SSLCertificateChainFile %ssl_ca%
27+
# <IfModule mod_ruid2.c>
28+
# RMode config
29+
# RUidGid %user% %group%
30+
# RGroups www-data
31+
# </IfModule>
32+
# <IfModule itk.c>
33+
# AssignUserID %user% %group%
34+
# </IfModule>
35+
36+
<FilesMatch \.php$>
37+
SetHandler "proxy:unix:/run/php/php5.6-fpm-%domain%.sock|fcgi://localhost/"
38+
</FilesMatch>
39+
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
40+
41+
IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
42+
43+
</VirtualHost>
44+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<VirtualHost %ip%:%web_port%>
2+
3+
ServerName %domain_idn%
4+
%alias_string%
5+
ServerAdmin %email%
6+
DocumentRoot %docroot%
7+
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
8+
Alias /vstats/ %home%/%user%/web/%domain%/stats/
9+
Alias /error/ %home%/%user%/web/%domain%/document_errors/
10+
#SuexecUserGroup %user% %group%
11+
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
12+
CustomLog /var/log/%web_system%/domains/%domain%.log combined
13+
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
14+
<Directory %home%/%user%/web/%domain%/stats>
15+
AllowOverride All
16+
</Directory>
17+
<Directory %sdocroot%>
18+
AllowOverride All
19+
Options +Includes -Indexes +ExecCGI
20+
</Directory>
21+
# <IfModule mod_ruid2.c>
22+
# RMode config
23+
# RUidGid %user% %group%
24+
# RGroups www-data
25+
# </IfModule>
26+
# <IfModule itk.c>
27+
# AssignUserID %user% %group%
28+
# </IfModule>
29+
30+
<FilesMatch \.php$>
31+
SetHandler "proxy:unix:/run/php/php5.6-fpm-%domain%.sock|fcgi://localhost/"
32+
</FilesMatch>
33+
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
34+
35+
IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
36+
37+
</VirtualHost>
38+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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.0-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_56="/etc/php/5.6/fpm/pool.d/$2.conf"
43+
pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
44+
pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
45+
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
46+
47+
if [ -f "$pool_file_56" ]; then
48+
rm $pool_file_56
49+
service php5.6-fpm restart
50+
fi
51+
52+
if [ ! -f "$pool_file_70" ]; then
53+
echo "$pool_conf" > $pool_file_70
54+
service php7.0-fpm restart
55+
fi
56+
57+
if [ -f "$pool_file_71" ]; then
58+
rm $pool_file_71
59+
service php7.1-fpm restart
60+
fi
61+
62+
if [ -f "$pool_file_72" ]; then
63+
rm $pool_file_72
64+
service php7.2-fpm restart
65+
fi
66+
67+
exit 0
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<VirtualHost %ip%:%web_ssl_port%>
2+
3+
ServerName %domain_idn%
4+
%alias_string%
5+
ServerAdmin %email%
6+
DocumentRoot %sdocroot%
7+
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
8+
Alias /vstats/ %home%/%user%/web/%domain%/stats/
9+
Alias /error/ %home%/%user%/web/%domain%/document_errors/
10+
#SuexecUserGroup %user% %group%
11+
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
12+
CustomLog /var/log/%web_system%/domains/%domain%.log combined
13+
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
14+
<Directory %home%/%user%/web/%domain%/stats>
15+
AllowOverride All
16+
</Directory>
17+
<Directory %sdocroot%>
18+
AllowOverride All
19+
SSLRequireSSL
20+
Options +Includes -Indexes +ExecCGI
21+
</Directory>
22+
SSLEngine on
23+
SSLVerifyClient none
24+
SSLCertificateFile %ssl_crt%
25+
SSLCertificateKeyFile %ssl_key%
26+
%ssl_ca_str%SSLCertificateChainFile %ssl_ca%
27+
# <IfModule mod_ruid2.c>
28+
# RMode config
29+
# RUidGid %user% %group%
30+
# RGroups www-data
31+
# </IfModule>
32+
# <IfModule itk.c>
33+
# AssignUserID %user% %group%
34+
# </IfModule>
35+
36+
<FilesMatch \.php$>
37+
SetHandler "proxy:unix:/run/php/php7.0-fpm-%domain%.sock|fcgi://localhost/"
38+
</FilesMatch>
39+
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
40+
41+
IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
42+
43+
</VirtualHost>
44+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<VirtualHost %ip%:%web_port%>
2+
3+
ServerName %domain_idn%
4+
%alias_string%
5+
ServerAdmin %email%
6+
DocumentRoot %docroot%
7+
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
8+
Alias /vstats/ %home%/%user%/web/%domain%/stats/
9+
Alias /error/ %home%/%user%/web/%domain%/document_errors/
10+
#SuexecUserGroup %user% %group%
11+
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
12+
CustomLog /var/log/%web_system%/domains/%domain%.log combined
13+
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
14+
<Directory %home%/%user%/web/%domain%/stats>
15+
AllowOverride All
16+
</Directory>
17+
<Directory %sdocroot%>
18+
AllowOverride All
19+
Options +Includes -Indexes +ExecCGI
20+
</Directory>
21+
# <IfModule mod_ruid2.c>
22+
# RMode config
23+
# RUidGid %user% %group%
24+
# RGroups www-data
25+
# </IfModule>
26+
# <IfModule itk.c>
27+
# AssignUserID %user% %group%
28+
# </IfModule>
29+
30+
<FilesMatch \.php$>
31+
SetHandler "proxy:unix:/run/php/php7.0-fpm-%domain%.sock|fcgi://localhost/"
32+
</FilesMatch>
33+
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
34+
35+
IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
36+
37+
</VirtualHost>
38+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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.1-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_56="/etc/php/5.6/fpm/pool.d/$2.conf"
43+
pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
44+
pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
45+
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
46+
47+
if [ -f "$pool_file_56" ]; then
48+
rm $pool_file_56
49+
service php5.6-fpm restart
50+
fi
51+
52+
if [ -f "$pool_file_70" ]; then
53+
rm $pool_file_70
54+
service php7.0-fpm restart
55+
fi
56+
57+
if [ ! -f "$pool_file_71" ]; then
58+
echo "$pool_conf" > $pool_file_71
59+
service php7.1-fpm restart
60+
fi
61+
62+
if [ -f "$pool_file_72" ]; then
63+
rm $pool_file_72
64+
service php7.2-fpm restart
65+
fi
66+
67+
exit 0

0 commit comments

Comments
 (0)