Configure Apache HTTP Server as a Proxy on a Windows OS
Last modified by Eleni Cojocariu-testing account on 2026/08/18 11:38
Tutorial
Apache HTTP Server forwards requests to the XWiki Servlet Container on a Windows system, using the directives XWiki needs. Windows has no Apache package, so the server is unpacked from an archive and registered as a Windows service; everything else is configured in the single httpd.conf file.
- Make sure your wiki is running and reachable locally, for example at
http://localhost:8080/xwiki. - Download an Apache Lounge build of Apache HTTP Server, version 2.4.47 or later, which is what the upgrade=websocket option below needs.
- Extract the archive to C:\Apache24.
- Set
Define SRVROOT "C:/Apache24"in C:\Apache24\conf\httpd.conf to the directory you extracted to. - Uncomment the
#ServerName www.example.com:80line in the same file and change it toServerName localhost:80. - Uncomment the three modules the configuration below needs, in the same file:
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule headers_module modules/mod_headers.so - Add the following block at the end of the same file:
<VirtualHost *:80> ServerName localhost RedirectMatch ^/$ /xwiki/ <Location /xwiki> Require all granted </Location> AllowEncodedSlashes NoDecode RequestHeader unset Forwarded RequestHeader unset X-Forwarded-Host RequestHeader unset X-Forwarded-Proto ProxyRequests Off ProxyPreserveHost On ProxyPass /xwiki http://localhost:8080/xwiki nocanon upgrade=websocket ProxyPassReverse /xwiki http://localhost:8080/xwiki </VirtualHost> - Register Apache as a Windows service: open a Command Prompt as Administrator and run
cd C:\Apache24\binthenhttpd.exe -k install. - Start the service:
httpd.exe -k start. After any later change to httpd.conf, usehttpd.exe -k restartinstead. - Open
http://localhostin a browser. Apache redirects tohttp://localhost/xwiki/and the wiki loads through port 80, with no port number in the address.
FAQ
Why does the service refuse to start after I edit the configuration?
Run httpd.exe -t from C:\Apache24\bin: it names the file and line of the directive Apache cannot parse, which the Windows service reports nowhere.
Where does Apache write its logs on Windows?
In C:\Apache24\logs, as error.log and access.log, unless ErrorLog and CustomLog point somewhere else.