# ************************************************************************
# * custom_httpd.inc Ben Makkink 25-09-2020 *
# * Eigen HTTPD directives toe te voegen aan flex80 en flex443 in het *
# * nieuwe HTTPD configuratiebestand 'custom_httpd.conf' *
# ************************************************************************
# Directives in te voegen binnen de vHosts 80 en 443
# ==================================================
# START eigen directives binnen vHosts
# ----------------------------------------------------------------
CustomLog /var/log/httpd/wandelen_access_log combined env=wandelen
CustomLog /var/log/httpd/nbp_access_log combined env=nbp
CustomLog /var/log/httpd/blog_access_log combined env=blog
# ----------------------------------------------------------------
Options +Indexes +FollowSymLinks -IncludesNOExec
Options +Indexes +FollowSymLinks +IncludesNOExec
# ----------------------------------------------------------------
# EINDE eigen directives binnen vHosts
# Eigen HTTPD Directives buiten de VirtualHosts
# ====================================================================
# Access_Logs: Zet 'env' voor paden 'wandelen', 'nbp' en 'blog' vanuit
# de webroot en geef deze env's een alias (wandelen, nbp en blog)
# --------------------------------------------------------------------
SetEnvIf Request_URI "^/wandelen/" wandelen
CustomLog logs/wandelen_access_log combined env=wandelen
SetEnvIf Request_URI "^/nbp/" nbp
CustomLog logs/nbp_access_log combined env=nbp
SetEnvIf Request_URI "^/blog/" blog
CustomLog logs/blog_access_log combined env=blog
# Het e-mail adres waar problemen met de server naar toe gemaild worden
ServerAdmin ben@makkink.eu
# DirectoryIndex: zet het bestand dat Apache opent als een directory
# wordt gevraagd (is in httpd.conf alleen index.html)
DirectoryIndex index.html index.htm
# Mapping naar bestanden buiten de webroot met een alias en opties
# Geef toegang voor alleen de hosts op het LAN
Alias /manuals "/usr/share/doc"
Options +Indexes
AllowOverride None
Require ip 192.168.178.0/24
# Require all granted
# Forceer domein www.makkink.eu naar HTTPS
# NIET OP TESTSERVER, certificaat is voor www.makkink.eu(homeserver)
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.makkink.eu/$1 [R,L]
# Voorbeeld voor een uitzondering van www/makkink.eu/blog
#
# RewriteEngine On
# RewriteCond %{SERVER_PORT} 443
# RewriteRule ^blog/?(.*) http://www.makkink.eu/blog/$1 [R,L]
# RewriteCond %{SERVER_PORT} 80
# RewriteCond %{REQUEST_URI} !^/blog
# RewriteRule ^(.*)$ https://www.makkink.eu/$1 [R,L]
#