用resin配置多个虚拟主机情况下,如何配置resvlet和Strust? (100分)

J

jeoky

Unregistered / Unconfirmed
GUEST, unregistred user!
我用resin2.1.9、IIS、JDK1.4、win200配置一台服务器。在resin配置了多个虚拟主机(www.jeoky.com、www.gzlife.com)。但只能访问JSP文件,而不能访问servlet、也不能用Strust。
请问,我该如何配置resin.conf,还是web.xml?
--------resin.conf---------
<!--
- The Resin configuration file.
-
- This example file is more complicated than is needs to be because
- it makes several configurations explicit that can be simplified and
- because it needs to configure the examples.
-
- Look in conf/samples for more realistic sample configurations.
- conf/samples/simple.conf - a simple, basic configuration
- conf/samples/deploy.conf - a simple configuration for deployment
-
- The configuration is based on a purely element-based XML. To make
- it easier to read, attributes can be used as syntactic sugar.
-
- The following are equivalent:
- <foo><bar>13</bar></foo> - canonical representation, but verbose
- <foo bar=13/> - typical configuration
- <foo><bar id=13/></foo> - sometimes useful
-->
<caucho.com>
<!--
- Resin logging. Debugging is also available with different values
- for id.
-->
<log id=&amp;acute;/log&amp;acute;
href=&amp;acute;stderr:&amp;acute;
timestamp=&amp;acute;[%Y-%m-%d %H:%M:%S.%s]&amp;acute;/>
<!-- Security providers. Adding JSSE looks like:
- <security-provider id=&amp;acute;com.sun.net.ssl.internal.ssl.Provider&amp;acute;/>
-->
<!--
- You can change the compiler to "javac" or jikes.
- The default is "internal" only because it&amp;acute;s the most
- likely to be available.
-->
<java compiler="internal" compiler-args=""/>
<!--
- Sample database pool configuration
- The JDBC name is java:comp/env/jdbc/test
-->
<resource-ref>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<init-param driver-name="com.caucho.jdbc.mysql.Driver"/>
<init-param url="jdbc:mysql_caucho://localhost:3306/test"/>
<init-param user=""/>
<init-param password=""/>
<init-param max-connections="20"/>
<init-param max-idle-time="30"/>
</resource-ref>
<!--
- Use precompiled JSP classes if available.
- &amp;acute;static-encoding&amp;acute;
- optimization if you stick to one character set
-->
<jsp precompile=&amp;acute;true&amp;acute;
static-encoding=&amp;acute;true&amp;acute;
recompile-on-error=&amp;acute;true&amp;acute;/>
<http-server>
<!--
- The root file directory of the server. Apache users will change
- this to /usr/local/apache/htdocs and IIS users will change it
- to d:/inetpub/wwwroot
-->
<doc-dir>f:/jsp</doc-dir>
<!-- the http port -->
<http port=&amp;acute;8080&amp;acute;/>
<!--
- The srun port, read by both JVM and plugin
- 127.0.0.1 is the localhost
-->
<srun host=&amp;acute;127.0.0.1&amp;acute;
port=&amp;acute;6802&amp;acute;/>
<srun-backup host=&amp;acute;127.0.0.1&amp;acute;
port=&amp;acute;6803&amp;acute;/>
<!--
- How to add SSL:
-
- <http port=8443>
- <ssl>true</ssl>
- <key-store-type>pkcs12</key-store-type>
- <key-store-file>keys/server_cert.p12</key-store-file>
- <key-store-password>changeit</key-store-password>
- </http>
-->
<!--
- If starting bin/httpd.sh as root on Unix, specify the user name
- and group name for the web server user. Note: Linux users must
- either have the new thread package (RedHat 9.0 or later) or use
- bin/resin.
-
- <user-name>resin</user-name>
- <group-name>resin</group-name>
-->
<!--
- For production sites, change class-update-interval to something
- like 60s, so it only checks for updates every minute.
-->
<class-update-interval>2s</class-update-interval>
<!--
- If true, the classloader order follows the Servlet spec.
- If false, the classloader order follows the JDK spec.
-->
<servlet-classloader-hack>false</servlet-classloader-hack>
<!--
- Select an error page to display when the connection fails.
-
- <error-page exception=&amp;acute;connection&amp;acute;
location=&amp;acute;/my-error-page.html&amp;acute;/>
-->
<!-- To disable /caucho-status, set this to false -->
<caucho-status>true</caucho-status>
<!-- maximum number of threads -->
<thread-max>150</thread-max>
<!--
- How many threads to wait for keepalives. Should be at least the
- number of Apache processes to get good performance.
-->
<thread-keepalive id=&amp;acute;100&amp;acute;/>
<!--
- How long an idle keepalive connection should listen to the socket.
-
- The choice of 65 seconds is to avoid the IE SSL timeout problem.
- If you&amp;acute;re not using SSL, you can make this shorter.
-->
<request-timeout id=&amp;acute;65s&amp;acute;/>
<!--
- How many sockets to hold in the buffer before failing requests.
-->
<accept-buffer-size id=&amp;acute;256&amp;acute;/>
<!--
- Maximum number of request threads which will wait for a socket.
-->
<thread-min id=&amp;acute;5&amp;acute;/>
<!--
- Ping to test if the web server is still up. You can uncomment this
- and point it to pages on the webserver that exercise your main
- logic (like database access). If the GET fails, it will restart
- the server. This will catch deadlocks, but not JDK freezes.
-
- <ping sleep-time=&amp;acute;1m&amp;acute;
retry-count=&amp;acute;3&amp;acute;
retry-time=&amp;acute;1s&amp;acute;>
- <url>;http://localhost:8080/ping/ping.jsp<;/url>
- </ping>
-->
<!--
- Enables/disables exceptions when the browser closes a connection.
-->
<ignore-client-disconnect>true</ignore-client-disconnect>
<!--
- Enable internal caching.
- &amp;acute;dir&amp;acute;
is the directory containing the cache
- &amp;acute;size&amp;acute;
is the memory size in kb
- &amp;acute;entries&amp;acute;
is the total number of entries
-->
<cache dir=&amp;acute;cache&amp;acute;
size=&amp;acute;1024&amp;acute;
entries=&amp;acute;8192&amp;acute;/>
<!--
- Expires time for a cacheable file. Production sites will
- normally change this to &amp;acute;15m&amp;acute;
-->
<cache-mapping url-pattern=&amp;acute;/&amp;acute;
expires=&amp;acute;2s&amp;acute;/>
<!--
- servlet configuration outside the <host> is a default for all hosts.
-->
<servlet-mapping url-pattern=&amp;acute;*.xtp&amp;acute;
servlet-name=&amp;acute;xtp&amp;acute;/>
<servlet-mapping url-pattern=&amp;acute;*.jsp&amp;acute;
servlet-name=&amp;acute;jsp&amp;acute;/>
<!--
- The "invoker" servlet invokes servlet classes from the URL.
- /examples/basic/servlet/HelloServlet will start the HelloServlet
- class. In general, the invoker should only be used
- for development, not on a deployment server, because it might
- leave open security holes.
-->
<servlet-mapping url-pattern=&amp;acute;/servlet/*&amp;acute;
servlet-name=&amp;acute;invoker&amp;acute;/>
<!--
- set the pages to be used as welcome (index) files
-->
<welcome-file-list>index.xtp, index.jsp, index.html</welcome-file-list>
<!-- default host if no other host matches -->
<host id=&amp;acute;www.gzlife.com&amp;acute;>
<app-dir>F:/jsp/gzlife</app-dir>
<servlet-mapping url-pattern=&amp;acute;index.html&amp;acute;
servlet-name=&amp;acute;index.jsp&amp;acute;/>
</host>
<host id=&amp;acute;www.jeoky.com&amp;acute;>
<app-dir>F:/jsp/jeoky</app-dir>
<error-log id=&amp;acute;logs/jeoky.log&amp;acute;/>
<servlet-mapping url-pattern=&amp;acute;/servlet/*&amp;acute;
servlet-name=&amp;acute;invoker&amp;acute;/>
</host>
<!--
- Known broken browsers. These should no longer be necessary, but
- you can uncomment them if they become a problem.
-
- <browser-mapping regexp="MSIE 4/.0b2" force10/>
- <browser-mapping regexp="RealPlayer 4/.0" force10/>
- <browser-mapping regexp="Java/1//.0" force10/>
- <browser-mapping regexp="JDK/1//.0" force10/>
-->
</http-server>
</caucho.com>
 
没人了解吗?
这个模块很冷清!!!
 
在resin.conf加上:
<classpath id='WEB-INF/classes'
source='WEB-INF/classes'
compile='true'/>
web-inf建立一目录classes,然后将你的类编译并建一个与类同名的目录将编译好的.class放在该目录下。
http://localhost:8080/yourfilename即可。
我的配置是apache2.0与resin2.1.9
 
顶部