Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an application sitting on a ubuntu operating system located on one server. It responds to an ip address with domain, let's say, abc.com. Now there's another server that responds to the domain, let's say, called xyz.com. The application does not sit on that server. I want that domain xyz.com, when invoked, to load the application on the other server (the server with abc.com). However, I also want the domain abc.com to load that same application as well. Im not 100 percent sure how to go about this, wehther changes to mod_rewrite can deliver on this.

thanks for response

share|improve this question
    
when someone visits xyz.com, do you want it to display the abc.com domain or still xyz.com? –  kobaltz Dec 12 '11 at 16:25
    
I want it to display the xyz.com domain –  JohnMerlino Dec 12 '11 at 16:27

1 Answer 1

up vote 1 down vote accepted

Here is a snippet of an article I wrote for reverse proxies. It is not exactly on topic with what you're trying to do, but may give you some direction and ideas.

There may be times when you need to have multiple web servers, but you have been given only one Public IP Address. The issue you will run into is that you want to have your multiple domains resolve the same IP address, but point to a different server. This is very doable with Apache. I configured a gateway server within my private cloud with an address of 192.168.1.2. I have several web servers with local addresses; 192.168.1.10 and 192.168.1.11 for example.

On my Gateway server, I install Apache and the mod_proxy files. Once this is complete, I am able to set up the virtual hosts to forward the domain.

<VirtualHost *:80>
   DocumentRoot /var/www/example.org
    ServerName *.example.org
    ProxyRequests Off
    <Proxy *>
      Order deny,allow
      Allow from all
    </Proxy>
    ProxyPreserveHost on
    ProxyPass / http://192.168.1.10/
    ProxyPassReverse / http://192.168.1.10
</VirtualHost>

<VirtualHost *:80>
   DocumentRoot /var/www/example.com
    ServerName *.example.com
    ProxyRequests Off
    <Proxy *>
      Order deny,allow
      Allow from all
    </Proxy>
    ProxyPreserveHost on
    ProxyPass / http://192.168.1.11/
    ProxyPassReverse / http://192.168.1.11/
</VirtualHost>

Restart Apache and configure your router to accept incoming connections to the 192.168.1.2 local address.

share|improve this answer
    
thanks for response, my understanding is that on their godaddy server, I have to fetch files from my server. SO in order to do this, I need to load the reverse proxy module in httpd.conf by adding this line to httpd.conf: ProxyRequests Off. But what does ProxyPass and ProxyPassReverse do? Thanks for response. Documentation isn't clear on that. –  JohnMerlino Dec 12 '11 at 18:03
    
What services do you have from GoDaddy? Is it just a web host or do you have a VPS from them? –  kobaltz Dec 12 '11 at 18:20
    
how come your example looks different from this: jeffbaier.com/articles/configuring-apache-virtual-hosts-for-nat –  JohnMerlino Dec 13 '11 at 16:46
    
it looks like they're not putting it in tags. I'm unsure as to why this is on their example. I've always used tags and close tags. –  kobaltz Dec 13 '11 at 17:53

Your Answer

 
discard

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.