easiest way to find port number

Hi,

what is easiest way to find port number on various webservers like tomcat, application servers like weblogic, websphere,boss etc where the applications are running. please advise
LVL 7
gudii9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JohnBusiness Consultant (Owner)Commented:
Consider running TCP View (Sys Internals from Microsoft) . It will do what you want quite nicely.
0
Dave BaldwinFixer of ProblemsCommented:
If you are on Windows (and on the server), TCPView https://technet.microsoft.com/en-us/library/bb897437.aspx will tell you what ports are in use by what applications.  It is based on the 'netstat' command line program which is also available on Linux.  https://en.wikipedia.org/wiki/Netstat
0
CEHJCommented:
Actually there's no need to install anything. netstat alone will tell you what you need to know
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

rrzCommented:
If you want to find it within your program, then you could use
int port = request.getLocalPort();

Open in new window

in a Servlet or in a scriptlet. In a JSP expression, use
<%=request.getLocalPort()%>

Open in new window

or in JSP text use
${pageContext.request.localPort}

Open in new window

0
gudii9Author Commented:
netstat alone will tell you what you need to know
what is netstat and how to know using that.

I do not want to write a program to know. Different servers has different places to go to find it. For example in websphere i have to drill down to
C:/ProgramFiles/IBM/..../profile.txt i think has the port number which says like 9080.  some servers after starting i have to go to admin console some place to see for tomcat i think. So is there is a link or place which tells where to go to find for specific server to find the port number. Remember port numbers could change also over period of time so i may want to to check it time to time as well.

when i opened cmd on my windows laptop and typed netstat i saw like (no port numbers here?)
  TCP    199.118.0.188:111111    upload-lb:https        ESTABLISHED
0
Dave BaldwinFixer of ProblemsCommented:
'https' means port 443.  'netstat' and TCPview will use names for 'well known' ports unless you tell them not to.
0
CEHJCommented:
what is netstat and how to know using that.

Documentation on netstat is not hard to find:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/netstat.mspx
0
gudii9Author Commented:
C:/ProgramFiles/IBM/..../profile.txt

i forgot the path today.

Other day i was able to open profile.txt.

can you please advise complete path?

when i search under IBM with profile.txt nothing shows up.

i searched under IBM folder with profiles.txt that also did not work.

please advise
0
gudii9Author Commented:
C:\Program Files \IBM\WebSphere\AppServer8\profiles\DevelopmentServerProfile
under that i do not see profile.txt though. I remember seeing that earlier. i forgot the path now. please advise
0
CEHJCommented:
Why not just do a global search for the file?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gudii9Author Commented:
not able t find with that.
0
gudii9Author Commented:
I finally found it. I was looking with wrong file name
C:\Program Files\IBM\WebSphere\AppServer8\profiles\TestServerProfile\logs\AboutThisProfile.txt

In above file i see all good stuff like below

Application server environment to create:
Location:
Disk space required:
Profile name:
Make this profile the default:
Node name:
Host name:
Enable administrative security (recommended):
Administrative console port:
Administrative console secure port:
HTTP transport port:
HTTPS transport port:
Bootstrap port:
SOAP connector port:
Run application server as a service:
Create a Web server definition:
Performance tuning setting:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.