Jump to content

How do I host all these Sites and Services under 1 IP Address?


Recommended Posts

Posted

[ The following is a direct copy/paste of my post at TechRepublic ]

 

How do I host all these Sites and Services under 1 IP Address?

Here's the deal.

 

I started out when I was little making websites on a free webbased setup online. Similar to freewebs. I used Homestead. They offered more.

 

Then as I grew up I became a Network Administrator as I am now. I host the websites out of my own house. I had one web server and I hosted files on it for a website I still had at homestead. Eventually, I got a second server, set port 80 to forward to that, and installed Server 2003 and IIS on that server and bought a domain name from Godaddy.com, configured an A record to my home IP address, and I was good to go.

 

I now have 3 websites on that server. It's also the Database server for those websites which require dynamic content. The domains for all of them are from 2 different registrars, but I used the DNS tool in both to configure an A record to my home address. From there, to differentiate the difference between the 3 web addresses on the same server, I configure Host Headers within IIS.

 

Now, what I'd like to do, and the purpose for typing up this question, is to host websites on different servers, as well as host a mail server. I've been told hosting my own DNS server is the way to go. I'd like to have say, one website hosted on one dedicated server, and another few websites hosted on another server, but with a router on a home cable line I can't forward port 80 to two different machines. Do I need to forward it to an internal DNS server that acts as a proxy or something? Please do correct me if I'm wrong. I don't want to purchase another IP, I know I CAN, but that's not the point. The point is I really want to learn how to do this.

 

The other thing I'd like to do, is host a mail server. I have licences for a mail server at the moment [Kerio Mail Server 6] and would like to use it as an SMTP and POP server. For example, one of my websites has forums and the forums need to know a valid SMTP server to send out "mass emails" and newsletters [i use PHPBB]. I'd like to configure it so not only it can send emails, but I can also make mailboxes for admin members. Through GoDaddy, I can purchase extra email addresses through THEIR mail system, but I'd like to have my own. Again, I've talked with people who use Kerio already and they say the best way to do this is to host your own in house DNS server and make MX records for your internal server.

 

If anyone has any information on how I can do this, any websites, or would take the time to explain how I can do it, please do let me know. I'll be more than happy to supply more information if need be as well or if I wasn't clear. Thank you so much in advance for taking the time to read my question. Much appreciated.

Posted
What you need is some kind of reverse proxy or web site publishing tool (such as that found with ISA). Basically, the inbound request hits the proxy and is rewritten to get routed to the correct place in your internal network.
  • Thanks 1
Posted

This is all down to HTTP headers and can be done via IIS in the website properties for each site and with Apache by using the mod_headers module IIRC.

 

Technet is the best place to look for IIS instructions and I have always found the guides on apache.org best, or failing that you can check some of the answers on http://www.askapache.com

 

HTH

Posted

I know you said you didn't want to get more IP addresses, but why not? That would be the simplest solution to your problem. Adding in reverse proxying systems like Ric_ suggests would work, but would add a layer of complexity that is unncessesary on such a small scale.

 

But as Ric_ says, this can be done in ISA (indeed, this is how I do it in school, as it is far easier for me to do this via my existing system than to request more IP addresses)

Posted
@Grumbledook: That would only work if the OP had multiple IPs to externally publish all his servers.

 

not necessarily true. As long as the combination of "host header", "IP Address" and "port" is unique then it works fine. We only have 30 IP addresses but we have a lot more than 32 web sites (most of the IPs are unused)

Posted

Reverse proxying isn't a big deal and isn't that complex. I use it on apache so that I can forward http to my windows server from my FreeBSD one that's running apache so that I can access the web torrent's gui without forwarding another port (seeing as I've filled the NAT list in my router i can't forward any more). I use it for a few other things too...

 

It's relatively easy to setup, it just involves a few extra modules and a virtual host config.

 

I use this:

 

#VHOST BIT
       ServerAdmin [email protected]
       ServerName cname.domain.tld
       ServerAlias cname.domain.tld

#PROXYING BIT - NOTE THE SLASHES AND WHERE THEY ARE AND AREN'T
       ProxyPass       /       http://internal_address/
       ProxyHTMLURLMap http://internal_address /
       ProxyPassReverse        /       http://internal_address

 

These are the modules I /think/ are the important ones for reverse proxying. I've got them written down somewhere as I can never remember which ones you need to do proxying and which are used for name based vhosts etc so this list could be missing/including one too few/many. Have a google for this bit to check.

 

  • headers_module
  • proxy_http_module
  • proxy_module
  • proxy_html_module
  • alias_module
  • vhost_alias_module

  • Thanks 1
Posted

I think I may have thrown things off slightly with my comment.

 

HTTP headers are designed with a web server to allow for multiple FQDNs to be served from a single IP or load balanced / clustered server setup.

 

However, the same basis holds true of a number of home user routers. I have previously had Linksys kit that will allow me to host and use my own DNS to point services at specific machines. I did this in conjunction with using DynDNS, which also have a number of good user guides on the subject (and IIRC recommendations on hardware to use.)

Posted

Thanks for everyones replies so far. Keep in mind this is not going to multiple websites on ONE server, but on TWO or THREE dedicated web servers under one IP address, all to use port 80 if possible. I'm currently using the D-Link DIR-655 Xtreme N router, and can of course only forward port 80 to ONE internal IP. So yes, host headers would work if I had either multiple IP's and forwarded to one box, OR if I had multiple websites under one IP, and as I explained before, I currently AM using host headers to host the 3 websites that are on that SINGLE server acting as both Web and MySQL Server. But, I'd like to have a dedicated server for a few of my other websites. So I'd need a front end.

 

Also, any comments so far about hosting my own mail server and if an Internal DNS solution would be best?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...