This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DNAT by Hostheader

Is it possible to use DNAT to redirect to diffrent ip's or portnumbers depending on the hostheader, for ex,
Any -> External_Interface__ / FTP "ftp.samurai.se" None   Server_ftp1__
Any -> External_Interface__ / FTP "ftp.swedishopen.nu" None   Server_ftp2__
Becuase IIS 5.0 itself can't differ ftp-sites by hostheader!
u need either different ip's or different s-ports for each ftp-site!
Is it possible, If not will it be?   
It is something I would really want!     


This thread was automatically locked due to age.
  • Yes, IIS 5.0 supports hostheader for http services, but not ftp services.
    I got an answer from a friend (who is MCSE),
    he told me that hostheaders is a http protocol only and is not supported by ftp.
    But still, if u have 2 separate webservers with different sites on each (not mirrors) it would be a great thing to DNAT the right request to the right webserver 
    Am I totaly of?   
  • I suggest use different ports, and throw away your MS ftp server.  [:$] 
  •  
    Svar till:

    I suggest use different ports, and throw away your MS ftp server.  

    [/ QUOTE ] 
    That is already done.
    The thing is this.
    I have a friend who wants to have his webserver in my basement (Server room) and host his own homepage on it.
    I already have a webserver hosting hompages for my ju-jutsu club and a competition that we arrange.  
    192.168.1.2  hosting  www.samurai.se  and  www.swedishopen.nu
    My friends webserver would be
    192.168.1.3  hosting  www.??????.??
    are there any solutions to my problem [:S]    
  • If both web servers are on the same physical machine then no problem.  Hostheader takes care of the web side and ftp is done by the user account at login.  But I'd dump FTP altogether and run something secure like sftp but that is another topic.

    Different physical machines with only one external public IP is another story.  My favourite way for that is to use a reverse proxy server (Apache, Squid etc set to reverse proxy mode).  The proxy does host header and passes the request to the right web server.  The servers could be on a unique machine or one of the web servers.  You can then pass a request to a unique port number if desired while maintaining a normal port 80 to the world.  This allows for web servers to be on the same machine, different machine, different network, any combo.

    Handling FTP in that case is a little tougher.  Pass FTP to a machine that can reach the intended machine via file sharing/NFS etc.  The file sharing/NFS aren't secure but will only exist behind the firewall and not a big problem.
        
  • Thanks!

    The thing is I know it is possible to use 2 webservers in 1 network!
    What I'm looking for is a way to do this in Astaro!
    Like when u DNAT and select service HTTP a hostheader line will appear where u can specifie the url u want to redirect to the server you choose!

     Name -------------------  Match parameters -----------------------   HoastHeader ----------- SRC translation ------  DST translation 
    DNAT samurai --  Any -> External_Interface__ / HTTP ---  www.samurai.se   -----------  None --------------  Internal_www1__    
    DNAT samurai --  Any -> External_Interface__ / HTTP ---   www.swedishopen.nu  ---  None --------------  Internal_www2__ 

    Or maybe it could be on a seperat page! 
    This would be some sort of internal DNS (or whatever u would call it)

    I've realized that this is not possible with astaro, for the moment! 
    Maybe something for the Astaro crue!

    Am I the only one who's really missing this feature?

        
  • Technicaly it could be possible on ASL as it already has Squid that can do as you want with manual hacking.  But it is still better to do this behind the firewall.

    In your case with with only a few servers I would run Apache as the web server and reverse proxy.  A single box can handle many web servers with all kinds of header redirection to virtual servers on the same box or elsewhere.

    But you wouldn't even need reverse proxy if the webs are on the same box.  Apache already handles VirtualNamed hosting and Redirection very well.  Multiple boxes can be handled by one server doing Redirection/Reverse proxy.
       
  • Svar till:

    Technicaly it could be possible on ASL as it already has Squid that can do as you want with manual hacking.  But it is still better to do this behind the firewall.

    [/ QUOTE ]

    Is there a security risk or something involved in my proposition?  
  • Definetly a risk as you are adding another option at the firewall that is beyond control of the kernel.  It should work however but ASL updates could cause grief later on.  But who knows, maybe they will add these features.

    I prefer to firewall and then do services behind it.  Apache and Squid can both do what you are looking for.  But you don't get a fancy GUI to make it simple.  The config files are easier to deal with than anything in the usual Windows world but once you understand the options it is easy to change a simple text file.

    But for what you describe a basic Apache server with only NamedVirtualHost set-up will handle as many servers as you could ever need behind a single IP.  Add a dynamic DNS client at ASL and you have it all.  Your ISP might not like it but if you look at your ASL log you will see lots of port 80 requests coming from virus infected NT servers.  I get more of that than actual requests.  Apache just laughs it off.  In fact you can make a redirect for these requests to go somewhere else.

    I do my testing on my home server with lots of virtual servers configured many different ways.  It sees the URL header and routes appropriatly.