• Running Tomcat from a shell script
Skip to end of metadata
Go to start of metadata

Here's a method for managing Tomcat for PAS-Portal development using Unix shell scripts instead of Eclipse.

This is based on the work that Cynick documented in the How to install the portal for development purposes wiki page - unfortunately it was erased after v2 of that page. I have modified it slightly and re-posted it here.

  1. Download the attached file: mytomcat.sh and put it somewhere on your path
  2. make mytomcat.sh executable: chmod u+x mytomcat.sh
  3. Make all the .sh files in CATALINA_HOME/bin executable: chmod u+x *.sh
  4. Either create CATALINA_BASE, CATALINA_HOME, and JAVA_HOME variables with the proper file paths in a shell startup script (ex: .profle, .bash_profile) or add them to the beginning of the mytomcat.sh script.
  5. Copy the conf directory from the unpacked tomcat distribution to where you've defined your CATALINA_BASE.
  6. Create the following directories under your CATALINA_BASE: logs, temp, webapps, work.

Now you can do the following:




Which should respond with something like this *:




*from a MacOS 10.4.11 system

The default Tomcat install should now be running at: http://127.0.0.1:8080

The mytomcat.sh script supplies the following functions:

  • start: start the tomcat server
  • stop: start the tomcat server in debug mode
  • restart: stop and then start the tomcat server
  • killall: terminate the tomcat processes
  • status: display status information about running tomcat processes

file: mytomcat.sh





  • No labels

1 Comment

  1. Anonymous

    it doesn't work well for CATALINA_BASE Multiple Tomcat 4 Instances