Wiki source code of Setting up Apache HTTPD

Version 2.1 by Thomas Mortagne on 2022/06/01

Show last authors
1 Example inpired from https://www.myxwiki.org (with only the important parts):
2
3 {{code}}
4 <VirtualHost *:80>
5 ServerName mydomain.com
6 ServerAlias *.mydomain.com
7
8 RewriteEngine On
9 RewriteCond %{HTTPS} !=on
10 RewriteCond %{REQUEST_URI} !^/.well-known
11 RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
12 </VirtualHost>
13
14 <VirtualHost *:443>
15 ServerName mydomain.com
16 ServerAlias *.mydomain.com
17
18 DocumentRoot /var/www/
19
20 ErrorLog /var/log/apache2/xwiki-error.log
21 CustomLog /var/log/apache2/xwiki-access.log combined
22
23 RedirectMatch ^/$ /xwiki/
24
25 <Location /xwiki>
26 Order Deny,Allow
27 Satisfy Any
28 </Location>
29
30 AllowEncodedSlashes NoDecode
31
32 ProxyRequests Off
33 <Proxy *>
34 Order deny,allow
35 Allow from all
36 </Proxy>
37 ProxyPreserveHost On
38 ProxyPass /xwiki http://localhost:8080/xwiki nocanon
39 ProxyPassReverse /xwiki http://localhost:8080/xwiki
40
41 ## Workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=58001 (ProxyPreserveHost does not includes Forwarded)
42 RequestHeader set Forwarded "proto=https"
43
44 # TODO: add your SSL setup
45 </VirtualHost>
46 {{/code}}

Get Connected