tomcat 5在主机上是怎么定义的?

我在Windows 2003上安装了tomcat 5和JDK,修改了8080端口为80

现在我在服务器上用localhost来访问可以打开tomcat的默认页,放在安装文件夹中webapps\ROOT文件夹里的jsp文件也能正常解析。

但是我要加上一个虚拟主机的话始终无法成功。

我是在tomcat安装文件夹的conf文件夹里的server.xml里定义的。

原先文件里有个<Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1"> 段,这个段里最后部分有

<Host name="localhost" debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

段,我在这个段的</Host>后面添加了如下的指令

<Host name="zcc.zisu.edu.cn" debug="0" appBase="D:\web\localuser\zcc">
       <Context path="" reloadable="true" docBase="D:\web\localuser\zcc" workDir="D:\web\localuser\zcc" />
      </Host>

重启tomcat以后,D:\web\localuser\zcc中的html文件和jsp文件可以执行,看起来一切正常。

但是我上传客户要放的网站里的WEB-INF文件夹以后就不对了,原先可以访问的D:\web\localuser\zcc中的ht文件也显示文件找不到。

我想应该是WEB-INF文件夹里的server.xml起的作用,现在把这个文件全部贴上来,高手给看看问题可能在哪里

顺便说一句,我对JSP一点不懂,有些白痴的问题请勿见笑。

Plain Text code?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>城市赞赛售中心</display-name>
    <session-config>
        <session-timeout>60</session-timeout>
    </session-config>
 
    <context-param>
        <param-name>webAppRootKey</param-name>
        <param-value>nbfzxy.root</param-value>
    </context-param>
 
    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>/WEB-INF/classes/log4j.properties</param-value>
    </context-param>
 
    <listener>
        <listener-class>
            org.springframework.web.util.Log4jConfigListener
        </listener-class>
    </listener>
 
    <listener>
        <listener-class>
            org.springframework.web.context.ContextLoaderListener
        </listener-class>
    </listener>
 
    <listener>
        <listener-class>
            org.springframework.web.util.IntrospectorCleanupListener
        </listener-class>
    </listener>
    <listener>
        <listener-class>
            com.tiyan.action.UpdateListenerAction
        </listener-class>
    </listener>
 
     
    <!-- Context Configuration locations for Spring XML files -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/classes/applicationContext*.xml
        </param-value>
    </context-param>
    <filter>
        <filter-name>logFilter</filter-name>
        <filter-class>com.tiyan.filter.LogFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>logFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!--Character Encoding filter,必须放在最前面,否则可能出现乱码-->
    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>
            org.springframework.web.filter.CharacterEncodingFilter
        </filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>
 
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>*.do</url-pattern>
    </filter-mapping>
 
    <filter>
        <filter-name>UrlRewriteFilter</filter-name>
        <filter-class>
            org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
        </filter-class>
    </filter>
    <filter-mapping>
        <filter-name>UrlRewriteFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
 
 
 
    <!--Open Session in View Filter-->
    <filter>
        <filter-name>hibernateFilter</filter-name>
        <filter-class>
            org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
        </filter-class>
    </filter>
 
    <filter-mapping>
        <filter-name>hibernateFilter</filter-name>
        <url-pattern>*.do</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
 
 
    <!-- - - - - - - - STRUTS2 FILTERS - - - - - - - - -->
    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>
            org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
        </filter-class>
    </filter>
 
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>*.do</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
 
 
    <servlet>
        <servlet-name>Connector</servlet-name>
        <servlet-class>
            net.fckeditor.connector.ConnectorServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Connector</servlet-name>
        <url-pattern>
            /fckeditor/editor/filemanager/connectors/*
        </url-pattern>
    </servlet-mapping>
 
    <!-- UCHOME的图片上传 -->
    <servlet>
        <servlet-name>fileManager</servlet-name>
        <servlet-class>com.tiyan.FileManager</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>fileManager</servlet-name>
        <url-pattern>/index.f</url-pattern>
    </servlet-mapping>
    <!-- END -->
 
    <!-- Maplist初始化 -->
    <servlet>
        <servlet-name>maplist</servlet-name>
        <servlet-class>com.tiyan.Initproperty</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>maplist</servlet-name>
        <url-pattern>/init</url-pattern>
    </servlet-mapping>
     
     
    <servlet>
    <servlet-name>UpLoadUserHeadImage</servlet-name>
    <servlet-class>com.tiyan.util.imageUpload.UpLoadUserHeadImage</servlet-class>
  </servlet>
    <servlet>
    <servlet-name>ZoomImage</servlet-name>
    <servlet-class>com.tiyan.util.imageUpload.ZoomImage</servlet-class>
  </servlet>
 
 
  <servlet-mapping>
    <servlet-name>UpLoadUserHeadImage</servlet-name>
    <url-pattern>/servlet/UpLoadUserHeadImage</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>ZoomImage</servlet-name>
    <url-pattern>/servlet/ZoomImage</url-pattern>
  </servlet-mapping>
    <!-- END -->
 
    <!-- 支付宝设置 -->
    <filter>
        <filter-name>Set Character Encoding</filter-name>
        <filter-class>filters.SetCharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>utf-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>Set Character Encoding</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
 
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>
posted @ 2013-05-20 19:22  月夜风2013  阅读(194)  评论(0编辑  收藏  举报
合肥搬家公司 全自动包装机