can't we create multiple instances of tomcat7 in ubuntu?

Hi, I created duplicate instance of tomcat by creating a directory under /var/lib/tomcat7-a. Later i updated server.xml with new port i copied file and web.xml.

finally created init service for tomcat7-a and updated with defaults. I tried to start the program when i pose a command like, service tomcat7-a start it gives “tomcat7-a not installed” means, it stops at below script in init program, if [ ! -f “$CATALINA_HOME/bin/bootstrap.jar” ]; then log_failure_msg “$NAME is not installed… kjfkdj” exit 1 fi

what should i do now?


I configured the $ cd /var/lib/ $ sudo mkdir tomcat7-a $ cd /var/lib/tomcat7-a $ sudo mkdir conf temp webapps work logs $ sudo mkdir conf temp webapps work logs $ cd …

$ sudo chown -R tomcat7:tomcat7 tomcat7-a $ sudo ln- s /var/lib/tomcat7/conf/ /var/lib/tomcat7-a/conf

$ sudo ln- s /var/lib/tomcat7/conf/web.xml /var/lib/tomcat7-a/conf

$ sudo ln- s /var/lib/tomcat7/conf/policy.d/ /var/lib/tomcat7-a/conf

$ sudo cp /var/lib/tomcat7/conf/server.xml /var/lib/tomcat7-a/conf/

–>changed the port 8080 to 8081 in tomcat7-a server.xml $ cd /etc/init.d/ $ sudo cp tomcat7 tomcat7-a

DESC=”Tomcat servlet engine” CATALINA_BASE=/var/lib/$NAME CATALINA_PID=”/var/run/$” $ sudo service tomcat7-a start

$ sudo update -rc.d tomcat7-a defaults

Now, when i try to start the new instance it kicks with an error like above what i mentioned. Now i changed the CATALINA_BASE=/var/lib/tomcat7-a and CATALINA_HOME=/usr/share/tomcat7 in new instance init config.

Now it is starting when i use service tomcat7-a start. But when i go to browser it kicks an error like, http://localhost:8081/ Failed to load resource: the server responded with a status of 404 (Not Found)

am i did anything wrong in config? ratherthan displaying tomcat manager page it displaying blank screen… when i go to console i see this error.

In your case, note that $CATALINA_BASE should be different from $CATALINA_HOME, where the former is where you created your instance and the latter is where tomcat7 is installed. Usually, $CATALINA_HOME is installed in /usr/share/tomcat7 on Ubuntu.

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

i have same problem right now

Hi Jaccs

Were you able to fix the issue. I followed the same instructions but now facing following issue:

root@XXXXX:/etc/init.d# sudo service tomcat8-a start Failed to start tomcat8-a.service: Unit tomcat8-a.service not found. root@XXXXX:/etc/init.d#