Wiki source code of Configure Apache HTTP Server as a Proxy on a Windows OS
Last modified by Eleni Cojocariu on 2026/05/20 16:51
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{warning}} | ||
| 2 | WIP-not sure how much a Windows version of the tutorial is needed | ||
| 3 | {{/warning}} | ||
| 4 | |||
| 5 | To set the Apache HTTP Server Proxy: | ||
| 6 | |||
| 7 | 1. Make sure your wiki is running and accessible locally (e.g., at {{code language="none"}}http://localhost:8080/{{/code}}. | ||
| 8 | 1. Install [[Apache Lounge>>https://www.apachelounge.com/download/]] (Apache HTTP Server for Windows):((( | ||
| 9 | 1. Download Apache (e.g., ##httpd-2.4.x-win64-VS17.zip##). | ||
| 10 | 1. Extract the archive to a directory, for example: ##C:\Apache24##. | ||
| 11 | 1. Install Apache as a Windows service:((( | ||
| 12 | * Open Command Prompt as Administrator and run: | ||
| 13 | |||
| 14 | {{code language="none"}} | ||
| 15 | cd C:\Apache24\bin | ||
| 16 | httpd.exe -k install | ||
| 17 | {{/code}} | ||
| 18 | ))) | ||
| 19 | ))) | ||
| 20 | 1. Fix the Apache configuration path (if needed):((( | ||
| 21 | * Edit the file ##C:\Apache24\conf\httpd.conf## and ensure the following line matches your installation directory:((( | ||
| 22 | {{code language="none"}} | ||
| 23 | Define SRVROOT "C:/Apache24" | ||
| 24 | {{/code}} | ||
| 25 | )))If you installed Apache in a different folder (e.g., ##C:\Apache\Apache24##), update the path accordingly. | ||
| 26 | ))) | ||
| 27 | 1. Set the server name (to avoid warnings):((( | ||
| 28 | * In ##httpd.conf##, uncomment and update:((( | ||
| 29 | {{code language="none"}} | ||
| 30 | ServerName localhost:80 | ||
| 31 | {{/code}} | ||
| 32 | ))) | ||
| 33 | ))) | ||
| 34 | 1. Enable required [[Apache modules>>https://httpd.apache.org/docs/current/fr/mod/]] for proxy:((( | ||
| 35 | In ##httpd.conf##, uncomment the following lines (remove the #) to enable the [[##proxy_module##>>https://httpd.apache.org/docs/current/fr/mod/mod_proxy.html#access]], [[##proxy_http_module##>>https://httpd.apache.org/docs/current/fr/mod/mod_proxy_http.html]], [[##headers_module##>>https://httpd.apache.org/docs/current/fr/mod/mod_headers.html]], [[##rewrite_module##>>https://httpd.apache.org/docs/current/fr/mod/mod_rewrite.html]]: | ||
| 36 | |||
| 37 | {{code language="apacheconf"}} | ||
| 38 | LoadModule proxy_module modules/mod_proxy.so | ||
| 39 | LoadModule proxy_http_module modules/mod_proxy_http.so | ||
| 40 | LoadModule headers_module modules/mod_headers.so | ||
| 41 | LoadModule rewrite_module modules/mod_rewrite.so | ||
| 42 | LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so | ||
| 43 | {{/code}} | ||
| 44 | ))) | ||
| 45 | 1. Restart Apache: {{code language="none"}}httpd.exe -k restart{{/code}}. | ||
| 46 | 1. Configure the Reverse Proxy: edit ##C:\Apache24\conf\httpd.conf## and add:((( | ||
| 47 | {{code language="apacheconf"}} | ||
| 48 | <VirtualHost *:80> | ||
| 49 | ServerName localhost | ||
| 50 | |||
| 51 | ProxyRequests Off | ||
| 52 | ProxyPreserveHost On | ||
| 53 | |||
| 54 | AllowEncodedSlashes NoDecode | ||
| 55 | |||
| 56 | <Proxy *> | ||
| 57 | Require all granted | ||
| 58 | </Proxy> | ||
| 59 | |||
| 60 | RedirectMatch ^/$ /xwiki/ | ||
| 61 | |||
| 62 | ProxyPass /xwiki http://localhost:8080/xwiki nocanon upgrade=websocket | ||
| 63 | ProxyPassReverse /xwiki http://localhost:8080/xwiki nocanon | ||
| 64 | |||
| 65 | </VirtualHost> | ||
| 66 | {{/code}} | ||
| 67 | ))) | ||
| 68 | 1. Restart Apache. | ||
| 69 | 1. Test the setup:((( | ||
| 70 | * Open your browser: {{code language="none"}}http://localhost{{/code}}. You should be redirected to {{code language="none"}}http://localhost/xwiki{{/code}}. | ||
| 71 | * XWiki should load correctly. | ||
| 72 | ))) |