I'm attempting to configure an online host on my small Home windows machine using Apache and HOSTS file combination.

For instance, I would like www.example.com to become offered from the server at localhost. However, port 80 is adopted with a Citrix process which can not be transformed.

So, my httpd is running on 81. I wish to have the ability to attain the following.

  1. I hit http://www.example.com on my small browser.
  2. Apache Virtual Hosts configuration should receive this request despite running on 81. (This is when my worry lies!)
  3. Serve pages from http://localhost:81/htdocs.

Is possible whatsoever?

Following is pertinent section during my httpd.conf:

ServerName www.example.com:81
NameVirtualHost www.example.com:81

And my hosts file has got the below line:

127.0.0.1 www.example.com

Put following snippet in httpd.conf and find out whether it works. It internally forwards all demands to http://localhost:8080/rat to http://localhost:9080/rat

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /rat http://localhost:9080/rat
ProxyPassReverse /rat http://localhost:9080/rat

URL in browser remains as http://www.example.com:8080/rat but submissions are offered from http://localhost:9080/rat