Java News Tips Software
Java News Tips Software | Contact | Facebook | Twitter RSS

Change Apache Tomcat port 8080 to 80 or another port number

Change Apache Tomcat port 8080 to 80 or another port number. Whether it is Apache Tomcat 5 or Tomcat 6, by default Apache Tomcat runs on port 8080. But there can be situations where there are some other servers running on this same port forcing you to change the port of one of the servers. This article explains how to change this port 8080 on Tomcat (we tested this against Apache Tomcat 5.5 and 6.0 versions).

Here we’ll be using label to denote the folder where Tomcat is installed. In our systems, tomcat is installed in the following path.

We need to edit the file named server.xml inside \conf folder.

In the server.xml file; locate the following segment.

<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" … />

By changing this 8080 value of port attribute, server would start listening on new port number.

<Connector port="8081" … />

After saving the changed server.xml file, Tomcat server must be restarted (stop then start) to activate the change.

Related: How to change port 8080 in JBoss?

Labels: ,


  1. Anonymous Anonymous on January 07, 2009 12:37 PM  
  2. very long article )
  3. Anonymous Anonymous on March 28, 2009 1:00 AM  
    very long article!
  4. dear almas, if u say this is a long article then u might haven't seen long articles. this one is short n sweat....
  5. Anonymous Anonymous on June 26, 2009 10:19 PM  
    )) if you need setup 443 port it is more difficult + skype or other programms can block this port.
  6. Thank you very much...............
  7. i use another apache xampp by using default port which is 8080 then on the same time i also use apache tomcat with same port 8080. then when i run the apache tomcat, the server kill himself suddently. I already change the port to 8081 but the problem is still same. Please help me because I want to use apache xampp and tomcat at the same time.
  8. // xampp and tomcat ports conflict

    You may already know that you can not run two different applications on the same port. So you must change one of the ports other than 8080. So I guess you can easily change the Tomcat port 8080 to 8081 as explained above, and (re)start your Tomcat server. This will resolve your issue.

    Before starting xampp first check whether you have correctly changed the Tomcat port to 8081 using;
  9. thanks
  10. Anonymous Anonymous on December 17, 2009 4:04 AM  
    Hi, I have changed port and applications is working fine on 80 port. But when I try to reach website with localhost it still redirects me to localhost:8080/app, and if I want to see my website I must write localhost/app.

    Maybe you know how to fix this? Thanks in advance!
  11. Thank a lot !!!
  12. Anonymous Anonymous on March 25, 2010 10:00 AM  
  13. Anonymous Anonymous on May 06, 2010 9:44 AM  
  14. Thank you ..
  15. Thanks
  16. Hello, i need to change the tomcat port number in Sandbox{test Server]from 8080 to 80 .. it accepts all port number(Ex 8045) but not 80. pls Help me........
  17. Anonymous Anonymous on February 25, 2011 4:25 PM  
  18. Anonymous Anonymous on May 05, 2011 9:11 PM  
    thanx a lot...
  19. Anonymous Anonymous on June 27, 2011 1:43 PM  
  20. thanks.... lol :D
  21. thank you soooo much
  22. thanks a lot this was really helpful
  23. Anonymous Anonymous on May 30, 2012 10:39 PM  
    I can't change the port no to any no.This is because when i save it says access denied. It says i dun have the right to change...Why is this happen???
  24. hi dear,
    thanks for give the information.....
    my tomcat not working in one day.after change the port id its working fine...
    thanks a lot.

  25. hi dear,
    this more helpful.bcoz i loss oneday to solve the error in tomcat.i change port id,now working fine.
    thanks a lot...

  26. @23
    Seems you only have read only access to the file you are trying to modify. You can try to get help from your sysadmin and ask for access.
  27. @25
    It's nice to hear that this helped you; thanks for the encouragement.

    I would like to request you to subscribe to our email updates or via fb (
  28. Thanks for the post ...
  29. thanks
Page Views :
Email :
Select Month:
Free counter and web stats