diff --git a/README.md b/README.md index e664e50..b7bd83d 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ VHOST-MANAGER ============= -VHOST-MANAGE helps you to create apache2 vhosts. +`vhost-manager` helps you to create apache2 vhosts. Requirements ------------ * PHP -* /bin/sh * GCC * whiptail * wget @@ -17,7 +16,7 @@ Installation ------------ ``` -$ sudo apt install gcc whiptail wget make +$ sudo apt install gcc build-essential whiptail wget make $ sudo apt install $ git clone https://gitnet.fr/deblan/vhost-manager.git $ cd vhost-manager @@ -40,19 +39,21 @@ USAGE: ./bin/vhost-add [options] OPTIONS: + -i Enable script interactivity + The script is interactive when no argument is given -d The domain name -a Aliase(s) - -m value Enable *http* or *https* + -m value Enable "http" or "https" -r Force redirection of http to https -p value Enable PHP with the given version (eg: 8.0) -u value Username in the system - -i Enable script interactivity -h Show this help ``` Example: ``` +$ sudo vhost-add $ sudo vhost-add -m http -m https -r -d example.com -a www.example.com -p 8.0 -u example -i ``` diff --git a/bin/vhost-add b/bin/vhost-add index 853c381..2335d7b 100755 --- a/bin/vhost-add +++ b/bin/vhost-add @@ -7,6 +7,24 @@ PATH="$SCRIPT_PATH/../share/bin/:$PATH" export SCRIPT_NAME export SCRIPT_PATH export PATH +export DOMAIN +export DOMAIN_ALIASES +export DOCUMENT_ROOT +export SYSTEM_USER_USERNAME +export SYSTEM_USER_GROUP +export PHP_ENABLED +export MOD_FCGI +export PHP_VERSION +export WEB_HTTP +export WEB_HTTPS +export WEB_HTTPS_FORCE +export WEB_ROOT_PATH +export WEB_LOG_PATH +export WEB_HTTPS_DEFAULT_CERT_PEM +export WEB_HTTPS_DEFAULT_CERT_PRIVKEY +export WEB_HTTPS_DEFAULT_CERT_CHAIN +export WEB_BIND_ADDRESS +export ERROR cd "$SCRIPT_PATH/../" @@ -33,13 +51,14 @@ USAGE: $0 [options] OPTIONS: + -i Enable script interactivity + The script is interactive when no option is given -d The domain name -a Aliase(s) - -m value Enable *http* or *https* + -m value Enable "http" or "https" -r Force redirection of http to https -p value Enable PHP with the given version (eg: 8.0) -u value Username in the system - -i Enable script interactivity -h Show this help EOF @@ -161,24 +180,6 @@ exit_if_empty "$MOD_FCGI" "Aborded! (MOD_FCGI_EMPTY)" # Confirmation # ################ -export DOMAIN -export DOMAIN_ALIASES -export DOCUMENT_ROOT -export SYSTEM_USER_USERNAME -export SYSTEM_USER_GROUP -export PHP_ENABLED -export MOD_FCGI -export PHP_VERSION -export WEB_HTTP -export WEB_HTTPS -export WEB_HTTPS_FORCE -export WEB_ROOT_PATH -export WEB_LOG_PATH -export WEB_HTTPS_DEFAULT_CERT_PEM -export WEB_HTTPS_DEFAULT_CERT_PRIVKEY -export WEB_HTTPS_DEFAULT_CERT_CHAIN -export WEB_BIND_ADDRESS - if [ $INTERACTIVE -eq 0 ]; then CONTINUE="yes" else