The OpenIndiana repositories at the time of this writing include Tomcat 6, but not Tomcat 7. It may be available as a package in other repositories that I don't know about, but I didn't really look because I wanted to use the same version of Tomcat 7, from the exact same zip file, that I use when developing our web applications.
This page uses Tomcat version 7.0.28. Your version will more than likely vary. Please adjust your paths accordingly.
1.) Download Tomcat 7 from the Apache Tomcat website: https://tomcat.apache.org/download-70.cgi I took the very first item, under Core, which gave me apache-tomcat-7.0.28.zip
2.) Tomcat 6, from the package included in the OpenIndiana repository, splits the files into two directories. I mimic this, so make the following directories:
# mkdir /usr/tomcat7
# mkdir /var/tomcat7
3.) Copy your zip file to /usr/tomcat, and unpack it. I used a GUI, so no CLI for this. Sorry.
# cp apache-tomcat-7.0.28.zip /usr/tomcat7/
# cd /usr/tomcat7
# unzip apache-tomcat-7.0.28.zip
That left me with a directory structure of "/usr/tomcat7/apache-tomcat-7.0.28".
4.) Leave bin, lib, and all the miscellaneous loose files where they are. Move everything else to /var/tomcat7.
# cd /usr/tomcat7/apache-tomcat-7.0.28
# mv conf /var/tomcat7/
# mv logs /var/tomcat7/
# mv temp /var/tomcat7/
# mv webapps /var/tomcat7/
# mv work /var/tomcat7/
5.) Create the catalina.out log file:
# touch /var/tomcat7/logs/catalina.out
6.) Change the ownership of the files to mimic Tomcat 6.
File permissions has always been a weak area for me, no matter how much I read about them. This seemed to work for me:
# chown -R root:bin /usr/tomcat7
# chown root:bin /var/tomcat7
"cd" into your /var/tomcat7 directory.
# cd /var/tomcat7
# chown -R webservd:webservd *
# chmod 40755 logs
# chmod 40755 temp
"cd" into your bin directory. Make everything executable:
# cd /usr/tomcat7/apache-tomcat-7.0.28/bin
# chmod +x *
7.) Below is the method file that I modified from Tomcat 6 to work for Tomcat 7. Put it in /lib/svc/method, and make it executable.
# chmod +x /lib/svc/method/http-tomcat7
8.) If you are using a different version than 7.0.28, go into that method file and change your CLASSPATH accordingly.
9.) Below is the manifest file that I modified from Tomcat 6 to work for Tomcat 7. Put it in /lib/svc/manifest/network.
10.) Import the service manifest file:
# svccfg import /lib/svc/manifest/network/http-tomcat7.xml
11.) Try to start the service:
# svcadm enable tomcat7
12.) Verify and/or troubleshoot it with:
# svcs -xv tomcat7
13.) Open a web browser, and type in "http://localhost:8080/" and press [Enter]. You should see the Tomcat 7 welcome page.
14.) Configure and secure your server as needed.
Note: If you are going to set up SSL in your Tomcat installation, you will need to define port 8443 (or whatever else you choose) in your /etc/services file:
https-alt 8443/tcp webcache # HTTPS Alternate, webcache
If you would like to do this at the command line, you can do it like this:
# echo 'https-alt 8443/tcp webcache # HTTPS Alternate, webcache' >> /etc/services
# echo 'https-alt 8443/udp' >> /etc/services
I hope it helps!