mac os 安装tomcat完全教程
一.安装教程
1.将apache-tomcat-7.0.47.zip解压到 /Users/canglangwenyue/Library下,并命名为Tomcat;
2.修改权限:
canglangwenyue$ sudo chmod 755 /Users/canglangwenyue/Library/Tomcat/bin/*.sh
3.执行startup.sh文件:
/Users/canglangwenyue/Library/Tomcat/bin/startup.sh
4.在浏览器http://localhost:8080
二.基本操作:
1.打开tomcat:
/Users/canglangwenyue/Library/Tomcat/bin/startup.sh
2.关闭tomcat:
/Users/canglangwenyue/Library/Tomcat/bin/shutdown.sh
3.仿照mysql设置环境变量,为tomcat设置环境变量:
1).用vim 打开该文件:
cd; vi .bash_profile
2).在文件中加入该语句:
export PATH="/Users/canglangwenyue/Library/Tomcat/bin/:$PATH”
并保存退出
3).重新加载shell让设置的环境变量生效:
source ~/.bash_profile
之后便可用startup.sh,shutdown.sh来执行登录,停止命令。
三:解决问题
4.*****解决localhost:8080登录后server status, manager app,
host mannager无法登陆的问题:
修改 tomcat-users.xml文件:
修改之前:
<tomcat-users>
<!--
<role rolename="tomcat"/>
<role rolename="rolel"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-->
</tomcat-users>
修改后:
<tomcat-users>
<!--
<role rolename="tomcat"/>
<role rolename="rolel"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-->
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="admin" password="123456" roles="manager-gui,admin-gui"/>
</tomcat-users>
修改后重启tomcat即可完成登录操作!
版权所有,转载请注明出处:http://www.cnblogs.com/canglangwenyue
posted on 2014-02-28 21:15 canglangwenyue 阅读(349) 评论(1) 编辑 收藏 举报