cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to bind to port

jimderouin
Champ in-the-making
Champ in-the-making
During installation of Community as root user on Ubuntu 12.04, I get error Warning: Unable to bind to the given port number. Please select another Tomcat Server Port when setting up Tomcat AJP Port 8009.  This port is not being used by another service.  I tried lots of other ports and got the same error.
7 REPLIES 7

patil
Champ on-the-rise
Champ on-the-rise
Complete the installation and then try chngeing ajp port to something else in conf folder of tomcat and restart server.

jimderouin
Champ in-the-making
Champ in-the-making
Installation will not continue without this being accepted.  Don't know how to skip this step.

jimderouin
Champ in-the-making
Champ in-the-making
I found zip file and will try manual install

eswbitto
Confirmed Champ
Confirmed Champ
I'm not sure if the following command  will work on ubuntu, but it works on CentOS.


netstat -tulpn


That should give you a list of ports and what PID's are using them.

willeckeit
Champ in-the-making
Champ in-the-making
The error message is missleading at this point.
I was running in the same "problem" on a server with an exiting plesk/tomcat installation where nothing was listening on 8009 as well.

In fact the error message must not only refer to AJP port (which is the last one you entered).
It refers to the block of tomcat ports (server port, shutdown port, ssl port and ajp port).
If one of these is used already you get the "Unable to bind to the given port number.".

So you should check the whole range here.
In my scenario I simply moved all tomcat ports into the range of 9080,9005,9443, 9009 and passed this installation step.

Best
Marc


Thanks to You all, it worked fine for me! Alfresco 5.1 with Ubuntu LTS 14.04 😉

jpmmahon
Champ in-the-making
Champ in-the-making

I had the same problem when trying to upgrade Alfresco to the latest version. In my case the java process was still running and owned the port numbers. Killing the process released the port numbers.

Use ESWBitto _'s suggestion and grep for the port numbers. See what I got below


root@la01:/opt# netstat -tulpn | grep 8080
tcp6 0 0 :::8080 :::* LISTEN 12099/java

root@la01:/opt# netstat -tulpn | grep 8005
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 12099/java

root@la01:/opt# netstat -tulpn | grep 8443
tcp6 0 0 :::8443 :::* LISTEN 12099/java

root@la01:/opt# netstat -tulpn | grep 8009
tcp6 0 0 :::8009 :::* LISTEN 12099/java

For some reason process 12099 was still running. I killed it and the ports were released.

I hope this helps.
Cheers
John