Browse Source

add configurable php versions

master
Simon Vieille 3 months ago
parent
commit
87a571034c
Signed by: Simon Vieille <simon@deblan.fr> GPG Key ID: 03383D15A1D31745
2 changed files with 26 additions and 9 deletions
  1. 11
    5
      bin/vhost-add
  2. 15
    4
      etc/config.dist

+ 11
- 5
bin/vhost-add View File

@@ -49,11 +49,17 @@ DOCUMENT_ROOT="$WEB_ROOT_PATH/$DOMAIN/$DOCUMENT_ROOT"
PHP_ENABLED="$(form_yes_no -t "$TITLE" -l "Support of PHP")"

if [ "$PHP_ENABLED" = "yes" ]; then
PHP_VERSION="$(form_choices -t "$TITLE" -l "Version of PHP" \
"7.3" "PHP 7.3 (recommended)" \
"7.2" "PHP 7.2" \
"7.1" "PHP 7.1" \
"5.6" "PHP 5.6 (not recommended)")"
COMMAND="form_choices -t \"$TITLE\" -l \"Version of PHP\""

for PHP_VERSION in $PHP_VERSIONS; do
PHP_VERSION_NORMALISED="$(echo "$PHP_VERSION" | tr -dc 1234567890)"

eval "PHP_LABEL=\$PHP_${PHP_VERSION_NORMALISED}_LABEL"

COMMAND="$COMMAND \"$PHP_VERSION\" \"$PHP_LABEL\""
done

PHP_VERSION="$(eval "$COMMAND")"

exit_if_empty "$PHP_VERSION" "Aborded! (PHP_VERSION_EMPTY)"
fi

+ 15
- 4
etc/config.dist View File

@@ -1,11 +1,21 @@
WEB_HTTP_PORT=81
WEB_HTTPS_PORT=444
WEB_HTTPS_DEFAULT_CERT_PEM=/etc/letsencrypt/live/example.com/cert.pem
WEB_HTTPS_DEFAULT_CERT_PRIVKEY=/etc/letsencrypt/live/example.com/privkey.pem
WEB_HTTPS_DEFAULT_CERT_CHAIN=/etc/letsencrypt/live/example.com/chain.pem

SKEL_PATH=/etc/skel

DEFAULT_SHELL=/bin/zsh

WEB_ROOT_PATH=/var/www/service-web/www
WEB_LOG_PATH=/services/web/logs

APACHE_VHOST_SITES_AVAILABLE_PATH=/etc/apache2/sites-available
APACHE_VHOST_SITES_ENABLED_PATH=/etc/apache2/sites-enabled

PHP_BIN=/usr/bin/php7.3
PHP_VERSIONS="7.3 7.2 7.1 5.6"
PHP_FPM56_POOL_PATH=/etc/php5/fpm/pool.d
PHP_FPM71_POOL_PATH=/etc/php/7.1/fpm/pool.d
PHP_FPM72_POOL_PATH=/etc/php/7.2/fpm/pool.d
@@ -14,8 +24,9 @@ PHP_FPM56_SERVICE=php5-fpm
PHP_FPM71_SERVICE=php7.1-fpm
PHP_FPM72_SERVICE=php7.2-fpm
PHP_FPM73_SERVICE=php7.3-fpm
PHP_BIN=/usr/bin/php7.3
WEB_HTTPS_DEFAULT_CERT_PEM=/etc/letsencrypt/live/example.com/cert.pem
WEB_HTTPS_DEFAULT_CERT_PRIVKEY=/etc/letsencrypt/live/example.com/privkey.pem
WEB_HTTPS_DEFAULT_CERT_CHAIN=/etc/letsencrypt/live/example.com/chain.pem
PHP_56_LABEL="PHP 5.6 (not recommended)"
PHP_71_LABEL="PHP 7.1"
PHP_72_LABEL="PHP 7.2"
PHP_73_LABEL="PHP 7.3 (recommended)"

SYSTEM_USER_GROUP=webgroup

Loading…
Cancel
Save