Browse Source

fix: [apache] remove default website.

framadate
Valentin Lab 6 years ago
parent
commit
09dd757c64
  1. 35
      apache/hooks/init

35
apache/hooks/init

@ -12,45 +12,10 @@
. lib/common
APACHE_LOG_DIR=/var/log/apache2
set -e
cat <<EOF | file_put "$SERVICE_DATASTORE/var/www/html/.htaccess"
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
EOF
rm -fv "$SERVICE_CONFIGSTORE/etc/apache2/sites-enabled/"*".conf"
cat <<EOF | file_put "$SERVICE_CONFIGSTORE/etc/apache2/sites-enabled/000-default.conf"
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
EOF
ssh_tunnel_cfg=$(options-get ssh-tunnel 2>/dev/null) || true
if [ "$ssh_tunnel_cfg" ]; then
apache_ssh_tunnel "$ssh_tunnel_cfg"

Loading…
Cancel
Save