Help needed in apache redirect

Alles, was den Apache betrifft, kann hier besprochen werden.

Help needed in apache redirect

Postby tuty_richard » 29. November 2008 15:52

I have static IP set to my router. I am running two web servers. I have redirected my 80 port from the router to my server 1 its working fine. I need a help in setting up like this

I have domain say mydomain.com when ever I type mydomain.com in my browser it comes to my router then to my server 1 thats fine.

I have sub domain say sub.mydomain.com when ever I type sub.mydomain.com the router redirects to my webserver1. but what I need is my sub.mydomain has to be served by my server 2. How can I achieve this

Thanks
Richard
tuty_richard
 
Posts: 3
Joined: 29. November 2008 15:43

Postby glitzi85 » 29. November 2008 17:03

Why not serverd by server1?

You can use mod_proxy on server1:

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
  ServerName example.com
  DocumentRoot /xampp/htdocs
</VirtualHost>

<VirtualHost *:80>
  ServerName sub.example.com
  ProxyRequests Off

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

  ProxyPass / http://server2/
  ProxyPassReverse / http://server2/
</VirtualHost>


http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Postby tuty_richard » 30. November 2008 02:22

Thanks for comments. I will try this. I can't use the server 1 because I have installed zimbra mail server on server 2 which uses httpd. So what ever mail.mydomain.com has to be served by the server 2.
tuty_richard
 
Posts: 3
Joined: 29. November 2008 15:43


Return to Apache

Who is online

Users browsing this forum: No registered users and 262 guests