diff --git a/rootfs/sysprepz/apache2-templates/php71fpm.sh b/rootfs/sysprepz/apache2-templates/php71fpm.sh
index 2e8441e..6939ea8 100755
--- a/rootfs/sysprepz/apache2-templates/php71fpm.sh
+++ b/rootfs/sysprepz/apache2-templates/php71fpm.sh
@@ -5,7 +5,7 @@ domain="$2"
ip="$3"
home_dir="$4"
docroot="$5"
-php_version="7.1"
+php_version="7.2"
fpm_conf="
[$domain]
@@ -24,9 +24,9 @@ pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
-php_admin_value[upload_tmp_dir] = /home/$user/tmp
-php_admin_value[session.save_path] = /home/$user/tmp
-php_admin_value[open_basedir] = $docroot:/home/$user/tmp
+php_admin_value[upload_tmp_dir] = /home/$user/web/$domain/tmp
+php_admin_value[session.save_path] = /home/$user/web/$domain/tmp
+php_admin_value[open_basedir] = $docroot:/home/$user/web/$domain/tmp
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
@@ -34,10 +34,10 @@ env[TMP] = /home/$user/tmp
env[TMPDIR] = /home/$user/tmp
env[TEMP] = /home/$user/tmp
"
-fpm_conf_file="$home_dir/$user/web/$domain/cgi-bin/php-fpm.conf"
+fpm_conf_file="/home/$user/web/$domain/cgi-bin/php-fpm.conf"
# remove old conf
-rm -f $home_dir/$user/web/$domain/cgi-bin/php*-fpm.conf
+rm -f /home/$user/web/$domain/cgi-bin/php*-fpm.conf
# restart any *running* php fpm found with ps -uaxw
# otherwise, simply use:
@@ -53,14 +53,16 @@ do
fi
done
+# make sure to delete old sock file before restart
rm -f /var/run/vesta-php-fpm-$domain.sock || true
echo "$fpm_conf" > $fpm_conf_file
chown $user:$user $fpm_conf_file
chmod -f 751 $fpm_conf_file
-rm -rf $home_dir/$user/web/$domain/tmp/cache
-mkdir -p $home_dir/$user/web/$domain/tmp/cache
-chown -R www-data:www-data $home_dir/$user/web/$domain/tmp/cache
+mkdir -p /home/$user/web/$domain/tmp/cache
+rm -rf /home/$user/web/$domain/tmp/cache
+mkdir -p /home/$user/web/$domain/tmp/cache
+chown -R www-data:www-data /home/$user/web/$domain/tmp/cache
# delete old and link new conf
rm -f /etc/php/*/fpm/pool.d/$domain.conf
diff --git a/rootfs/sysprepz/apache2-templates/php72fpm.sh b/rootfs/sysprepz/apache2-templates/php72fpm.sh
index 3e9e7ac..6939ea8 100755
--- a/rootfs/sysprepz/apache2-templates/php72fpm.sh
+++ b/rootfs/sysprepz/apache2-templates/php72fpm.sh
@@ -24,9 +24,9 @@ pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
-php_admin_value[upload_tmp_dir] = /home/$user/tmp
-php_admin_value[session.save_path] = /home/$user/tmp
-php_admin_value[open_basedir] = $docroot:/home/$user/tmp
+php_admin_value[upload_tmp_dir] = /home/$user/web/$domain/tmp
+php_admin_value[session.save_path] = /home/$user/web/$domain/tmp
+php_admin_value[open_basedir] = $docroot:/home/$user/web/$domain/tmp
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
@@ -34,10 +34,10 @@ env[TMP] = /home/$user/tmp
env[TMPDIR] = /home/$user/tmp
env[TEMP] = /home/$user/tmp
"
-fpm_conf_file="$home_dir/$user/web/$domain/cgi-bin/php-fpm.conf"
+fpm_conf_file="/home/$user/web/$domain/cgi-bin/php-fpm.conf"
# remove old conf
-rm -f $home_dir/$user/web/$domain/cgi-bin/php*-fpm.conf
+rm -f /home/$user/web/$domain/cgi-bin/php*-fpm.conf
# restart any *running* php fpm found with ps -uaxw
# otherwise, simply use:
@@ -53,14 +53,16 @@ do
fi
done
+# make sure to delete old sock file before restart
rm -f /var/run/vesta-php-fpm-$domain.sock || true
echo "$fpm_conf" > $fpm_conf_file
chown $user:$user $fpm_conf_file
chmod -f 751 $fpm_conf_file
-rm -rf $home_dir/$user/web/$domain/tmp/cache
-mkdir -p $home_dir/$user/web/$domain/tmp/cache
-chown -R www-data:www-data $home_dir/$user/web/$domain/tmp/cache
+mkdir -p /home/$user/web/$domain/tmp/cache
+rm -rf /home/$user/web/$domain/tmp/cache
+mkdir -p /home/$user/web/$domain/tmp/cache
+chown -R www-data:www-data /home/$user/web/$domain/tmp/cache
# delete old and link new conf
rm -f /etc/php/*/fpm/pool.d/$domain.conf
diff --git a/rootfs/sysprepz/apache2-templates/php73fpm.sh b/rootfs/sysprepz/apache2-templates/php73fpm.sh
index 25b2910..6939ea8 100755
--- a/rootfs/sysprepz/apache2-templates/php73fpm.sh
+++ b/rootfs/sysprepz/apache2-templates/php73fpm.sh
@@ -5,7 +5,7 @@ domain="$2"
ip="$3"
home_dir="$4"
docroot="$5"
-php_version="7.3"
+php_version="7.2"
fpm_conf="
[$domain]
@@ -24,9 +24,9 @@ pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
-php_admin_value[upload_tmp_dir] = /home/$user/tmp
-php_admin_value[session.save_path] = /home/$user/tmp
-php_admin_value[open_basedir] = $docroot:/home/$user/tmp
+php_admin_value[upload_tmp_dir] = /home/$user/web/$domain/tmp
+php_admin_value[session.save_path] = /home/$user/web/$domain/tmp
+php_admin_value[open_basedir] = $docroot:/home/$user/web/$domain/tmp
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
@@ -34,10 +34,10 @@ env[TMP] = /home/$user/tmp
env[TMPDIR] = /home/$user/tmp
env[TEMP] = /home/$user/tmp
"
-fpm_conf_file="$home_dir/$user/web/$domain/cgi-bin/php-fpm.conf"
+fpm_conf_file="/home/$user/web/$domain/cgi-bin/php-fpm.conf"
# remove old conf
-rm -f $home_dir/$user/web/$domain/cgi-bin/php*-fpm.conf
+rm -f /home/$user/web/$domain/cgi-bin/php*-fpm.conf
# restart any *running* php fpm found with ps -uaxw
# otherwise, simply use:
@@ -53,14 +53,16 @@ do
fi
done
+# make sure to delete old sock file before restart
rm -f /var/run/vesta-php-fpm-$domain.sock || true
echo "$fpm_conf" > $fpm_conf_file
chown $user:$user $fpm_conf_file
chmod -f 751 $fpm_conf_file
-rm -rf $home_dir/$user/web/$domain/tmp/cache
-mkdir -p $home_dir/$user/web/$domain/tmp/cache
-chown -R www-data:www-data $home_dir/$user/web/$domain/tmp/cache
+mkdir -p /home/$user/web/$domain/tmp/cache
+rm -rf /home/$user/web/$domain/tmp/cache
+mkdir -p /home/$user/web/$domain/tmp/cache
+chown -R www-data:www-data /home/$user/web/$domain/tmp/cache
# delete old and link new conf
rm -f /etc/php/*/fpm/pool.d/$domain.conf
diff --git a/rootfs/sysprepz/apache2-templates/phpfcgid71.sh b/rootfs/sysprepz/apache2-templates/phpfcgid71.sh
index 53c269f..8215a5f 100755
--- a/rootfs/sysprepz/apache2-templates/phpfcgid71.sh
+++ b/rootfs/sysprepz/apache2-templates/phpfcgid71.sh
@@ -13,7 +13,7 @@ export PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_CHILDREN=4
exec /usr/bin/php-cgi7.1
"
-wrapper_file="$home_dir/$user/web/$domain/cgi-bin/fcgi7.1"
+wrapper_file="/home/$user/web/$domain/cgi-bin/fcgi7.1"
echo "$wrapper_script" > $wrapper_file
chown $user:$user $wrapper_file
diff --git a/rootfs/sysprepz/apache2-templates/phpfcgid71.stpl b/rootfs/sysprepz/apache2-templates/phpfcgid71.stpl
index f766e95..5d9b0c0 100644
--- a/rootfs/sysprepz/apache2-templates/phpfcgid71.stpl
+++ b/rootfs/sysprepz/apache2-templates/phpfcgid71.stpl
@@ -16,9 +16,9 @@
SSLRequireSSL
AllowOverride All
Options +Includes -Indexes +ExecCGI
- php_admin_value open_basedir %docroot%:%home%/%user%/tmp
- php_admin_value upload_tmp_dir %home%/%user%/tmp
- php_admin_value session.save_path %home%/%user%/tmp
+ php_admin_value open_basedir %docroot%:%home%/%user%/web/%domain%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/web/%domain%/tmp
+ php_admin_value session.save_path %home%/%user%/web/%domain%/tmp
SetHandler fcgid-script
diff --git a/rootfs/sysprepz/apache2-templates/phpfcgid71.tpl b/rootfs/sysprepz/apache2-templates/phpfcgid71.tpl
index 3c3b042..11af573 100644
--- a/rootfs/sysprepz/apache2-templates/phpfcgid71.tpl
+++ b/rootfs/sysprepz/apache2-templates/phpfcgid71.tpl
@@ -15,9 +15,9 @@
AllowOverride All
Options +Includes -Indexes +ExecCGI
- php_admin_value open_basedir %docroot%:%home%/%user%/tmp
- php_admin_value upload_tmp_dir %home%/%user%/tmp
- php_admin_value session.save_path %home%/%user%/tmp
+ php_admin_value open_basedir %docroot%:%home%/%user%/web/%domain%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/web/%domain%/tmp
+ php_admin_value session.save_path %home%/%user%/web/%domain%/tmp
SetHandler fcgid-script
diff --git a/rootfs/sysprepz/apache2-templates/phpfcgid72.sh b/rootfs/sysprepz/apache2-templates/phpfcgid72.sh
index 3ec6c70..239b5db 100755
--- a/rootfs/sysprepz/apache2-templates/phpfcgid72.sh
+++ b/rootfs/sysprepz/apache2-templates/phpfcgid72.sh
@@ -13,7 +13,7 @@ export PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_CHILDREN=4
exec /usr/bin/php-cgi7.2
"
-wrapper_file="$home_dir/$user/web/$domain/cgi-bin/fcgi7.2"
+wrapper_file="/home/$user/web/$domain/cgi-bin/fcgi7.2"
echo "$wrapper_script" > $wrapper_file
chown $user:$user $wrapper_file
diff --git a/rootfs/sysprepz/apache2-templates/phpfcgid72.stpl b/rootfs/sysprepz/apache2-templates/phpfcgid72.stpl
index 06f0356..45b81ff 100644
--- a/rootfs/sysprepz/apache2-templates/phpfcgid72.stpl
+++ b/rootfs/sysprepz/apache2-templates/phpfcgid72.stpl
@@ -16,9 +16,9 @@
SSLRequireSSL
AllowOverride All
Options +Includes -Indexes +ExecCGI
- php_admin_value open_basedir %docroot%:%home%/%user%/tmp
- php_admin_value upload_tmp_dir %home%/%user%/tmp
- php_admin_value session.save_path %home%/%user%/tmp
+ php_admin_value open_basedir %docroot%:%home%/%user%/web/%domain%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/web/%domain%/tmp
+ php_admin_value session.save_path %home%/%user%/web/%domain%/tmp
SetHandler fcgid-script
diff --git a/rootfs/sysprepz/apache2-templates/phpfcgid72.tpl b/rootfs/sysprepz/apache2-templates/phpfcgid72.tpl
index 3410055..eaf4a4c 100644
--- a/rootfs/sysprepz/apache2-templates/phpfcgid72.tpl
+++ b/rootfs/sysprepz/apache2-templates/phpfcgid72.tpl
@@ -15,9 +15,9 @@
AllowOverride All
Options +Includes -Indexes +ExecCGI
- php_admin_value open_basedir %docroot%:%home%/%user%/tmp
- php_admin_value upload_tmp_dir %home%/%user%/tmp
- php_admin_value session.save_path %home%/%user%/tmp
+ php_admin_value open_basedir %docroot%:%home%/%user%/web/%domain%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/web/%domain%/tmp
+ php_admin_value session.save_path %home%/%user%/web/%domain%/tmp
SetHandler fcgid-script
diff --git a/rootfs/sysprepz/apache2-templates/phpfcgid73.sh b/rootfs/sysprepz/apache2-templates/phpfcgid73.sh
index cece45c..5817d7e 100755
--- a/rootfs/sysprepz/apache2-templates/phpfcgid73.sh
+++ b/rootfs/sysprepz/apache2-templates/phpfcgid73.sh
@@ -13,7 +13,7 @@ export PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_CHILDREN=4
exec /usr/bin/php-cgi7.3
"
-wrapper_file="$home_dir/$user/web/$domain/cgi-bin/fcgi7.3"
+wrapper_file="/home/$user/web/$domain/cgi-bin/fcgi7.3"
echo "$wrapper_script" > $wrapper_file
chown $user:$user $wrapper_file
diff --git a/rootfs/sysprepz/apache2-templates/phpfcgid73.stpl b/rootfs/sysprepz/apache2-templates/phpfcgid73.stpl
index 477b337..75d5c2d 100644
--- a/rootfs/sysprepz/apache2-templates/phpfcgid73.stpl
+++ b/rootfs/sysprepz/apache2-templates/phpfcgid73.stpl
@@ -16,9 +16,9 @@
SSLRequireSSL
AllowOverride All
Options +Includes -Indexes +ExecCGI
- php_admin_value open_basedir %docroot%:%home%/%user%/tmp
- php_admin_value upload_tmp_dir %home%/%user%/tmp
- php_admin_value session.save_path %home%/%user%/tmp
+ php_admin_value open_basedir %docroot%:%home%/%user%/web/%domain%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/web/%domain%/tmp
+ php_admin_value session.save_path %home%/%user%/web/%domain%/tmp
SetHandler fcgid-script
diff --git a/rootfs/sysprepz/apache2-templates/phpfcgid73.tpl b/rootfs/sysprepz/apache2-templates/phpfcgid73.tpl
index e43d9d0..051261c 100644
--- a/rootfs/sysprepz/apache2-templates/phpfcgid73.tpl
+++ b/rootfs/sysprepz/apache2-templates/phpfcgid73.tpl
@@ -15,9 +15,9 @@
AllowOverride All
Options +Includes -Indexes +ExecCGI
- php_admin_value open_basedir %docroot%:%home%/%user%/tmp
- php_admin_value upload_tmp_dir %home%/%user%/tmp
- php_admin_value session.save_path %home%/%user%/tmp
+ php_admin_value open_basedir %docroot%:%home%/%user%/web/%domain%/tmp
+ php_admin_value upload_tmp_dir %home%/%user%/web/%domain%/tmp
+ php_admin_value session.save_path %home%/%user%/web/%domain%/tmp
SetHandler fcgid-script