准备安装包
/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 "%r" %s %b" />
Tomcat启动文件:
cp /opt/yliyun/tomcat/bin/catalina.sh /opt/yliyun/bin/tomcat