Tomcat6 Installation Failing

February 6, 2015 563 views

Hi, I have a problem in installing apache tomcat6 in this Doplet, Am following the same procedure as i did in other server (Plesk) but when i open on browser ( shows web not available. When i invoke command to see services and port used i see port 8080 used by mysqld and port 80 used by java. How can i rectify the issue in order to use port 8080 without affecting server.

1 Answer

As the error indicates, a port can only be used by a single application at once. In order to resolve the problem, you'll need to change the port number for one or the other. To change the port that Tomcat is listening on, edit your server.xml and find the "Connector" section. On Ubuntu, the configuration file can be found at /etc/tomcat7/server.xml (edit the version number as needed). It should look like:

    <Connector port="8080" protocol="HTTP/1.1" 
           redirectPort="8443" />

Change 8080 to a different number and restart Tomcat for the changes to take effect.

Though, it is unusual that MySql is listening on port 8080. By default, it listens on port 3306. If you'd like to adjust the port that it is running on, edit the file /etc/mysql/my.conf and change the port number in this section:

# * Basic Settings
user            = mysql
pid-file        = /var/run/mysqld/
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql

Again, remember to restart MySql for the changes to take effect.

For more information on getting Tomcat up and running on Ubuntu check out:

by Mitchell Anicas
Apache Tomcat is a web server and servlet container that is used to serve Java applications. Tomcat is an open source implementation of the Java Servlet and JavaServer Pages technologies, released by the Apache Software Foundation. This tutorial covers the basic installation and some configuration of Tomcat 7.0.x on Ubuntu 14.04.
Have another answer? Share your knowledge.