标签:linux6 成功 code loader linux read comm trap png
Tomcat是一个开放源代码、运行servlet和JSP Web应用软件的基于Java的Web应用软件容器。
Apache是web服务器,Tomcat是应用(java)服务器,它只是一个servlet容器,是Apache的扩展。 Apache和Tomcat都可以做为独立的web服务器来运行,但是Apache不能解释java程序(jsp,servlet)。
一、安装JDK
官网:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Tomcat 8.5 要求 JDK 版本为 1.7 以上。
下载、解压:
# mkdir -p /usr/java/jde # tar -zxf jdk-8u45-linux-x64.tar.gz -C /usr/java/jdk/
# mv /usr/java/jdk/jdk1.8.0_45 /usr/java/jdk/jdk1.8
vi编辑配置文件/etc/profile(全局Linux环境变量配置文件,对所有用户有效),在文件后面添加
# vim /etc/profile ... export JAVA_HOME=/usr/java/jdk/jdk1.8 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin export PATH=$PATH:${JAVA_PATH} # source /etc/profile
查看版本情况
# java -version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
二、安装Tomcat
官网:http://tomcat.apache.org/download-80.cgi
下载、解压:
# mkdir /usr/local/software # tar -zxf apache-tomcat-8.5.49.tar.gz -C /usr/local/software/ # mv /usr/local/software/apache-tomcat-8.5.49 /usr/local/software/tomcat8.5.49
编辑配置文件/etc/profile
export CATALINA_HOME=/usr/local/software/tomcat8.5.49 "/etc/profile" 87L, 2113C written # # source /etc/profile
启动tomcat
# cd /usr/local/software/tomcat8.5.49/bin # ls bootstrap.jar commons-daemon-native.tar.gz setclasspath.sh tool-wrapper.bat catalina.bat configtest.bat shutdown.bat tool-wrapper.sh catalina.sh configtest.sh shutdown.sh version.bat catalina-tasks.xml daemon.sh startup.bat version.sh ciphers.bat digest.bat startup.sh ciphers.sh digest.sh tomcat-juli.jar commons-daemon.jar setclasspath.bat tomcat-native.tar.gz # # ./startup.sh Using CATALINA_BASE: /usr/local/software/tomcat8.5.49 Using CATALINA_HOME: /usr/local/software/tomcat8.5.49 Using CATALINA_TMPDIR: /usr/local/software/tomcat8.5.49/temp Using JRE_HOME: /usr/java/jdk/jdk1.8/jre Using CLASSPATH: /usr/local/software/tomcat8.5.49/bin/bootstrap.jar:/usr/local/software/tomcat8.5.49/bin/tomcat-juli.jar Tomcat started.
查看进程
# ps -ef | grep tomcat root 2318 1 12 11:12 pts/0 00:00:01 /usr/java/jdk/jdk1.8/jre/bin/java -Djava.util.logging.config.file=/usr/local/software/tomcat8.5.49/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/software/tomcat8.5.49/bin/bootstrap.jar:/usr/local/software/tomcat8.5.49/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/software/tomcat8.5.49 -Dcatalina.home=/usr/local/software/tomcat8.5.49 -Djava.io.tmpdir=/usr/local/software/tomcat8.5.49/temp org.apache.catalina.startup.Bootstrap start root 2362 1507 0 11:12 pts/0 00:00:00 grep tomcat
浏览器访问toncat查看是否运行成功
访问方式:ip加端口号,tomcat默认端口号为8080,可以在config配置文件修改。
如下图所示,则表明tomcat安装成功
Tomcat主要目录
[root@centos6 tomcat8.5.49]# ls bin conf lib logs README.md RUNNING.txt webapps BUILDING.txt CONTRIBUTING.md LICENSE NOTICE RELEASE-NOTES temp work
*.sh
文件用于 Unix 系统; *.bat
文件用于 Windows 系统。详细的 Tomcat8 配置可以参考 Tomcat 8 配置官方参考文档 。
标签:linux6 成功 code loader linux read comm trap png
原文地址:https://www.cnblogs.com/zwj-linux/p/12031120.html