Linux的Tomcat设置默认项目
2015-10-11 00:02
387 查看
修改Tomcat/conf/service.xml
在<Host>里面增加一个节点<Context/>
docBase 是这个项目war被解压后的文件夹d名字,是对
path是 访问的url里截去域名后剩下的部分
path设置为"" ,那就对应默认项目了。用户在访问的时候直接输入 http://域名 就行了。 不用输入 域名/testsite1
实例代码如下
在<Host>里面增加一个节点<Context/>
docBase 是这个项目war被解压后的文件夹d名字,是对
<span style="color:#ff6666;">appBase="webapps"的相对路径。</span>
path是 访问的url里截去域名后剩下的部分
<span style="color:#ff6666;"> <Context docBase="testsite1" path="" reloadable="true" /></span>
path设置为"" ,那就对应默认项目了。用户在访问的时候直接输入 http://域名 就行了。 不用输入 域名/testsite1
实例代码如下
<Engine name="Catalina" defaultHost="localhost"> <!--For clustering, please take a look at documentation at: /docs/cluster-howto.html (simple how to) /docs/config/cluster.html (reference documentation) --> <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> --> <!-- Use the LockOutRealm to prevent attempts to guess user passwords via a brute-force attack --> <Realm className="org.apache.catalina.realm.LockOutRealm"> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> <Context docBase="testsite1" path="" reloadable="true" /> </Host> </Engine>
相关文章推荐
- Tomcat剖析(四):Tomcat默认连接器(2)
- Linux下Tomcat配置80端口(8080端口被禁用了)
- tomcat 启动了,浏览器访问不了,查看防火墙 Linux
- mac下安装tomcat
- Tomcat 7.0 servlet @WebServlet
- nginx结合tomcat
- 提升tomcat服务器性能的七条经验
- 关于Ajax跨域访问问题的一种解决办法
- Windows平台下tomcat+java的web程序持续占cpu问题调试
- tomcat 连接池配置
- Target runtime Apache Tomcat v8.0 is not defined.错误解决方法
- eclipse,myeclipse,tomcat
- Tomcat优化
- tomcat 重启,tomcat查看日志
- windows下tomcat+solr+ZooKeeper集群搭建
- (转)TOMCAT JAVA_HOME or JRE_HOME environment variable is not defined correctly(2013-03-29 13:04:14)
- Win7 + Ubuntu 14.04 +tomcat + mysql 搭建测试环境手册
- 如何在一台电脑上同时启动多个tomcat
- 将tomcat作成系统自启动服务并增大jvm启动内存
- Apache与Tomcat 区别联系