Re: What Port Should I Use?



Dan N wrote:
On Thu, 14 Feb 2008 21:30:23 -0600, Moe Trin wrote:

You can use any port you wish to. You need only live with the
consequences.

That's really the crux of the matter, isn't it.

If I start up my server using a port in the dynamic/private range then I
run the risk that the port is already in use by some client on the same
host. When the client started, the tcp stack would have dynamically
assigned it a port and that just might be the one that I want my server to
listen on. So this doesn't seem like a good option.

Yet it is common practice. Cases in point; JBoss - the default distribution uses a bunch of ports at the start of the dynamic range - another is apache which is commonly configured to run on port 8080 instead of port 80.
But as these are servers they are usually started when the host starts so they will be first to lay claim to these port numbers.

> This leaves me with
ports in the well known or registered ranges.

You could use a port under 1024, as long as it is free - as in not to be used by any other service you might need to start on the host.

But if I want to adhere to standards what port do I use? IANA says that
the well known and registered ports shouldn't be used without
registration. And my server is using a proprietary protocol that I
really don't have any need to register.

As was pointed out; you do not need to.
"The purpose of port registration is to allow others to have some clue where
to connect to your server to find what-ever service you may want to be
providing."

The only choice I seem to have is to not adhere to standards. The
conclusion I've come to is to use a port somewhere in the registered
range.

Maybe you should start smaller.
Run up apache. See that you can connect on port 80.
Reconfigure apache to listen on port 8080
reload apache (or stop and start).
See that you can connect on port 8080.

Decide if it is 'bad' that apache is now listening on port 8080.
.



Relevant Pages

  • Hacker problem...Takes down apache?
    ... It seems to be doing *something* to break Apache in an attempt ... When connecting to port 80 on the web server with a web browser a "page ... However sockstat still shows httpd listening on port ...
    (freebsd-questions)
  • RE: Some technical errors
    ... If the SMTP server is not running on port 25 TCP it is not a public ... Manager - Computer Assurance Services BDO Chartered Accountants & ...
    (Security-Basics)
  • Re: still having problems contacting the apache server
    ... I think I have narrowed this down to a port issue is there a way to actually change the port with in Apache. ... Firefox can't establish a connection to the server at pilotalk.dyndns.biz. ...
    (Fedora)
  • Re: Rogue PHP file
    ... Of course none of them will admit to installing Apache ... used by another program" I ran netstat -ano and found Apache on port 80. ... are not running a public web server on your SBS (and you should NOT ...
    (microsoft.public.windows.server.sbs)
  • Re: Rogue PHP file
    ... Of course none of them will admit to installing Apache ... are not running a public web server on your SBS (and you should NOT ... then close port 80 to your SBS. ...
    (microsoft.public.windows.server.sbs)