Is it possible to bind domain names to VisualSVN server and IIS on the one box without using a port?

I’ve got a machine running VisualSVN Server for SCM and IIS which hosts a web front end to perform some repository management tasks. Ideally, I’d like to bind a different domain name to each but it seems I can’t do this without specifying a port on at least one of the names. For all intents and purposes it looks like you can’t run two web servers on the one machine and have port 80 requests go to each even if the requests are to different domain names. Is this the case or is there a way around this? I’m reluctant to end up putting a port number in one of them as it’s not particularly user friendly.


Solution 1:

You can run VisualSVN Server and IIS side-by-side on the same port using multiple IP address on network interfaces: http://www.itsyourip.com/networking/how-to-add-multiple-ip-address-in-windows-2000xp2003/

To configure VisualSVN Server bind to only specific interfaces use the following steps:

  1. Run VisualSVN Server Manager
  2. Right click on root element and choose Properties
  3. Switch to Network tab
  4. Select "These IP addresses" radio button
  5. Click Add Enter IP address of interface to listen
  6. Click OK to close Add interface dialog
  7. Click OK to close Properties window

To configure IIS listen on specific interface use the following steps:

  1. Start elevated command prompt
  2. Execute following command:

    netsh http add iplisten ipaddress=IPADDRESS
    

Solution 2:

An alternative, if you have the right type of application layer firewall/proxy server that is capable of URL rewriting, then you can keep all your backend services on uniqie ports and publish them through the firewall/proxy all on port 80 but with different URLs.

Microsoft's ISA Server, for example, is capable of doing just that. ISA server can crack open an incoming request, examine the URL and, based on the URL it finds, redirect the request to a completely different URL and/or port. This makes for a very secure configuration because the back-end server only ever talks to the firewall, there is never any direct traffic.

In this scenario, users would direct requests to the firewall/proxy server and never directly to teh actual back-end server.

ISA Server is a standard component of Small Business Server 2003 Premiun Edition, although it has been retired for the 2008 version.

This technique can work and I have several backend IIS servers published using this exact technique, however I have found with Apache-based solutions running on the same system as IIS, it makes for simpler management to use multiple IP addresses and have each of the systems use completely seperate IP addresses, as has been suggested in a previous answer.

Solution 3:

You will always have to use two ports if you have to competing services, but what you can do however is mask the 2nd port so that it appears to be normal.

You do this with a Reverse Proxy. Basically you tell the web host running on :80 to forward all requests on /SVN/ to http://localhost:81 (or in your case, everything on www.example.com).

In IIS 6 we use Helicon ISAPI Re-Write. IIS7 might have this functionality built in, I've never checked.