 | | From: | pu | | Subject: | Sharing web server to the internet | | Date: | Wed, 19 Jan 2005 14:45:29 +1000 |
|
|
 | Hi all.
I have linux 9.0 allowing other PCs on my LAN to access the internet using masquerading. I have a http server on this Linux box that can be accessed from the internet. You access it by typing http://###.###.###.### in a browser like Mozilla or Internet Explorer, where ###.###.###.### is the ip address of the linux PC. All works well.
I have a Windows PC on my LAN running IIS 5.0 which works well on my LAN but I wish it to be available on the internet though the Linux box. Any one with the instructions or point me to the right Documentation. I have googled to my hearts content with no results.
Thanks in advance.
Regards Leigh
cc to leejen666@hotmail.com
|
|
 | | From: | Charles Chambers | | Subject: | Re: Sharing web server to the internet | | Date: | Wed, 19 Jan 2005 05:57:08 -0700 |
|
|
 | "pu" wrote in message news:MBlHd.74$g05.3069@nnrp1.ozemail.com.au... > Hi all. > > I have linux 9.0 allowing other PCs on my LAN to access the internet using > masquerading. I have a http server on this Linux box that can be accessed > from the internet. You access it by typing http://###.###.###.### in a > browser like Mozilla or Internet Explorer, where ###.###.###.### is the ip > address of the linux PC. All works well. > > I have a Windows PC on my LAN running IIS 5.0 which works well on my LAN > but > I wish it to be available on the internet though the Linux box. Any one > with > the instructions or point me to the right Documentation. I have googled to > my hearts content with no results. > > Thanks in advance.
Or you can set up the Linux box as a router, configure IIS in the MS box, and run all the web design programs you want, saving the finished product to the [default] c:\www directory.
|
|
 | | From: | Nils_O._Selåsdal | | Subject: | Re: Sharing web server to the internet | | Date: | Wed, 19 Jan 2005 08:33:26 +0100 |
|
|
 | pu wrote: > Hi all. > > I have linux 9.0 allowing other PCs on my LAN to access the internet using > masquerading. I have a http server on this Linux box that can be accessed > from the internet. You access it by typing http://###.###.###.### in a > browser like Mozilla or Internet Explorer, where ###.###.###.### is the ip > address of the linux PC. All works well. > > I have a Windows PC on my LAN running IIS 5.0 which works well on my LAN but > I wish it to be available on the internet though the Linux box. Any one with > the instructions or point me to the right Documentation. I have googled to > my hearts content with no results. Well, there are a LARGE number of possible setups possible. Which one you have is not clear. Port forwarding is probably what you want though.
/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 5000 -j DNAT --to-dest 192.168.1.20:80
That would make http://ipoflinuxbox:5000/ forward the connection to your IIS server at 192.168.1.20 port 80 (eth0 in -i eth0 is the name of the interface that's on the internet.)
|
|
 | | From: | pu | | Subject: | Re: Sharing web server to the internet | | Date: | Wed, 19 Jan 2005 23:23:45 +1000 |
