I am trying to configure a virtual host on my Windows machine using Apache and HOSTS file combination.
For example, I want www.example.com
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.
- I hit http://www.example.com on my browser.
- Apache Virtual Hosts configuration should receive this request despite running on 81. (This is where my worry lies!)
- Serve pages from http://localhost:81/htdocs.
Is this possible at all?
Following is relevant section in my httpd.conf
:
ServerName www.example.com:81
NameVirtualHost www.example.com:81
And my hosts
file has the below line:
127.0.0.1 www.example.com