From 07c3b00510e5f73dafbb25a3315931b97a407432 Mon Sep 17 00:00:00 2001 From: ahriman Date: Wed, 24 Apr 2019 23:44:37 +0000 Subject: sorting and deduplicating httpd-vusers.conf --- bin/makeuser | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/makeuser b/bin/makeuser index 0081bbf..d8a3ac3 100755 --- a/bin/makeuser +++ b/bin/makeuser @@ -68,10 +68,17 @@ case $1 in } }" > /etc/httpd/$1.conf -# add the user's vhost config to -# the main httpd config then gracefully -# reload the httpd config +# add the user's vhost config to the bridged vhost config, which +# is loaded by /etc/httpd.conf. This is necessary because httpd(8) +# does not support globbing on includes echo "include \"/etc/httpd/$1.conf\"" >> /etc/httpd-vusers.conf + +# Sort and deduplicate entries in the bridged vhost config file +# Duplicate entries cause weird behavior. Subdomains after the +# duplicated entry won't resolve properly and instead resolve +# to the main site + sort -u /etc/httpd-vusers.conf > /etc/httpd-vusers.conf.sorted + cp /etc/httpd-vusers.conf.sorted /etc/httpd-vusers.conf pkill -HUP httpd # send welcome email -- cgit 1.4.1-2-gfad0