Commit e31e6bf3 authored by David Johnson's avatar David Johnson

Always remove nginx default site; it blocks apache.

parent af1b8ce5
......@@ -23,14 +23,14 @@ fi
if [ "$HOSTNAME" = "$CONTROLLER" ]; then
maybe_install_packages nginx
# Handle case where nginx won't start because the default site
# (which is enabled!) needs port 80, and apache might be listening
# there.
# Always remove default nginx site-enabled file, since apache must
# listen on port 80. But if apache2 ran prior to nginx, nginx
# install may have failed; if so, remove its default enabled site.
if [ ! $? -eq 0 ]; then
rm -f /etc/nginx/sites-available/default \
rm -f /etc/nginx/sites-enabled/default
maybe_install_packages nginx
rm -f /etc/nginx/sites-enabled/default
echo "$ADMIN_PASS" | htpasswd -n -i admin > /etc/nginx/htpasswd
chown www-data:root /etc/nginx/htpasswd
chmod 660 /etc/nginx/htpasswd
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment