Tomcat安装

准备安装包

/opt/apache-tomcat-7.0.67.tar.gz

解压安装

cd /opt
tar zxvf apache-tomcat-7.0.67.tar.gz
mv /opt/apache-tomcat-7.0.67 /opt/yliyun/tomcat

修改PATH:

vim /etc/profile

添加以下内容:

export CATALINA_HOME=/opt/yliyun/tomcat

执行以下命令:

source /etc/profile

创建日志目录:

mkdir -pv /data/yliyun/logs/tomcat

修改日志配置:

vim /opt/yliyun/tomcat/conf/server.xml

修改以下内容:

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="/data/yliyun/logs/tomcat"
    prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />

Tomcat启动文件:

cp /opt/yliyun/tomcat/bin/catalina.sh /opt/yliyun/bin/tomcat
    原文作者:ymyang
    原文地址: https://segmentfault.com/a/1190000005911302
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