TOMCA click multiple instances (tomcat2 instance)
tomcat installation
1. Prepare the basic environment of tomcat, I created a tomcat environment myself (convenient management)
[root@DB ~]# ls
tomcat
[root@DB ~]# cd tomcat/
[root@DB tomcat]# ls
apache-tomcat-7.0.47.tar.gz jdk-8u20-linux-x64.rpm
The two software packages in the above code block are the necessary packages for us to build tomcat
Two, start to deploy tomcat environment
1, install jdk
[root@DB tomcat]# rpm -ivh jdk-8u20-linux-x64.rpm
2. Write environment variables, increase at the bottom of the file
[root@DB tomcat]# vim /etc/profile
Add the following three lines:
export JAVA_HOME=/usr/java/jdk1.8.0_20
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
Make environment variables take effect:
[root@DB tomcat]# source /etc/profile
Use the command to check that the java installation version is correct:
[root@DB tomcat]# java -version
3. Install tomcat (install tomcat1 and tomcat2)
1. Install tomcat1
[root@DB tomcat]# tar xf apache-tomcat-7.0.47.tar.gz
[root@DB tomcat]# mv apache-tomcat-7.0.47 /opt/tomcat1
2. Install tomcat2
[root@DB tomcat]# tar xf apache-tomcat-7.0.47.tar.gz
[root@DB tomcat]# mv apache-tomcat-7.0.47 /opt/tomcat2
3. The tomcat1 configuration file and the home page remain unchanged, and tomcat2 can be
changed. The configuration file is changed to avoid port conflicts, and the home page is changed to see the obvious effect.
Modify the configuration file
[root@DB tomcat]# vim /opt/tomcat2/conf/server.xml
Modify tomcat homepage
[root@DB tomcat]# vim /opt/tomcat2/webapps/ROOT/index.jsp
Fourth, start tomcat1 and tomcat2
[root@DB tomcat]# /opt/tomcat1/bin/startup.sh
[root@DB tomcat]# /opt/tomcat2/bin/startup.sh
Five, browser test