Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to configure a virtual host on my Windows machine using Apache and HOSTS file combination.

For example, I want to be served from my server at localhost. However, port 80 is taken up by a Citrix process which can't be changed.

So, my httpd is running on 81. I want to be able to achieve the following.

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

Is this possible at all?

Following is relevant section in my httpd.conf:


And my hosts file has the below line:
share|improve this question

migrated from Mar 22 '12 at 0:26

This question came from our site for professional and enthusiast programmers.

Put following snippet in httpd.conf and see if it works. It internally forwards all requests to http://localhost:8080/rat to http://localhost:9080/rat

LoadModule proxy_module modules/
LoadModule proxy_ftp_module modules/
LoadModule proxy_http_module modules/
LoadModule proxy_connect_module modules/

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all

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

URL in browser remains as but content is served from http://localhost:9080/rat

share|improve this answer
But what if 8080 is taken by a non-httpd process to which I don't have access? – adarshr Nov 21 '11 at 14:57
If you want httpd to run on different ports you need to listen on different ports and ports must be free .Or there must be two network interfaces. pls see – Prashant Bhate Nov 21 '11 at 15:18
I think what I am trying to do, can't be achieved. I want httpd to run on 81 and yet be able to hit (80) on my browser. Which is kind of impossible unless I have my httpd listening on both 80 and 81. What do you think? – adarshr Nov 21 '11 at 15:35
yep, I don't doubt so ;) unless there are two network interfaces (= two IP address) and Citrix process is listening on either one, and you could map other IP to apache ! – Prashant Bhate Nov 21 '11 at 15:45
I have actually figured out how to change Citrix configuration to point to a different port. But, here we logon remotely ONLY to our desktops and I'm afraid I will lose the connection and won't be able to reconnect again if I mess something up. I will live with for now :) – adarshr Nov 21 '11 at 15:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.