...
The directory structure will be as follows,
/opt/ apache - root directory for Tomcat and any other Apache productsall our applications and services (anything custom if possible should be here)
/opt/apache/0fs-tomcat - directory for Tomcat1 Tomcat running on port 8180
/opt/apache/0fs-tomcat/java - directory we will place java for Tomcat1
/opt/apache/tomcat.2 - directory for Tomcat2
/opt/apache/tomcat.2/java - directory we will place java for Tomcat2 running on port 8280
Tomcat
First step, create the apache directory under opt,
...
Code Block | ||
---|---|---|
| ||
su - serveradmin
cd ~
tar -xvpf apache-tomcat-6.0.20.tar.gz # All the permissions will be kept
mv ./apache-tomcat-6.0.20/ ./0fs-tomcat/
# This will be Tomcat1
exit # Switch back to your staff account |
...
Setting up and running Tomcat with serveradmin has the advantage that you can manage the Application server without having to go into root. We want to ensure that only serveradmin starts Tomcat to prevent any issues with permissions. For example, once you start Tomcat1 as Tomcat as root you may find that log files spawned from that startup can no longer be managed by serveradmin. Also, by running Tomcat1s Tomcat as serveradmin rather than root is safer from a security standpoint.
...
Code Block |
---|
su - serveradmin |
Modify Tomcat1Tomcat's /opt/apache/0fs-tomcat/bin/startup.sh and opt/apache/0fs-tomcat/bin/shutdown.sh to only allow serveradmin to start and stop Tomcat.
...