1. Software Preparation:
JDK Download: http://www.oracle.com
Tomcat Download: http://tomcat.apache.org/
2. Deploy the Java environment:
Mkdir-p/application/tools/&& cd/application/tools/tar xf jdk-8u60-linux-x64.tar.gz-c/application /-s/application/jdk1.8.0_60/application/'$a export java_home=/application/jdk\ Nexport path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH \nexport classpath=. $CLASSPATH: $JAVA _home/lib: $JAVA _home/jre /lib: $JAVA _home/lib/tools.jar' /etc//etc/profile
View Code
[[email protected] ~]# Java-versionjava version "1.8.0_60" Java (TM) SE Runtime Environment (build 1.8.0_60-b27) Java HOTSPO T (TM) 64-bit Server VM (build 25.60-b23, Mixed mode)
3. Install Tomcat:
Tar XF apache-tomcat-8.0.27.tar.gz-c/application/-s/application/apache-tomcat-8.0.27/application/ 'export tomcat_home=/application/tomcat'>>/etc//etc/-R root.root/application/jdk//application/tomcat/
View Code
[Email protected] ~]# tail-4/etc/profileexport java_home=/application/jdkexport path= $JAVA _home/bin: $JAVA _home/jre /bin: $PATHexport classpath=. $CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/lib: $JAVA _home/lib/tools.jarexport tomcat_ Home=/application/tomcat
4. Tomcat Directory:
[Email protected] ~]# cd/application/tomcat/[[email protected] tomcat]# tree-l 1.├──bin #→ used to start, Scripts that turn off Tomcat or other features (. bat files and. sh files) ├──conf #→ to configure the XML and DTD files for Tomcat ├──lib #→ store the jar packages that the Web app can access ├──license├──logs log files for #→catalina and other Web applications ├──notice├──release-notes├──running.txt├──temp #→ temporary files ├──webapps # →web application root └──work #→ used to produce a. Java and. class file with a JSP-compiled servlet 7 directories, 4 Files[[email protected] tomcat]# CD Webapps/[[email protected] webapps]# lltotal 20drwxr-xr-x root root 4096 Oct 5 12:09 docs #→tomcat Help documentation DRWXR-XR -X 6 root root 4096 Oct 5 12:09 Examples #→web application instance Drwxr-xr-x 5 root root 4096 Oct 5 12:09 Host-manager #→ Management drwxr-xr-x 5 root root 4096 Oct 5 12:09 manager #→ Management drwxr-xr-x 3 root root 4096 Oct 5 12:09 R OOT #→ Default Web site root directory
5. Start Tomcat:
#→ Startup program/application/tomcat/bin/startup.sh
#→ Closing the program/application/tomcat/bin/shutdown.sh
[Email protected] ~]#/application/tomcat/bin/startup.shusing catalina_base:/application/tomcatusing CATALINA_HOME :/application/tomcatusing catalina_tmpdir:/application/tomcat/tempusing jre_home:/application/jdkUsing CLASSPATH: /application/tomcat/bin/bootstrap.jar:/application/tomcat/bin/tomcat-juli.jartomcat started. [[email protected] ~]# netstat-tunlp|grep javatcp 0 0::: 8009:::* LISTEN 4743/java TCP 0 0::: 8080:::* LISTEN 4743/java [Email protected] ~]# Ps-ef|grep [J]ava
6. Visit the website:
Website: http://1.1.1.1/8080
7. Tomcat LOG:
[Email protected] tools]# cd/application/tomcat/logs/
[[email protected] logs]# ls
Catalina.2016-10-26.log Host-manager.2016-10-26.log Localhost_access_log.2016-10-26.txt
Catalina.out Localhost.2016-10-26.log Manager.2016-10-26.log
#→tomcat Real-time log
[[email protected] logs]#Tailf catalina.out26-oct-2016 15:53:23.782 INFO [localhost-startstop-1] Org.apache.catalina.startup.HostConfig.deployDirectory Deployment of Web application Directory/application/apache-tomcat-8.0.27/webapps/docs has finishedinch60Ms26-oct-2016 15:53:23.786 INFO [localhost-startstop-1] Org.apache.catalina.startup.HostConfig.deployDirectory Deploying Web Application Directory/application/apache-tomcat-8.0.27/webapps/host-Manager26-oct-2016 15:53:23.888 INFO [localhost-startstop-1] Org.apache.catalina.startup.HostConfig.deployDirectory Deployment of Web application Directory/application/apache-tomcat-8.0.27/webapps/host-manager has finishedinch102Ms26-oct-2016 15:53:23.889 INFO [localhost-startstop-1] Org.apache.catalina.startup.HostConfig.deployDirectory Deploying Web Application directory/application/apache-tomcat-8.0.27/webapps/examples26-oct-2016 15:53:24.673 INFO [localhost-startstop-1] Org.apache.catalina.startup.HostConfig.deployDirectory Deployment of Web application Directory/application/apache-tomcat-8.0.27/webapps/examples has finishedinch784Ms26-oct-2016 15:53:24.674 INFO [localhost-startstop-1] Org.apache.catalina.startup.HostConfig.deployDirectory Deploying Web Application directory/application/apache-tomcat-8.0.27/webapps/Manager26-oct-2016 15:53:24.772 INFO [localhost-startstop-1] Org.apache.catalina.startup.HostConfig.deployDirectory Deployment of Web application Directory/application/apache-tomcat-8.0.27/webapps/manager has finishedinch98Ms26-oct-2016 15:53:24.779 INFO [main] Org.apache.coyote.AbstractProtocol.start starting Protocolhandler ["http-nio-8080"]26-oct-2016 15:53:24.795 INFO [main] Org.apache.coyote.AbstractProtocol.start starting Protocolhandler ["ajp-nio-8009"]26-oct-2016 15:53:24.800 INFO [main] Org.apache.catalina.startup.Catalina.start Server startupinch1994 MS
View Code
Java Enterprise Application "second piece" Tomcat installation