Redirect Web Server

Discussion in 'Server Operation' started by kherio, Jul 21, 2008.

  1. kherio

    kherio New Member

    I have 2 web servers on the lan and one of them has no internet.
    I would like to be able to access to the lan web server from the internet so i must to redirect a web folder ( /var/www/mail/) from the one which has internet to the other in the lan and which has the webmail server.

    btw, I use apache2 on a Debian etch

    Is that possible?

    Thx in advance
     
    Last edited: Jul 21, 2008
  2. chipsafts

    chipsafts New Member

    you can try an NFS share/mount , setup a virtual site and see how it goes.
     
  3. falko

    falko Super Moderator Howtoforge Staff

  4. kherio

    kherio New Member

    It's a good idea but i'm not using ispconfig and no balancer ;)
    They are 2 diferent servers offering diferent services.

    Here is my idea:
    http://mypublicdomain/ -> Goes to the main server
    http://mypublicdomain/mail -> Must go to a server in the LAN.

    That's why im asking to create a virtual server but i have no clue. Is there any good tutorial or a howto?

    Thx
     
  5. martien

    martien New Member

    Use proxypass like this:
    Code:
    ProxyPass /mail/ http://192.168.1.103:80/
    ProxyPassReserve /mail/ http://192.168.1.103:80/
    Just change 192.168.1.103 with your second server ip. You also can put this into a VirtualHost.
     
  6. kherio

    kherio New Member

    Hi all,

    I already did it. This is my mail VirtualHost file in the sites-enabled folder:

    <VirtualHost *>

    DocumentRoot "/var/www/mail"
    ServerName server2.server.com
    ServerAdmin [email protected]
    DirectoryIndex index.html index.php

    RewriteEngine On
    RewriteRule ^/$ /mail [L,R]

    ProxyRequests On
    ProxyPreserveHost On
    ProxyVia full

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

    ProxyPass /mail/ http://172.18.8.2:80/
    ProxyPassReverse /mail/ http://172.18.8.2:80/

    </VirtualHost>

    Also I created the mail folder under /var/www but I suppose I must create the index.html or php file to redirect all the calls from that directory to the mail server. Does anybody tell me what to type in that file?

    Im sorry but i'm newbie in these cases.

    Thx
     
  7. kherio

    kherio New Member

    Im sorry but it doesn't work. im a little fool :rolleyes:

    May I create the mail folder on the Internet Server? Or it doesn't matter?

    Can anybody tell me all the lines must I put on the sites-enabled folder?

    Thx in advance
     

Share This Page