# FQDN principal
ServerName SERVERNAME
#ServerAlias SERVERNAME
# Repertoire principal
DocumentRoot HOME_DIR/XXX/www/
# SSL
# Apache < 2.4.30 (Jessie, Stretch) va générer une erreur si le fichier
# désigné sans regex n'existe pas. On contourne ça avec [f] à place de f
IncludeOptional /etc/apache2/ssl/XXX.con[f]
# Propriete du repertoire
#Options +Indexes +SymLinksIfOwnerMatch
Options +SymLinksIfOwnerMatch
AllowOverride AuthConfig Limit FileInfo
Require all granted
# CGI
ScriptAlias /cgi-RANDOM /usr/lib/cgi-bin/
Options +ExecCGI -MultiViews
AllowOverride None
AuthName "Restricted"
AuthUserFile HOME_DIR/XXX/.htpasswd
AuthType Basic
require valid-user
Order Deny,Allow
Deny from all
#Include /etc/apache2/ipaddr_whitelist.conf
Satisfy any
# user - group (thanks to sesse@debian.org)
AssignUserID www-XXX XXX
# LOG
CustomLog /var/log/apache2/access.log vhost_combined
CustomLog HOME_DIR/XXX/log/access.log combined
ErrorLog HOME_DIR/XXX/log/error.log
# AWSTATS
SetEnv AWSTATS_FORCE_CONFIG XXX
# REWRITE
UseCanonicalName On
RewriteEngine On
RewriteCond %{HTTP_HOST} !^SERVERNAME$
RewriteRule ^/(.*) http://%{SERVER_NAME}/$1 [L,R]
# PHP
#php_admin_flag engine off
#AddType text/html .html
#php_admin_flag display_errors On
#php_flag short_open_tag On
#php_flag register_globals On
#php_admin_value memory_limit 256M
#php_admin_value max_execution_time 60
#php_admin_value upload_max_filesize 8M
#php_admin_flag allow_url_fopen Off
#php_value default_charset ISO-8859-15
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f www-XXX"
php_admin_value open_basedir "/usr/share/php:HOME_DIR/XXX:/tmp"