002-tomcat安装与配置
1、创建目录
[root@bogon tomcat]#mkdir /usr/local/java/tomcat
2、上传压缩包并解压
[root@bogon tomcat]# tar xvf apache-tomcat-7.0.69.tar.gz
3、删除压缩包
[root@bogon tomcat]# rm -rf apache-tomcat-7.0.69.tar.gz
4、修改名字
[root@bogon tomcat]# mv apache-tomcat-7.0.69 tomcat7.1
5、配置端口号(省略)
[root@bogon ~]# vi /usr/local/java/tomcat/tomcat7.1/conf/server.xml
6、配置后台管理员
[root@bogon ~]# vi /usr/local/java/tomcat/tomcat7.1/conf/tomcat-users.xml
在后边添加
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager-gui"/>
<user password="tomcat" roles="tomcat" username="tomcat"/>
<user password="tomcat" roles="tomcat,role1" username="both"/>
<user password="tomcat" roles="role1" username="role1"/>
<user password="admin" roles="manager-gui" username="admin"/>
7.启动tomcat
[root@bogon ~]# /usr/local/java/tomcat/tomcat7.1/bin/startup.sh