A single IP address and Domain name serving many servers

Discussion in 'Apache' started by Branquim, Aug 12, 2009.

  1. #1
    I want to know if its possible and how to do it...

    I have one valid ip address and one internet domain.

    What I want to do is:
    - when a client access my domain with: www.mydomain.com on his web browser he access my apache server apache1.localnetwork 10.0.0.1 (I already do this through nat in iptables).
    - when he types www.mydomain.com/site1 I serve him with another apache server inside my local network (apache2.localnetwork 10.0.0.2).
    - when he types www.mydomain.com/site2 he access another server apache3.localnetwork 10.0.0.3.

    How can I do this redirection with the client passing me just another uri and I serving him with different apache servers, having only an external ip and domain name?

    Thanks.
     
    Branquim, Aug 12, 2009 IP
  2. vasyl

    vasyl Peon

    Messages:
    138
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    First you should think about virtual hosts - standard apache's feature to host multiple sites on single IP.
    If you still need to host these sites on different servers you can use ProxyPassReverse/ProxyPass for the virtual hosts hosted on another server or use another frontend (nginx is the easiest to configure) for http
     
    vasyl, Aug 13, 2009 IP