Forum Moderators: phranque

Message Too Old, No Replies

From one port to another

Transfer incoming data from one port to another

         

Yukanojo

2:19 pm on Feb 1, 2005 (gmt 0)

10+ Year Member



Hi,
I'm trying to set up a website for use with external internet clients and I've run into a problem.

Originally, I set up this HTTP server for LAN access only with no plans to set it up for internet access. Now, I try to set it up and I learn that the ISP that services me blocks incoming port 80.

I need some program or something that would allow me to translate or transfer HTTP requests coming in on another port and translate it to port 80.

I tried setting up a secondary HTTP server using redirect, but that doesn't work. This needs to be sort of a HTTP proxy so that the client doesn't have any request to my website on port 80. The middleman makes all the requests and spits them back out on another port.

Of course my other option would be to reconfigure the entire website and webserver to use another port. This will cause me to run into a ton of problems. The website has many smaller user websites that are hosted on it that would require hours upon hours of reconfiguration for the new port, the database server would require reconfiguration, and the major problem is that the internet network has become dependant on this HTTP server running on port 80.

So in short, what I'm looking to do is have LAN clients request data on port 80, and internet clients request data on port, let's say, 1001.

Thanks ahead of time,
Yukanojo

supermanjnk

4:12 pm on Feb 1, 2005 (gmt 0)

10+ Year Member



If your isp is blocking port 80, then what you are using for a proxy will have to be on a connection that doesn't block port 80 (external).

unless you want to have your clients type in your url's like
widgets.com:1001

in which case if you are using apache, you will need to set it to listen on that port, and if you are behind a router set it to forward those ports to your internal IP

for the proxy it would basically be set to use port 1001 and it would make a request to your site via port 1001, then it would cahce the pages, and when someone requested your site widgets.com it would access the proxy on port 80 and the proxy would serve up the cached page.

honestly, in your situation, I think it would be better to get a hosting plan, and by better I mean cheaper.

Yukanojo

3:31 pm on Feb 2, 2005 (gmt 0)

10+ Year Member



Hosting plan is not an option. This server runs in a LAN/gaming center where people bring in their computers, and the games on those computers are not always up to date, so I set up this HTTP server to serve the update files and whatnot to them. It also does HTTP stats on the games and matches and whatnot which is what I want viewable by the web.

The costs to run a hosting plan for this HTTP server would be insurmountable considering the amount of uploading it does on the LAN only. In one day it pushes almost 3 GB of files to the users on the LAN. If I were to outsource the site I would be clogging up my internet connection and the bandwidth costs would be crazy.

All I want is as follows:

address for internal requests: www.website.com
address for external requests: www.website.com:1001

I'm thinking of setting up another instance of apache that runs on port 1001 and it just uses one of those web proxy systems.

andye

3:39 pm on Feb 2, 2005 (gmt 0)

10+ Year Member



So in short, what I'm looking to do is have LAN clients request data on port 80, and internet clients request data on port, let's say, 1001.

AFAIR you can tell a single instance of Apache to listen on more than one port.

Yes, here we are... from the Apache docs (google for 'apache docs'):


Listen directive
Syntax: Listen [IP-address:]port
Context: server config
Status: core
Compatibility: Listen is only available in Apache 1.1 and later.
The Listen directive instructs Apache to listen to more than one IP address or port; by default it responds to requests on all IP interfaces, but only on the port given by the Port directive.

Listen can be used instead of BindAddress and Port. It tells the server to accept incoming requests on the specified port or address-and-port combination. If the first format is used, with a port number only, the server listens to the given port on all interfaces, instead of the port given by the Port directive. If an IP address is given as well as a port, the server will listen on the given port and interface.
Note that you may still require a Port directive so that URLs that Apache generates that point to your server still work.

Multiple Listen directives may be used to specify a number of addresses and ports to listen to. The server will respond to requests from any of the listed addresses and ports.

For example, to make the server accept connections on both port 80 and port 8000, use:

Listen 80
Listen 8000
To make the server accept connections on two specified interfaces and port numbers, use
Listen 192.170.2.1:80
Listen 192.170.2.5:8000
See Also: DNS Issues
See Also: Setting which addresses and ports Apache uses
See Also: Known Bugs

Is that what you meant?

Best wishes, a.

supermanjnk

6:27 pm on Feb 2, 2005 (gmt 0)

10+ Year Member



that goes back to them having to type in like widgets.com:8000 to view it, default http port is 80, so that would work, as long as they know they have to add port 8000 to the url

vabtz

6:33 pm on Feb 2, 2005 (gmt 0)



=> RTFM

encyclo

6:42 pm on Feb 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld [webmasterworld.com], Yukanojo.

I learn that the ISP that services me blocks incoming port 80.

In that case, rather than trying to bypass things you should read up on your ISPs terms of service. It sounds like you are running your server on a residential-type connection, and if your ISP finds out - and a quick check of your inbound traffic volume will show the anomaly - you could get cut off without any warning or (depending on your contract) get a large backdated bill for misuse/overuse of the connection.

Most ISPs offer business connections which often don't cost much more than residential rates, and you can run servers on the correct ports without breaking your contract conditions.

Yukanojo

4:13 pm on Feb 6, 2005 (gmt 0)

10+ Year Member



That apache trick seems like a great idea. I went ahead and configured it to do so and now the service won't start.

I'm currently running apache version 2.0.52

andye

2:46 pm on Feb 7, 2005 (gmt 0)

10+ Year Member



Are there error messages in the logs?
a.

Yukanojo

4:36 pm on Feb 8, 2005 (gmt 0)

10+ Year Member



Aha, I think I figured out the issue.

Before I attempted this I tried running an instance of IIS 6.0's HTTP server on port 1001 and tried implementing a PHP based proxy avoidance system that would automatically retrieve the information on the apache server running on port 80. But because IIS is horrible IMHO I quickly gave up and forgot about it and I guess I left the service running.