refactoring and documentation
This commit is contained in:
parent
c2997a5d3c
commit
f14503e854
11
README.md
11
README.md
|
@ -1,13 +1,12 @@
|
||||||
VHOST-MANAGER
|
VHOST-MANAGER
|
||||||
=============
|
=============
|
||||||
|
|
||||||
VHOST-MANAGE helps you to create apache2 vhosts.
|
`vhost-manager` helps you to create apache2 vhosts.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* PHP
|
* PHP
|
||||||
* /bin/sh
|
|
||||||
* GCC
|
* GCC
|
||||||
* whiptail
|
* whiptail
|
||||||
* wget
|
* 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 <php stuff>
|
$ sudo apt install <php stuff>
|
||||||
$ git clone https://gitnet.fr/deblan/vhost-manager.git
|
$ git clone https://gitnet.fr/deblan/vhost-manager.git
|
||||||
$ cd vhost-manager
|
$ cd vhost-manager
|
||||||
|
@ -40,19 +39,21 @@ USAGE:
|
||||||
./bin/vhost-add [options]
|
./bin/vhost-add [options]
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
|
-i Enable script interactivity
|
||||||
|
The script is interactive when no argument is given
|
||||||
-d The domain name
|
-d The domain name
|
||||||
-a Aliase(s)
|
-a Aliase(s)
|
||||||
-m value Enable *http* or *https*
|
-m value Enable "http" or "https"
|
||||||
-r Force redirection of http to https
|
-r Force redirection of http to https
|
||||||
-p value Enable PHP with the given version (eg: 8.0)
|
-p value Enable PHP with the given version (eg: 8.0)
|
||||||
-u value Username in the system
|
-u value Username in the system
|
||||||
-i Enable script interactivity
|
|
||||||
-h Show this help
|
-h Show this help
|
||||||
```
|
```
|
||||||
|
|
||||||
Example:
|
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
|
$ sudo vhost-add -m http -m https -r -d example.com -a www.example.com -p 8.0 -u example -i
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,24 @@ PATH="$SCRIPT_PATH/../share/bin/:$PATH"
|
||||||
export SCRIPT_NAME
|
export SCRIPT_NAME
|
||||||
export SCRIPT_PATH
|
export SCRIPT_PATH
|
||||||
export 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/../"
|
cd "$SCRIPT_PATH/../"
|
||||||
|
|
||||||
|
@ -33,13 +51,14 @@ USAGE:
|
||||||
$0 [options]
|
$0 [options]
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
|
-i Enable script interactivity
|
||||||
|
The script is interactive when no option is given
|
||||||
-d The domain name
|
-d The domain name
|
||||||
-a Aliase(s)
|
-a Aliase(s)
|
||||||
-m value Enable *http* or *https*
|
-m value Enable "http" or "https"
|
||||||
-r Force redirection of http to https
|
-r Force redirection of http to https
|
||||||
-p value Enable PHP with the given version (eg: 8.0)
|
-p value Enable PHP with the given version (eg: 8.0)
|
||||||
-u value Username in the system
|
-u value Username in the system
|
||||||
-i Enable script interactivity
|
|
||||||
-h Show this help
|
-h Show this help
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
@ -161,24 +180,6 @@ exit_if_empty "$MOD_FCGI" "Aborded! (MOD_FCGI_EMPTY)"
|
||||||
# Confirmation #
|
# 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
|
if [ $INTERACTIVE -eq 0 ]; then
|
||||||
CONTINUE="yes"
|
CONTINUE="yes"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue