File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 3939
4040echo -e " [openid]\nhttpsonly = 0" > /etc/openqa/openqa.ini.d/01-enable-http-auth.ini
4141
42+ etc_proxy=/etc/${web_proxy/ apache/ apache2}
43+ for v in vhosts.d sites-available; do
44+ if [[ -e " ${etc_proxy} /${v} /openqa.conf.template" ]]; then
45+ vhosts_dir=" ${etc_proxy} /${v} "
46+ break
47+ fi
48+ done
49+
50+ if [[ -z $vhosts_dir ]]; then
51+ printf " %s: ERROR: template file not found under '%s'\n" " $0 " " $etc_proxy "
52+ exit 1
53+ fi
54+
4255if [[ $web_proxy == " nginx" ]]; then
4356 echo " Setting up nginx"
44- sed " s/openqa.example.com/$( hostname) /" /etc/nginx/vhosts.d/ openqa.conf.template > /etc/nginx/vhosts.d/ openqa.conf
57+ sed " s/openqa.example.com/$( hostname) /" " ${vhosts_dir} / openqa.conf.template" > " ${vhosts_dir} / openqa.conf"
4558 # IPv6 uses [::]:80 syntax instead of just a port
4659 if [[ -n " $web_port " ]]; then
47- sed -Ei " s@(.*listen.*)80@\1${web_port} @g" /etc/nginx/vhosts.d/ openqa.conf /etc/ nginx/nginx .conf
60+ sed -Ei " s@(.*listen.*)80@\1${web_port} @g" " ${vhosts_dir} / openqa.conf" " ${etc_proxy} / nginx.conf"
4861 fi
4962 sed -i -e ' s/^\([^#]*server_name[[:space:]]\+localhost;\)/#\1/' /etc/nginx/nginx.conf
5063elif [[ $web_proxy == " apache" || $web_proxy == " apache2" ]]; then
5164 echo " Setting up apache"
5265 for i in headers proxy proxy_http proxy_wstunnel rewrite; do a2enmod $i ; done
53- sed " s/#ServerName.*$/ServerName $( hostname) /" /etc/apache2/vhosts.d/ openqa.conf.template > /etc/apache2/vhosts.d/ openqa.conf
66+ sed " s/#ServerName.*$/ServerName $( hostname) /" " ${vhosts_dir} / openqa.conf.template" > " ${vhosts_dir} / openqa.conf"
5467 if [[ -n " $web_port " ]]; then
55- sed -i " s/^Listen.*$/Listen $web_port /" /etc/apache2/ listen.conf
68+ sed -i " s/^Listen.*$/Listen $web_port /" " ${etc_proxy} / listen.conf"
5669 fi
5770else
5871 echo " No supported proxy: $web_proxy "
You can’t perform that action at this time.
0 commit comments