The best way to resolve the port issue is to find an alternative unused port and map it to the application. This is more to do with the design of the application. As an example if port 80 is already in use by a web application then one can choose 8080 for another web application.
There may be other design points to be considered before a port is assigned to an application.
There may be other design points to be considered before a port is assigned to an application.
This is almost an understatement. A few things to take into consideration:
Jayadev-
I am not sure if your example of choosing port 8080 for another "web application" is a great example, because web servers support name-based virtualhosting. For example in Apache "name-based virtual hosting, the server relies on the client to report the hostname as part of the HTTP headers. Using this technique, many different hosts can share the same IP address."
Here is an example name-based virtual config from the Apache site:
<VirtualHost *:80> # This first-listed virtual host is also the default for *:80 ServerName www.example.com ServerAlias example.com DocumentRoot "/www/domain" </VirtualHost> <VirtualHost *:80> ServerName other.example.com DocumentRoot "/www/otherdomain" </VirtualHost>
Regards,
Jamie Ian Fargen
You don't give us any background info on the issue so I will try and shoot in the blind and give you some idea in different context:
It is a good thing that you know you have a port conflict issue. If not yet, comb through the relevant logs and you will see the port binding error as clear as crystal.
How to resolve it?
- If you wanna find out the port in question is being used by which program:
# netstat -anp | grep <port_number> | grep LISTEN
E.g # netstat -anp | grep 8080| grep LISTEN
-a for all, -n for numeric and -p for program using the port
OR
# lsof -i :<port_number>
E.g # lsof -i :8080
-i for internet address and port stuff
And fix the application or shut the App down (or KILL if you must) if you need to own the port :)
Hope this helps.
Regards,
Will
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.