I currently have a small socket server that I'm trying to convert to a web server. Basically it dumps XML to anyone connecting to it. At the moment, it's not a web server as it listens to a non-web port (1337).
I know that both 80 and 8080 are accepted web ports, but none of those are free on the machine I'm going to use. Are there any other web ports available? Or how do I configure a windows machine so that e.g. port 1337 is web?
Well for the most simplistic method append :port to your URL such as http://192.168.1.1:1337
I may be misunderstanding your question though.
You just start listening on the port. Viola. It's a server. That simple.
Oh, and you have to tell your audience which port to use.
To be more complete: it's a web server not because of the port, but because of the language spoken on that port. You can serve HTTP over any port, which is one of the ways back-door-style malware gets around misconfigured firewalls.
What you probably need is to implement (in order to implement an easily usable web service, which I assume is what you are aiming for) the http protocol and probably SOAP or REST, not select a port number. Tell us what language you are using, and we might be able to suggest a suitable framework.
What #fictoris said. Or setup your webserver to redirect http://myapp.com to the correct port as well.
There's nothing really magic about the ports you are talking about. And really it's just port 80 that's standard HTTP. 443 is the standard for secure HTTP though (HTTPS).
If you have to run on a non-standard port you must specify that port in every (non-relative) URL: http://localhost:13828 ...
If you need to use port 80 you might be able to redirect the incoming client depending on what demain it requested though.
Here is a list of all the TCP/UDP ports that have official designations and the hi-jacked, oh I mean unofficial ports that are known. Hopefully that will give you an idea of what is going on "out there."
Note the "Dynamic, private or ephemeral ports: 49152–65535" section at the bottom.
Related
My provider is Ask4 and they only provide 1:1 NAT which opens ports 22 and all above 1024. No UPnP. However, I want to use ports 80 and 443 for a web server.
Is there a way without changing those ports to host a web server?
Can SSH Dynamic port forwarding or Proxies/Tunnelling software help me with this?
I want to avoid VPNs as they tend to be a slower solution. The more responsive the better.
Thanks!
For me, i looked into it further and after a couple of days found that a reverse proxy was the best.
It works by running on one server running apache, nginx, etc and then basically sending that traffic to the designated IP. You can also select a port!
I have a web page to control a thermostat on a raspberry pi, and I'm running into difficulties when trying to get websockets to work from a remote client. It seems to work fine when on LAN however. I'm obviously missing something (and likely something basic), but I can't seem to figure out what it is.
The pi's local ip is 192.168.1.134. The web page (served from apache server) has the URL http://192.168.1.134:8010/thermostat.html. The page starts up some javascript, which then tries to connect to the pi's main program using websockets via ws://192.168.1.134:9000. (the server on the pi is running libwebsockets). The websocket comes up, and it seems to work fine. I then tried to connect via a remote client (a cell phone, where wifi was turned off) from http:\\23.239.99.99:8010\thermostat.html. The html/js files load fine, but the web socket attempts to connect to uri ws:\\23.239.99.99:9000, and this fials.
As far as I can tell, the NAT seems to be configured properly:
name ext ext protocol int int ip addr interface
port port port port
start end start end
Thermostat3 8010 8010 TCP 8010 8010 192.168.1.134 eth3.1
Thermostat5 8000 8000 TCP/UDP 80 80 192.168.1.134 eth3.1
Thermostat_ws 9000 9000 TCP/UDP 9000 9000 192.168.1.134 eth3.1
I checked, and the router does not have any firewalls set up, neither does my modem. I didn't install a firewall on the pi (I checked, and there's no odd iptables rule). Does anyone know what I'm missing?
--- EDIT ---
I'm still stuck on this. I called my ISP and they assure me there are no firewalls on their servers. Is there any way to tell if port 9000 is being blocked, and by who?
Bind your apache server to 0.0.0.0 address to make it accessible from remote machines
Try this tool to determine if the port is inaccessible (use the custom port): http://www.whatsmyip.org/port-scanner/
Everything else looks fine. As a sanity check I would try putting the ws port to 8010 to see if that works. I would also recommend using a tool like Advanced Web Client to isolate networking issues.
This is interesting. I once had a similar problem. I set up a WebSocket (I was using a nodejs ws) and once I tried to access it from remote client I was not able to reach it with ws://yourip:port but instead I had to use http://yourip:port. I don't know if you have the same problem, mine was due to a proxy I was using.
I still have an advice for you how you might be able to solve your problem. I don't know how concerned you are about security but as far as I understood your idea you basically connect to your raspberry pi through a WebSocket and tell it to change the temperature.
Back when did a similar project I found it rather hard to secure my WebSocket connection. I was basically sending a password plus command through the WebSocket to my server which then checks wether the password is correct. Otherwise everyone on the internet could heat your house. Not cool...
But therefore, I had to tunnel the connection through https to prevent a middleware attack.
I quickly threw the towel and decided to go with a completely different solution. Basically I set up a nodejs express server (can easily be configured with a self signed certificate to use https or used behind a nginx/apache https server) and authenticated with username and password. When someone made a POST request to /api/thermostats?id=0 with a temperature request, the server checks if the user is authenticated and then executes a terminal command from within node.
Maybe this idea also fits your demands.
So I have what I thought was a simple need... I want to take URL's for a domain... something like myapp.somedomain.com and forward it to a web farm (two web servers) sitting behind an ARR proxy. Simple enough if everything is running on port 80. But if I want to say route all the requests to the web farm on port 8080 instead.. well, I'm missing something.
I have the farm define, I have load balancing configured for weighted round robin. I also have a URL rewrite rule that properly detects the domain in question and can forwards to the 'default' port of 80 on the web far. And despite adding the port to the rewrite URI, I can't get it to go to the proper port.
Any tips for the missing piece to this puzzle?
PS - entire "farm" is running in Windows Azure, but that shouldn't be relevant.
when you create the farm you will specify the host\address; below click on advanced and change the ports to the desired destination ports.
This is a "Blocked Port 80" related question, but maybe something a bit unique. I've yet to find a good answer. It's more academic than anything as I know running a production server at your house is a ridiculous idea.
I'm running a development server (LAMP) at my home but my ISP blocks port 80. The DNS for my domain is set up to "URL Redirect" to my IP and port number. My router is port-forwarding to my server, and I have Apache set up so it's listening on port 8081.
The issue is that when you access the domain, the URL in the browser is resolved from my domain name to the IP and port number, and is displayed as such. For example, you type "www.banana.com" into the browser, the site is displayed but now the URL is shown as "12.23.456.11:8081".
Is there any way to fix this so that the domain name does not become IP and port number?
Can you use Apache proxy functionality somehow?
Could you use mod_rewrite to change the IP and port number back to the domain name?
Thanks in advance!
This question has three parts. First the issue of the domain: in order to substitute a domain name in place of an IP address you need some name server that can map your desired name to an address. This is at the host level and not the port level so a domain name will encompass all ports you might host from it. If you are using your home Internet connection (which I suspect you are since you talk about a blocked port) then you need to take into account that from time to time your public IP address can change. Your options are to pay for (or request) a static IP from your ISP or use a dynamic DNS service that can rapidly update their records as your IP address changes.
As for your port number. Mod_rewrite only handles the path part of a URL, for using different ports internally you want mod_proxy. The Apache web sever with mod_proxy would be configured to listen on the public port you want (that I assume is port 80) then mod_proxy would take incoming requests and send them to another web server on a different port (or even different server). To the outside user this happens invisibly. The problem is if your ISP wont let you host your site on port 80 then it logically won't let you proxy from port 80. To get around this would be a little harder. Personally I would look at a virtualized server from people like Rackspace or Linode. You would get (for relatively little money) a fully configurable server on the open Internet with no restrictions on port usage and a static IP. Even better if you mess something up you can just virtually delete your server and start over with a fresh OS image.
Finally the clean URLs your question title suggests. It's possible this wasn't part of your actual question but just in case, mod_rewrite is a smart module that can let you map clean URLs like /cars/Toyota/1997 and turn them into more ugly requests like /cars.php?make=Toyota&year=1997. Clean URLs not only look better they make it easier to reorganize web code behind the scenes as your web site evolves.
One last thing, and its amazing to me that this question has gone so long without even a comment about this but, this question is really not a good fit for StackOverflow. Possibly ServerFault.com. Good luck! :)
Does anyone know how (or even if it's possible) to change the port on a Billion BiPac 7800NXL?
I can't find anything about it in the documentation or web management.
I want to be able to forward port 80 through to a machine on my network, but it doesn't seem to allow me to do that.
It appears you can forward port 80 without having to change the management port, any external requests to the port are forwarded through and internal requests are redirected through to the web management.
A dyndns on the external IP always seems to redirect through to the correct machine, even from the internal network.