0015linux安装tomcat
Posted linux777
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了0015linux安装tomcat相关的知识,希望对你有一定的参考价值。
1、解压
yum install -y unzipunzip apache-tomcat-7.0.88-syzw-7001.ziprm -rf apache-tomcat-7.0.88-syzw-7001.zipcp -a apache-tomcat-7.0.88-syzw-7001/ /data/local/apache-tomcat-7.0.88
2、配置catalina.sh
vi catalina.sh,头部添加如下配置:
export JAVA_HOME=/data/soft/jdk1.8.0_171export JRE_HOME=$JAVA_HOME/jreexport PATH=$JAVA_HOME/bin:$PATHexport CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/libJAVA_OPTS="-server -Xms2048m -Xmx2048m -XX:PermSize=128M -XX:MaxPermSize=256m"
3、配置web.xml
尾部添加如下配置:
<security-constraint><web-resource-collection><url-pattern>/*</url-pattern><http-method>PUT</http-method><http-method>DELETE</http-method><http-method>HEAD</http-method><http-method>OPTIONS</http-method><http-method>TRACE</http-method></web-resource-collection><auth-constraint></auth-constraint></security-constraint></web-app>
4、配置server.xml
1修改相关端口号2配置server属性:server="server-alias"<Connector port="9001" protocol="HTTP/1.1"connectionTimeout="20000"redirectPort="6643"server="server-alias"/>
5、验证
yum search netstatnetstat -tanlpfirewall-cmd --zone=public --add-port=9001/tcp --permanentfirewall-cmd --reload
以上是关于0015linux安装tomcat的主要内容,如果未能解决你的问题,请参考以下文章
Linux Tomcat安装,Linux配置Tomcat,Linux Tomcat修改内存,Linux tomcat修改端口