iankelling.org
/
git
/
basic-https-conf
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more flexible on document root settings
[basic-https-conf]
/
web-conf
diff --git
a/web-conf
b/web-conf
index 38dce524cf0153ff47c5592b6d5246802a86b69b..0e06cdf8bab5bc55a09330614dc843cc6a38decc 100755
(executable)
--- a/
web-conf
+++ b/
web-conf
@@
-51,7
+51,8
@@
EXTRA_SETTINGS_FILE can be - for stdin
-i Insecure, no ssl.
-p PORT Main port to listen on, default 443. 80 implies -i.
-r DIR DocumentRoot
-i Insecure, no ssl.
-p PORT Main port to listen on, default 443. 80 implies -i.
-r DIR DocumentRoot
--s Allow symlinks from the doucmentroot
+-s Allow symlinks from the doucment root
+-t No settings on documentroot.
-h|--help Print help and exit
Note: Uses GNU getopt options parsing style
-h|--help Print help and exit
Note: Uses GNU getopt options parsing style
@@
-65,7
+66,8
@@
symlinkarg=-
ssl=true
extra_settings=
port=443
ssl=true
extra_settings=
port=443
-temp=$(getopt -l help a:c:e:if:p:r:sh "$@") || usage 1
+do_root_settings=true
+temp=$(getopt -l help a:c:e:if:p:r:sth "$@") || usage 1
vhostip='*'
eval set -- "$temp"
while true; do
vhostip='*'
eval set -- "$temp"
while true; do
@@
-80,6
+82,7
@@
while true; do
-i) ssl=false; shift ;;
-p) port="$2"; shift 2 ;;
-r) root="$2"; shift 2 ;;
-i) ssl=false; shift ;;
-p) port="$2"; shift 2 ;;
-r) root="$2"; shift 2 ;;
+ -t) do_root_settings=false; shift ;;
-s) symlinkarg=+; shift ;;
--) shift; break ;;
-h|--help) usage ;;
-s) symlinkarg=+; shift ;;
--) shift; break ;;
-h|--help) usage ;;
@@
-202,10
+205,14
@@
if [[ $t == apache2 ]]; then
ServerName $h
ServerAlias www.$h
DocumentRoot $root
ServerName $h
ServerAlias www.$h
DocumentRoot $root
+EOF
+ if $do_root_settings; then
+ cat >>$vhost_file <<EOF
<Directory $root>
Options -Indexes ${symlinkarg}FollowSymlinks
</Directory>
EOF
<Directory $root>
Options -Indexes ${symlinkarg}FollowSymlinks
</Directory>
EOF
+ fi
if [[ $extra_settings ]]; then
cat -- $extra_settings >>$vhost_file
if [[ $extra_settings ]]; then
cat -- $extra_settings >>$vhost_file
@@
-403,11
+410,13
@@
EOF
listen [::]:$port $ssl_arg;
EOF
fi
listen [::]:$port $ssl_arg;
EOF
fi
- cat >>$vhost_file <<EOF
+ if $do_root_settings; then
+ cat >>$vhost_file <<EOF
location $root {
autoindex off;
}
EOF
location $root {
autoindex off;
}
EOF
+ fi
if $ssl; then
cat >>$vhost_file <<EOF
ssl_certificate $cert_dir/fullchain.pem;
if $ssl; then
cat >>$vhost_file <<EOF
ssl_certificate $cert_dir/fullchain.pem;