How to configure Apache and Tomcat with vhosts?
- by Umar Farooq Khawaja
I have a server with a static, public IP address. I also have a registered domain name.
For the sake of illustration, let's suppose they are
IP Address: 12.34.56.78
Domain Name: example.com
I have a single machine on which I am running the following:
A website (over IIS7) available locally at localhost:80
A JetBrains TeamCity instance (over Tomcat) available locally at localhost:1234
A VisualSVN Server instance (over Apache) available locally at localhost:5678/svn
I have set up an A record for example.com and the following CNAME records:
www.example.com
builds.example.com
sources.example.com
I would like to configure Tomcat and Apache such that:
if I point my browser at builds.example.com, I end up at the JetBrains TeamCity instance and,
if I point my browser at sources.example.com, I end up at the VisualSVN Server instance.
I thought I could configure the Apache to vhost example.com:5678/svn to point to sources.example.com and added the following lines to the Apache httpd.conf file
Listen 5678
NameVirtualHost *:5678
<VistualHost *:5678>
ServerName sources.example.com
DocumentRoot /svn
</virtualHost>
That broke the VisualSVN instance, so I had to revert that to
Listen 5678
Help!