Two domain on one port 80

Discussion in 'Installation/Configuration' started by Sked, Aug 29, 2015.

  1. Sked

    Sked New Member

    Hello
    I am wondering how to setup apache2 server with 2 domain and each for different server.
    Well to better explain:
    I have one static IP for example 12.12.12.12.
    Then on router i can open only one port 80 for one server, for example 192.168.0.100.
    And on server 192.168.0.100 i have apache2 with domain, for example domain1.com.
    On 2nd server 192.168.0.101 i have apache2 with domain, for example domain2.com.
    Is it possible to use redirect on vhosts on 1st server?
    Or how to setup both servers that each will link to each server?
    Thanks for help.
     
  2. TiTex

    TiTex Member

    you should check if your router can handle hostname based offloading (proxying) , if not then you can do that on the "main" webserver with apache's mod_proxy_*
    something like

    <VirtualHost *:80>
    ServerName domain2.com
    ProxyPass / http://192.168.0.101/
    ProxyPassReverse / http://192.168.0.101/
    </VirtualHost>

    Or you can add a third server (this is how i'm doing it) whose only job is to do the proxying for all the webservers in the internal network
    more info http://httpd.apache.org/docs/2.4/mod/mod_proxy.html
     
  3. cryangels

    cryangels New Member

    Why not use one server more sites ? apache2 can support it .
     

Share This Page