Browse Source

add WEB_BIND_ADDRESS param

master
Simon Vieille 2 months ago
parent
commit
9c2df7acbb
Signed by: Simon Vieille <simon@deblan.fr> GPG Key ID: 03383D15A1D31745
3 changed files with 8 additions and 2 deletions
  1. 4
    1
      bin/vhost-add
  2. 3
    0
      etc/config.dist
  3. 1
    1
      src/templates/vhost-http.twig

+ 4
- 1
bin/vhost-add View File

@@ -97,6 +97,7 @@ 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

TMP_FILE="/tmp/vhost-add-$(tr -dc "qwertQWERTasdfgASDFGzxcvbZXCVB" < /dev/urandom | head -c 16)"
touch "$TMP_FILE"
@@ -136,7 +137,9 @@ if [ "$WEB_HTTP" = "yes" ]; then
VHOST_FILE_SA="$APACHE_VHOST_SITES_AVAILABLE_PATH/${DOMAIN}.${WEB_HTTP_PORT}.conf"
VHOST_FILE_SE="$APACHE_VHOST_SITES_ENABLED_PATH/${DOMAIN}.${WEB_HTTP_PORT}.conf"

PORT=$WEB_HTTP_PORT template vhost-http > "$VHOST_FILE_SA"
#PORT=$WEB_HTTP_PORT template vhost-http > "$VHOST_FILE_SA"
PORT=$WEB_HTTP_PORT template vhost-http
exit

ln -rs "$VHOST_FILE_SA" "$VHOST_FILE_SE"
fi

+ 3
- 0
etc/config.dist View File

@@ -3,6 +3,9 @@ WEB_HTTP_PORT=80
# HTTPS port
WEB_HTTPS_PORT=443

# Address to bind
WEB_BIND_ADDRESS="*"

# User group
SYSTEM_USER_GROUP=webgroup


+ 1
- 1
src/templates/vhost-http.twig View File

@@ -1,5 +1,5 @@
{% block body %}
<VirtualHost 127.0.0.1:{{ PORT }}>
<VirtualHost {{ WEB_BIND_ADDRESS }}:{{ PORT }}>
ServerName {{ DOMAIN }}
{% if DOMAIN_ALIASES is not empty %}
ServerAlias {{ DOMAIN_ALIASES }}

Loading…
Cancel
Save