2

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:

  1. A website (over IIS7) available locally at localhost:80
  2. A JetBrains TeamCity instance (over Tomcat) available locally at localhost:1234
  3. 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!

1
  • typo alert: you have <VistualHost *:5678> with an s instead of an r.
    – ramruma
    Mar 25, 2012 at 7:05

1 Answer 1

1

You can use the apache server as a proxy, blindly forwarding the requests to the sites. To configure the apache server to act as a proxy, you need something like this in the config file:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

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

NameVirtualHost 0.0.0.0:80
<VirtualHost 0.0.0.0:80>
    ServerName sources.example.com

    ProxyPass        / http://localhost:5678/svn/
    ProxyPassReverse / http://localhost:5678/svn/
</VirtualHost>
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .