Configure Apache HTTP Server as a Proxy on a Windows OS

Last modified by Eleni Cojocariu on 2026/05/20 16:51

Tutorial

Warning

WIP-not sure how much a Windows version of the tutorial is needed

To set the Apache HTTP Server Proxy:

  1. Make sure your wiki is running and accessible locally (e.g., at http://localhost:8080/.
  2. Install Apache Lounge (Apache HTTP Server for Windows):
    1. Download Apache  (e.g., httpd-2.4.x-win64-VS17.zip).
    2. Extract the archive to a directory, for example: C:\Apache24.
    3. Install Apache as a Windows service:
      • Open Command Prompt as Administrator and run: 
      cd C:\Apache24\bin
      httpd.exe -k install
  3. Fix the Apache configuration path (if needed):
    • Edit the file C:\Apache24\conf\httpd.conf and ensure the following line matches your installation directory:
      Define SRVROOT "C:/Apache24"
      If you installed Apache in a different folder (e.g., C:\Apache\Apache24), update the path accordingly.
  4. Set the server name (to avoid warnings):
    • In httpd.conf, uncomment and update:
      ServerName localhost:80
  5. Enable required Apache modules for proxy:

    In httpd.conf, uncomment the following lines (remove the #) to enable the proxy_module, proxy_http_module, headers_module, rewrite_module:

    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule headers_module modules/mod_headers.so
    LoadModule rewrite_module modules/mod_rewrite.so
    LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
  6. Restart Apache: httpd.exe -k restart.
  7. Configure the Reverse Proxy: edit C:\Apache24\conf\httpd.conf and add:
    <VirtualHost *:80>
      ServerName localhost
    
      ProxyRequests Off
      ProxyPreserveHost On
    
      AllowEncodedSlashes NoDecode
    
      <Proxy *>
      Require all granted
      </Proxy>
    
      RedirectMatch ^/$ /xwiki/
    
      ProxyPass /xwiki http://localhost:8080/xwiki nocanon upgrade=websocket
      ProxyPassReverse /xwiki http://localhost:8080/xwiki nocanon
    
    </VirtualHost> 
  8. Restart Apache.
  9. Test the setup:
    • Open your browser: http://localhost. You should be redirected to http://localhost/xwiki.
    • XWiki should load correctly.  

FAQ

How can I check if Apache is running locally?

Before configuring the proxy server for XWiki, you can check whether Apache is running by opening your browser and type http://localhost. If you see a page from Apache, it means it's running.

What if I need also modules for SSL, or other modules?

There are of course a lot of ways to configure the proxy server, and plenty of Apache modules, such as SSL. Check also more configurations for the Apache HTTP Proxy server.

How can I configure the proxy server if I have a custom domain?

Replace the ServerName localhost with your custom domain, for example ServerName wiki.example.com. If needed (e.g., when using custom local domain, which are not real public domains), you must configure DNS resolution so that your system knows where to route the request. To do so, edit the hosts file to add for example 127.0.0.1 wiki.example.local.

What if I get 404 error

A common mistake is the following issue: 404 or broken links. Check: /xwiki mapping.

Related

Get Connected