Windows 2008 server and Redhat with only 1 ip address, can windows route the traffic?

3

1

I have a two home server VMs set up. Windows 2008 server on port 80 and Centos/Redhat on port 8080. Both have separate godaddy domain name A name records pointing to them. But I cant point both domain to the same IP I only have 1 wan ip address at home. So one of my domain is forward to my IP:8080. My question: Is it possible for my windows server to redirect a certain domain name to my Linux server on port 8080? So i Have mysite1.com going to windows and mysite2.com also going to the windows server but windows would redirect mysite2.com traffic to the linux ip address:8080. I want to access both sites at my work and my work firewall is strict and will not allow domain forwarding from godaddy.

paulcap1

Posted 2012-12-18T21:47:22.640

Reputation: 153

Answers

1

My understanding is that you already have your router forwarding port 80 to Windows and port 8080 to Linux. Now you are trying to solve the issue of people typing in the domain name for the Linux server without the ":8080" and that traffic going to the windows box.

The solution is to create two websites in IIS and set them both to listen on the same IP address. The only difference will be the host header. That way when the web traffic reaches IIS it will look at the URL and direct the traffic to the right website based on the domain name. Here is the TechNet article on creating host headers. http://technet.microsoft.com/en-us/library/cc753195(v=ws.10).aspx

After that is done all you need to do is setup the redirect of all traffic to the IIS Linux website to http://LinuxDomainName:8080 You can either write a redirect page in HTML or use the "HTTP Redirect" module in IIS. http://technet.microsoft.com/en-us/library/cc770409(v=ws.10).aspx

Hope this helps...

-Joe

Joe DeMate

Posted 2012-12-18T21:47:22.640

Reputation:

Thanks Joe, That sounds like it will work. I will give that a try and report back. I am more familiar with Linux. I may be able to do the reverse using Linux virtualhost, and now I see a response below about that! – None – 2012-12-19T00:10:54.907

I will check out those links. Just briefly looked at this guys IIS example and it looks like it could work.

http://blogs.iis.net/carlosag/archive/2010/04/01/setting-up-a-reverse-proxy-using-iis-url-rewrite-and-arr.aspx

– None – 2012-12-19T00:34:16.110

Hi Joe, I am working on it now. I added the hostheader for my linux box in IIS, but still no luck. Was wondering if I need to change my server hostname to match my godaddy domain name?

Let me explain it. I have 2 goddady domain a name records pointing to my windows server 2008R2 home server, its 1 Verizon wan ip address. It works and I can access mysite.com. But should my windows server hostname be called mysite.com. – paulcap1 – 2012-12-20T17:57:20.093

here is my ipconfig /all computer name of:windows20081 Host Name: windows20081 Primary Dns Suffix: windows1.local

So will hostheader work if my server hostname is different than my godaddy domain?

I have a home linux server and a home windows server, and 1 wan ip address. I also have 2 godaddy domain names. I want to use IIS hostheader to point 1 domain to my windows box and point the other domain to my linux box. – paulcap1 – 2012-12-20T17:57:58.987

my linux server hostname matches my godaddy domain name:mysite2.com – paulcap1 – 2012-12-20T18:05:24.717

maybe my windows server needs to match my other godaddy domain name:mysite1.com – paulcap1 – 2012-12-20T18:06:06.987

I also set up a domain controller on this server. Should I change the name of the DC as well? – paulcap1 – 2012-12-20T18:16:42.760

Now I noticed that my domain mysite2.com which should be pointing to my linux box does work if i go to: mysite2.com:8080. My IIS hostheader for my linux box has my wan ip address and port 8080 and the hostheader is: mysite2.com – paulcap1 – 2012-12-20T18:44:24.870

Hi Joe, Sorry for the confusion. Your guidance worked.

i created the IIS linux site, create the static redirect page pointing to: http://LinuxDomainName:8080

One last question. Can I hide/mask the 8080

– paulcap1 – 2012-12-20T19:12:53.783

1

What you're talking about is a Reverse Proxy. IIS appears to be able to do it, but I have no experience with IIS. In apache terminology, you need to use the proxy modules, with a VirtualHost for each domain (mysite1.com and mysite2.com). The Reverse Proxy then makes the request to each server (Windows or the CentOS/RedHat box) depending on which VirtualHost the original request was sent to.

The user (or you) enters whichever address you want (mysite1.com or mysite2.com) in their browser, which connects to the Reverse Proxy. The reverse proxy uses the HTTP "host" header to determine which site it needs to return, and it worries about the ports. The remote user is never aware that the CentOS/RedHat box is actually listening on 8080.

There are appears to be quite a bit of information in Google if you search for iis reverse proxy

fukawi2

Posted 2012-12-18T21:47:22.640

Reputation: 191

This also makes sense, I am not to familiar with reverse proxy yet. Still learning. Would a linux virtual host like below be close to solving it. The 1.2.3.4 is my versizon wan ip address. I dont know how to format this correctly in this editor.

<VirtualHost 1.2.3.4> ServerName mysite1.com DocumentRoot "/var/www/html/mysite1/" DirectoryIndex index.php index.html index.htm

</VirtualHost>

<VirtualHost 1.2.3.4:8080> ServerName mysite2.com DocumentRoot "/the correct windows directory?/" DirectoryIndex index.php index.html index.htm

</VirtualHost> – None – 2012-12-19T00:14:26.533

On the reverse proxy, you want 2 VirtualHosts both on port 80, one for each domain. Within those VHosts you then configure the Proxy module to reverse proxy each VHost to the appropriate "internal" server on the relevant port. – fukawi2 – 2012-12-19T02:23:29.210

0

You certainly can have both A records point to the same ip address. On your router/firewall you'll configure port forwarding for port 80 to go to one server and port 8080 to go to the other server.

Incoming traffic to x.x.x.x:80 will go to one server and traffic to x.x.x.x:8080 will go to the other server.

joeqwerty

Posted 2012-12-18T21:47:22.640

Reputation: 5 259

I think a Reverse Proxy solves the OP question better. – None – 2012-12-18T22:30:21.743

That doesn't address paulcap1's issue of the redirect not being allowed by his work's firewall. Reverse proxy as mentioned by fukawi2 is necessary. – None – 2012-12-18T22:31:57.370

I'm missing something. I don't see how/why a redirect or proxy is needed. 1. http://mysite1.com:80 - 2. http://mysite2.com:8080. Is it the case that the OP doesn't want to specify the port? If it is then I did miss that and my apologies.

– joeqwerty – 2012-12-18T23:11:58.123

My current setup using a godaddy forward to my IP:8080 works fine out in public. But most government agencies have strict firewall rules. After doing some testing I found that they block domain name that are using a godaddy forwarded. I work at an agency that is blocking my forward. – None – 2012-12-19T00:23:23.917

What I mean is my current set up is a godaddy forward to x.x.x.x:8080 which is my linux box. The gov. agency firewall rule block all domain forwards. For anyone with your online resume hosted in this set up.. beware. Most gov. agencies will block it and will not see your resume. – paulcap1 – 2012-12-19T01:35:37.953