tomcat安装
到http://tomcat.apache.org/下载tomcat
- wget http://labs.renren.com/apache-mirror/tomcat/tomcat-7/v7.0.23/bin/apache-tomcat-7.0.23.tar.gz
- tar xzf apache-tomcat-7.0.23.tar.gz
- mv apache-tomcat-7.0.23 /usr/local/tomcat
设置环境变量
- vi /etc/profile
在文件末尾增加:
- export JRE_HOME=/usr/local/jre
执行source命令使生效
- source /etc/profile
tomcat根目录设置
1.打开tomcat安装目录下面conf目录下的server.xml文件。
2.找到如下文字:
- <Host name="localhost" appBase="webapps"
- unpackWARs="true" autoDeploy="true">
3.在上面找到的文字后面添加如下内容
- <Context path="" docBase="/usr/local/apache/htadocs" debug="0" reloadable="true" />
/usr/local/apache/htadocs即为根目录地址。
更过信息请查看 tomcat教程 http://www.itchm.com/forum-50-1.html