tomcat和域名部署,直接输入域名就能进入项目
2015-11-17 11:53
573 查看
1.tomcat原来的默认根目录是http://localhost:8080,如果想修改访问的根目录,可以这样:
找到tomcat的server.xml(在conf目录下),找到:
.代码如下:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"></Host>
在</Host>前插入:注意path=""这个最重要
.代码如下:
<Context path="" docBase="D:/eclipse3.3/jb51.net/tomcat/" debug="0"/>
其中D:/eclipse3.3/jb51.net/tomcat/就是我想设置的网站根目录,然后重启tomcat。
再次访问http://localhost:8080时,就是直接访问D:/eclipse3.3/jb51.net/tomcat/目录下的文件了。
2.tomcat的web.xml(在conf目录下),在该文件中找到
.代码如下:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
这是tomcat默认的3个文件,当你输入指定路径后,tomcat会自动查找这3个页面。如果你想让tomcat自动找到自己的页面,比如main.jsp。可以修改上面信息为:
.代码如下:
<welcome-file-list>
<welcome-file>main.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
这样就可以了。
找到tomcat的server.xml(在conf目录下),找到:
.代码如下:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"></Host>
在</Host>前插入:注意path=""这个最重要
.代码如下:
<Context path="" docBase="D:/eclipse3.3/jb51.net/tomcat/" debug="0"/>
其中D:/eclipse3.3/jb51.net/tomcat/就是我想设置的网站根目录,然后重启tomcat。
再次访问http://localhost:8080时,就是直接访问D:/eclipse3.3/jb51.net/tomcat/目录下的文件了。
2.tomcat的web.xml(在conf目录下),在该文件中找到
.代码如下:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
这是tomcat默认的3个文件,当你输入指定路径后,tomcat会自动查找这3个页面。如果你想让tomcat自动找到自己的页面,比如main.jsp。可以修改上面信息为:
.代码如下:
<welcome-file-list>
<welcome-file>main.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
这样就可以了。
相关文章推荐
- Tomcat中配置MySQL数据库连接池
- tomcat下的内存设置,以及设置tomcat内存参数的查看
- 编译修改tomcat7源码,支持同时设置允许ip和域名
- Windows配置多Tomcat实例
- Tomcat中JVM内存溢出及合理配置
- Intellij idea14.4 新建maven web项目并集成tomcat服务
- tomcat启动jvm内存设置
- Centos7下配置Tomcat7以指定(非root)身份运行
- 解压版的Tomcat基本配置和安装
- tomcat可以启动,localhost:8080无法访问
- 把解压缩版的tomcat6注册成服务并设置自启动
- tomcat_server.xml配置说明
- tomcat 启动增加参数
- Linux上安装Tomcat7.0
- tomcat 问题: "The APR based Apache Tomcat Native library which allows optimal perf
- tomcat登陆它的manager
- Jetty 的工作原理以及与 Tomcat 的比较
- mac下Tomcat的下载,安装,配置
- centos安装jdk,tomcat
- 【问题】Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds