Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
fix openbase dir
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed May 17, 2019
1 parent 94a2ea6 commit 9c92fc8
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 47 deletions.
20 changes: 11 additions & 9 deletions rootfs/sysprepz/apache2-templates/php71fpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ domain="$2"
ip="$3"
home_dir="$4"
docroot="$5"
php_version="7.1"
php_version="7.2"

fpm_conf="
[$domain]
Expand All @@ -24,20 +24,20 @@ 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
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:
Expand All @@ -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
Expand Down
18 changes: 10 additions & 8 deletions rootfs/sysprepz/apache2-templates/php72fpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ 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
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:
Expand All @@ -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
Expand Down
20 changes: 11 additions & 9 deletions rootfs/sysprepz/apache2-templates/php73fpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ domain="$2"
ip="$3"
home_dir="$4"
docroot="$5"
php_version="7.3"
php_version="7.2"

fpm_conf="
[$domain]
Expand All @@ -24,20 +24,20 @@ 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
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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rootfs/sysprepz/apache2-templates/phpfcgid71.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions rootfs/sysprepz/apache2-templates/phpfcgid71.stpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
<Files *.php>
SetHandler fcgid-script
</Files>
Expand Down
6 changes: 3 additions & 3 deletions rootfs/sysprepz/apache2-templates/phpfcgid71.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<Directory %docroot%>
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
<Files *.php>
SetHandler fcgid-script
</Files>
Expand Down
2 changes: 1 addition & 1 deletion rootfs/sysprepz/apache2-templates/phpfcgid72.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions rootfs/sysprepz/apache2-templates/phpfcgid72.stpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
<Files *.php>
SetHandler fcgid-script
</Files>
Expand Down
6 changes: 3 additions & 3 deletions rootfs/sysprepz/apache2-templates/phpfcgid72.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<Directory %docroot%>
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
<Files *.php>
SetHandler fcgid-script
</Files>
Expand Down
2 changes: 1 addition & 1 deletion rootfs/sysprepz/apache2-templates/phpfcgid73.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions rootfs/sysprepz/apache2-templates/phpfcgid73.stpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
<Files *.php>
SetHandler fcgid-script
</Files>
Expand Down
6 changes: 3 additions & 3 deletions rootfs/sysprepz/apache2-templates/phpfcgid73.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<Directory %docroot%>
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
<Files *.php>
SetHandler fcgid-script
</Files>
Expand Down

0 comments on commit 9c92fc8

Please sign in to comment.