<http port='8080'/>
在这里的附近加入
<http port='80'/>
可以有两个不同的端口,至于指向不同的文件的话,我就不知道了。

解决方案 »

  1.   

    我刚才也这样试过了,确实是两个端口都能跑起来,可是它只认在最前面的一个app-dir,怎么才可以让两个端口指向不同的目录呢?
      

  2.   

    What I can find:(suggest to download resin-reference.pdf)host
    Defines a virtual host. If no hosts are specified, or if a request doesn't match a host,
    Copyright (c) 1998-2002 Caucho Technology. All rights reserved
    - 101 -
    configuration in http-server will be used instead.
    The id may contain a list of hosts. Any host in the list will match.
    See application configuration for servlet configuration.
    Hosts can use regexp instead of id to dynamically create new hosts.
    Attribute Meaning Default
    id The host name required
    regexp A regular expression
    matching hosts.
    none
    app-dir The root directory of the
    host (can use
    replacement vars)
    use http-server app-dir
    Any <resource-ref> resource configured in <http-server> is shared for all virtual hosts and
    web-apps in the server. So a database or EJB server configured in the <http-server> will
    be shared for all virtual hosts.
    Default application tags like <servlet-mapping> may appear in the <http-server> section.
    These tags will be defaults for the contained <web-app> and <host>.
    <caucho.com>
    <http-server>
    <host id='www.foobar.com, foobar.com'
    app-dir='foobar/docs'>
    <web-app id='/'>
    <servlet-mapping url-pattern='/servlets/*'
    servlet-name='invoker'/>
    </web-app>
    </host>
    <host regexp='([^.]*).users.com'
    app-dir='/home/$1/public_html'>
    ...
    </host>
    </http-server>
    </caucho.com>
    Note: Only the Resin Java process understands regexps. Because mod_caucho,
    isapi_srun and the other web server plugins don't understand the regexps, you may need
    to do additional work to make the web server send the request to Resin.
    Default: If the id attribute is null or '*', the <host> will be used as the default configuration
    for any virtual host that doesn't match a specific <host> block.
    http
    Defines a HTTP or SSL port for the standalone server.
    Attribute Meaning
    Resin Reference Servlet and Host Configuration - p. 102
    Copyright (c) 1998-2002 Caucho Technology. All rights reserved
    - 102 -
    id http identifier name
    host The listening host
    port The listening port
    virtual-host Virtual host to select a host block.
    ssl enable ssl
    key-store-type JSSE Type of the key store (default jks)
    key-store-file JSSE File containing the certificates
    key-store-password JSSE Password to read the certificates
    certificate-file OpenSSL certificate (Resin 2.0.5)
    certificate-key-file OpenSSL key certificate (Resin 2.0.5)
    certificate-key-password OpenSSL key password (Resin 2.1.1)
    crypto-device OpenSSL engine (Resin 2.0.5)
    thread-max Maximum number of live threads.
    thread-min Minimum number of live threads.
    thread-keepalive Number of keepalive threads
    request-timeout Max time for a request, after this the
    request will be interrupted.
    listen Value of the socket listen parameter
    accept-buffer-size Number of sockets in the accept buffer.
    shutdown-wait-time How long to wait for connections to finish
    before exiting.
    Basic HTTP configuration
    <caucho.com>
    <http-server>
    <http port='8080'>
    ...
    </http-server>
    </caucho.com>
    JSSE configuration
    <caucho.com>
    <http-server>
    <http port='8443'>
    <ssl>true</ssl>
    <key-store-type>pkcs12</key-store-type>
    <key-store-file>keys/server.p12</key-store-file>
    <key-store-password>changeit</key-store-password>
    </http>
    ...
    </http-server>
    </caucho.com>
    Resin Reference Servlet and Host Configuration - p. 103Maybe you can (not tested):
      <host id='host2'>
         <web-app id='...'>
    ...
    <http port='8080' host='host2'>DIY