2019-07-17 17:11:52 +02:00
|
|
|
<VirtualHost *:80 *:443>
|
2015-08-25 16:54:13 +02:00
|
|
|
|
2015-09-04 10:20:33 +02:00
|
|
|
# FQDN principal
|
|
|
|
ServerName SERVERNAME
|
|
|
|
#ServerAlias SERVERNAME
|
2015-08-25 16:54:13 +02:00
|
|
|
|
|
|
|
# Repertoire principal
|
2015-09-04 10:20:33 +02:00
|
|
|
DocumentRoot HOME_DIR/XXX/www/
|
2015-08-25 16:54:13 +02:00
|
|
|
|
2019-07-15 17:44:41 +02:00
|
|
|
# SSL
|
2019-08-21 12:05:37 +02:00
|
|
|
# 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]
|
|
|
|
|
2015-08-25 16:54:13 +02:00
|
|
|
# Propriete du repertoire
|
2015-09-04 10:20:33 +02:00
|
|
|
<Directory HOME_DIR/XXX/www/>
|
|
|
|
#Options +Indexes +SymLinksIfOwnerMatch
|
|
|
|
Options +SymLinksIfOwnerMatch
|
|
|
|
AllowOverride AuthConfig Limit FileInfo
|
2015-12-15 15:40:36 +01:00
|
|
|
Require all granted
|
2015-09-04 10:20:33 +02:00
|
|
|
</Directory>
|
2015-08-25 16:54:13 +02:00
|
|
|
|
|
|
|
# CGI
|
|
|
|
ScriptAlias /cgi-RANDOM /usr/lib/cgi-bin/
|
|
|
|
<Directory /usr/lib/cgi-bin/>
|
2015-09-04 10:20:33 +02:00
|
|
|
Options +ExecCGI -MultiViews
|
2015-08-25 16:54:13 +02:00
|
|
|
AllowOverride None
|
|
|
|
|
|
|
|
AuthName "Restricted"
|
|
|
|
AuthUserFile HOME_DIR/XXX/.htpasswd
|
|
|
|
AuthType Basic
|
|
|
|
require valid-user
|
|
|
|
|
|
|
|
Order Deny,Allow
|
|
|
|
Deny from all
|
2015-08-31 15:17:10 +02:00
|
|
|
|
2015-09-04 10:20:33 +02:00
|
|
|
#Include /etc/apache2/ipaddr_whitelist.conf
|
2015-08-25 16:54:13 +02:00
|
|
|
|
|
|
|
Satisfy any
|
|
|
|
</Directory>
|
|
|
|
|
|
|
|
# user - group (thanks to sesse@debian.org)
|
|
|
|
AssignUserID www-XXX XXX
|
|
|
|
|
|
|
|
# LOG
|
2015-09-04 10:20:33 +02:00
|
|
|
CustomLog /var/log/apache2/access.log vhost_combined
|
2015-08-25 16:54:13 +02:00
|
|
|
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
|
2017-09-12 20:15:48 +02:00
|
|
|
#php_value default_charset ISO-8859-15
|
2015-08-25 16:54:13 +02:00
|
|
|
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"
|