You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

Running Tomcat on Sun Solaris 10

Solaris 10 comes pre installed with a Tomcat 5.5 installation.

Having found little information on the setup I decided to contribute what little usefull things I found here

THE ENVIRONMENT

The following assumes you have Java already installed. java is usally installed in /usr/java. This is a symbolic link from the actuall installation in /usr/jdk/jdk1.6.0_[Update]

THE PROBLEM

Solaris comes with apache and tomcat preinstalled, just not in the locations you would expect unless your familar with Solaris. Solaris 10 comes with a new method for starting and stopping services on system startup, called SMF(Service Management Facility).

Software installation directory

/usr/apache/tomcat55

Configuration, logs, and deployed applications (webapps directory)

/var/apache/tomcat55

If you where to run multiple instances of tomcat your would want to duplicate the whole /var/apache/tomcat55 directory, create new startup.sh shutdown.sh scripts setting a CATALINA_BASE enviroment variable pointing to your new instance.

Configuring SMF to start and stop tomcat

Create file in the following location. (The location does not really matter but the convention says so.)

/var/svc/manifest/application/web/tomcat.xml

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
    Copyright 2010 Avinor AS.  All rights reserved.
    tomcat_svr.xml : Tomcat service  manifest, Daniel Berg
-->

<service_bundle type='manifest' name='Tomcat55'>
<service name='application/web/tomcat' type='service' version='1'>

   <single_instance />

   <exec_method 
      type='method' 
      name='start'
      exec='/usr/apache/tomcat55/bin/startup.sh'
      timeout_seconds='30' />

   <exec_method 
      type='method' 
      name='stop'
      exec='/usr/apache/tomcat55/bin/shutdown.sh'
      timeout_seconds='30' />

   <instance name='default' enabled='false' />

   <stability value='Unstable' />

   <template>
      <common_name>
         <loctext xml:lang='C'>Apache Tomcat 5.5.27</loctext>
      </common_name>
      <documentation>
         <manpage title='tomcat' section='1' manpath='/usr/man' />
      </documentation>
   </template>

</service>
</service_bundle>

  • No labels