|
|
 | "Nils O. Selåsdal" wrote in message news:a3oHd.5048$Sl3.120054@news4.e.nsc.no... > pu wrote: [some deleted> > /sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 5000 -j DNAT > --to-dest 192.168.1.20:80 > > That would make http://ipoflinuxbox:5000/ forward the connection to your > IIS server at 192.168.1.20 port 80 > (eth0 in -i eth0 is the name of the interface that's on the internet.)
Thanks for that. I understand how iptables works (obvously not good enough though). I can type http://192.168.1.20 (your example) and my web site displays fine from any PC on my 192.168.1.0 network. But when I type http://ipoflinuxbox:5000 I keep getting.the following. There must be something else involved. (note: There is no firewall on IIS5 PC) ===begin=== While trying to retrieve the URL: http://ipoflinuxbox:5000/
The following error was encountered:
a.. Connection Failed The system returned:
(111) Connection refusedThe remote host or network may be down. Please try the request again.
Your cache administrator is root.
===end===
|
|
 | | From: | Nils_O._Selåsdal | | Subject: | Re: Sharing web server to the internet | | Date: | Thu, 20 Jan 2005 16:22:10 +0100 |
|
|
 | pu wrote: > "Nils O. Selåsdal" wrote in message > news:a3oHd.5048$Sl3.120054@news4.e.nsc.no... > >>pu wrote: > > [some deleted> > >>/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 5000 -j DNAT >>--to-dest 192.168.1.20:80 >> >>That would make http://ipoflinuxbox:5000/ forward the connection to your >>IIS server at 192.168.1.20 port 80 >>(eth0 in -i eth0 is the name of the interface that's on the internet.) > > > Thanks for that. I understand how iptables works (obvously not good enough > though). I can type http://192.168.1.20 (your example) and my web site > displays fine from any PC on my 192.168.1.0 network. But when I type > http://ipoflinuxbox:5000 I keep getting.the following. There must be > something else involved. (note: There is no firewall on IIS5 PC) > ===begin=== In the example above http://ipoflinuxbox:5000/ will only work for external clients, on your lan, you still have to use http://192.168.1.20 (This among other assumes that the ipoflinuxbox is on the internet, an no firewalling/nat inbetween :)
|
|
 | | From: | pu | | Subject: | Re: Sharing web server to the internet | | Date: | Thu, 20 Jan 2005 10:24:20 +1000 |
|
|
 | Thanks to all who replied. I understand the principlts somewhat but after many days reading, it sounds simple, I cannot get this thing going.
Now I am a little wiser (I hope) I am trying to access an internal webserver by using something like http://XXX.XXX.XXX.XXX:5000 When my linux box (used as the gateway) receives this, it will redirect the request to http://myinternalwebserver:80. I have tried using different iptable rules to accomplish this with no result. I have squid, httpd and named running. Do any of these have a bearing on my problem. I understand that squid is like a proxy, httpd is my linux web server (not to be confused with myinternalwebserver), and named is my DNS. They all seem to work well. I run linux9.0 with an internet connection using an external modem, and linux box is also connected to a hub (switch) forming a LAN with myinternalwebserver also connected to it.
In all the literature I have read so far say that this is a simple task. Does anybody out there have any other ideas, something I have missed, etc.
Thanks in advance.
Regards Leigh
"pu" wrote in message news:MBlHd.74$g05.3069@nnrp1.ozemail.com.au... > Hi all. > > I have linux 9.0 allowing other PCs on my LAN to access the internet using > masquerading. I have a http server on this Linux box that can be accessed > from the internet. You access it by typing http://###.###.###.### in a > browser like Mozilla or Internet Explorer, where ###.###.###.### is the ip > address of the linux PC. All works well. > > I have a Windows PC on my LAN running IIS 5.0 which works well on my LAN but > I wish it to be available on the internet though the Linux box. Any one with > the instructions or point me to the right Documentation. I have googled to > my hearts content with no results. > > Thanks in advance. > > Regards > Leigh > > cc to leejen666@hotmail.com > > >
|
|
 | | From: | Durk van Veen | | Subject: | Re: Sharing web server to the internet | | Date: | Tue, 18 Jan 2005 21:58:45 -0800 |
|
|
 | pu wrote:
> I have a Windows PC on my LAN running IIS 5.0 which works well on my LAN > but I wish it to be available on the internet though the Linux box. Any > one with the instructions or point me to the right Documentation. I have > googled to my hearts content with no results. >
You do this using the PREROUTING and FORWARD chain in iptables on the Linux machine. See www.netfilter.org for a list of tutorials. Note that the IIS5-hosted website(s) cannot be available on port 80 because that one is already occupied by the webserver on the Linux box. So you'll use PREROUTING to send the requests for some other port - say port 81 - on the Linux machine to port 80 on the Win2K machine. You would then access the IIS sites using "http://###.###.###.###:81" (note the port number at the end of that URL).
If you truly wanted the IIS sites to show up as virtual hosts under the Linux system, you'll have to do a lot more work (none of which involves iptables). In that case it's more like having the server on the Linux machine explicitly forwarding the requests it gets on behalf of the IIS machine on port 80 to that machine, then supplying the results to the outside world. I haven't heard about any canned solutions for this, although I wouldn't be surprised if someone wrote something for it.
Durk
|
|
 | | From: | Vic | | Subject: | Re: Sharing web server to the internet | | Date: | Wed, 19 Jan 2005 19:31:52 +0000 (UTC) |
|
|
 | "Durk van Veen" wrote in message news:vHmHd.8517$nt.5323@fed1read06
> In that case it's more like having the server on the Linux > machine explicitly forwarding the requests it gets on behalf of the IIS > machine on port 80 to that machine, then supplying the results to the > outside world. I haven't heard about any canned solutions for this, > although I wouldn't be surprised if someone wrote something for it.
Take a look at the Apache ProxyPass and ProxyPassReverse directives. That pretty much covers what you're talking about.
Probably be better just to run the site on Apache on the L-box, though...
HTH
Vic.
-- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
|
|