test-httpd.conf 2.55 KB
Newer Older
ale's avatar
ale committed
1 2 3 4 5 6
# for apache2.4:
<IfVersion >= 2.4>
LoadModule access_compat_module /usr/lib/apache2/modules/mod_access_compat.so
LoadModule authn_core_module /usr/lib/apache2/modules/mod_authn_core.so
LoadModule authz_core_module /usr/lib/apache2/modules/mod_authz_core.so
LoadModule mpm_worker_module /usr/lib/apache2/modules/mod_mpm_worker.so
ale's avatar
ale committed
7 8
Mutex pthread default
Mutex fcntl:${TESTROOT} mpm-accept
ale's avatar
ale committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
</IfVersion>

<IfVersion < 2.4>
LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so
LockFile ${TESTROOT}/.apache.lock
AcceptMutex flock
</IfVersion>

LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so
LoadModule setenvif_module /usr/lib/apache2/modules/mod_setenvif.so
LoadModule negotiation_module /usr/lib/apache2/modules/mod_negotiation.so
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

Listen ${PORT}
ServerName test
PidFile ${TESTROOT}/test-httpd.pid
ErrorLog ${TESTROOT}/test-httpd.log
LogLevel debug

DocumentRoot ${TESTROOT}/public
<Directory "${TESTROOT}/public">
	Order allow,deny
	Allow from all

	Options Indexes MultiViews FollowSymLinks
	DirectoryIndex index
	MultiviewsMatch Handlers Filters
	AllowOverride All
</Directory>

# Send charset along with content-type.
AddDefaultCharset utf-8

# mod_mime configuration.
TypesConfig /etc/mime.types
AddLanguage it .it
AddLanguage en .en
AddLanguage fr .fr
AddLanguage de .de
AddLanguage pt-BR .pt
AddLanguage pt .pt
AddLanguage ca .ca

# Make the 'site_language' cookie override the Accept-Language header.
SetEnvIf Cookie "site_language=(.+)" prefer-language=$1
Header append Vary cookie

# mod_negotiation configuration.
LanguagePriority en it fr de es pt ca
ForceLanguagePriority Prefer Fallback

# Search page passthru.
ProxyPass /search http://127.0.0.1:3301
ProxyPassReverse /search http://127.0.0.1:3301

ale's avatar
ale committed
68 69 70 71
# Rewrite rules to migrate old URLs.
RewriteEngine On

# Remove the old language prefix from the URLs.
72
RewriteRule ^/(it|en|cat|de|es|pt|fr)/([^.]*)\.html$ /$2 [R=301,L]
ale's avatar
ale committed
73 74 75 76 77 78 79 80 81 82 83

# Remove the man_ prefix from the old howto URLs.
RewriteRule ^/stuff/man_(.*)$ /docs/$1 [R=301,L]

# Rewrite URLs that only have a .html extension (no language),
# because we don't like them and they're ugly.
RewriteRule ^/([^.]*)\.html$ /$1 [R=301,L]

# Additional rule to handle ?hl=LANG
RewriteCond %{QUERY_STRING} \bhl=([a-z]*)
RewriteRule - [E=prefer-language:%1]