`
羊小绵
  • 浏览: 49971 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
文章分类
社区版块
存档分类
最新评论

linux下tomcat的安装配置

阅读更多
1.下载 Tomcat
http://tomcat.apache.org/download-70.cgi
下载 core 的 tar.gz
2.解压缩到指定目录
cd /usr/local
sudo tar -xzf apache-tomcat-7.0.32.tar.gz
最好为了方便,改下文件夹的名字为 tomcat
cd /usr/local
sudo mv apache-tomcat-7.0.32 tomcat
3.设置环境变量
在/etc/profile 文件中加入 tomcat 的安装路径
sudo gedit /etc/profile
添加
export TOMCAT_HOME=/usr/local
4.配置 tomcat
source /etc/profile
至此,使用 tomcat 的默认配置模式,就完成了
测试一下,
cd /usr/local/tomcat/bin
sudo ./startup.sh

打开 url http://localhost:8080/
出现 tomcat 那只小猫,则 tomcat 部署成功

5.部署自己的工程到 tomcat 下
先将工程文件复制到 /usr/local/tomcat/webapps 下
比如我们的工程文件夹是 hadoop,
mv /xxx/hadoop /usr/local/tomcat/webapps/hadoop
然后在 tomcat/conf/server.xml 中加入一行
加在<host></host>之间
<Context path="/hadoop" docBase="hadoop" debug="0"/>
然后在 tomcat/conf/web.xml 中加入一行
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
加入 hadoop 工程的首页文件
至此,部署完成
打开 url http://localhost:8080/hadoop
出现界面说明,我们已经成功的把自己的工程部署到 tomcat 里面了
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics