Linux 安装tomcat


安装分为两种方式

1、通过yum安装,前提是yum源维护了该rpm包。

yum -y install tomcat

这时候,安装的tomcat目录默认在

/usr/share/tomcat

然后通过以下命令可以启动\停止服务

systemctl start tomcat
systemctl stop tomcat

2、自行下载tar.gz包,然后配置安装

http://tomcat.apache.org/

1)下载apache-tomcat-6.0.10.tar.gz
2)解压压缩包
tar -zxvf apache-tomcat-6.0.10.tar.gz

然后将其拷贝到/usr/local目录下

cp -rf apache-tomcat-6.0.10/* /usr/local

进入bin目录,启动服务

cd bin
./start.sh

参考:

https://www.cnblogs.com/skyhu365/p/10551892.html

配置


通过编辑tomcat/conf目录下的tomcat-user.xml

"admin"/>
"admin" password="admin" roles="admin" />

将注释中的角色与用户进行配置

这样在localhost:8080页面,通过admin用户,可以对webapp进行管理

参考:

https://www.cnblogs.com/magicalSam/p/magicalSam.html