Hi Scott,

Thanks for the help. Sorry about the confusion, let me try again...

I understand the need for the <host name="">...</host> directive. My
challenge is trying to have a universal host name associated with a
port.


For example...
      <!-- The http port -->
      <http address="*" port="8080"/>

      <!-- SSL port configuration -->
      <http address="*" port="8443">
        <jsse-ssl>
          <key-store-type>pkcs12</key-store-type>
          <key-store-file>someCerts.p12</key-store-file>
          <password>somePassword</password>
        </jsse-ssl>
      </http>


    <host id="" root-directory="/some/path">
                <web-app id="/" root-directory="/some/path/webapp/ROOT"/>
    </host>

This arrangement is very flexible. It will answer any request to ports
8080 and 8443 with the webapp found at ROOT, and it will do it for any
host name used to get there (like foo.bar.com, baz.bar.com, etc.).


However, I would like to have port 8080 associated with one set of
webapps, and port 8443 associated with a different set of webapps.

If I explicitly set the host name (by not leaving it blank between the
quotes), it does work...

    <host id="foo.bar.com" root-directory="/some/path">
                <web-app id="/" root-directory="/some/path/webapp/ROOT"/>
    </host>

    <host id="foo.bar.com:8443" root-directory="/some/other/path">
                <web-app id="/" root-directory="/some/other/path/webapp/ROOT"/>
    </host>

...as long as the user uses the "foo.bar.com" host name on the url,
all works exactly as expected. But this limits me to using
"foo.bar.com" and is not as flexible as not declaring a host name
inside the quotes.


My hope would be to use something like the following...

    <host id="" root-directory="/some/path">
                <web-app id="/" root-directory="/some/path/webapp/ROOT"/>
    </host>

    <host id=":8443" root-directory="/some/other/path">
                <web-app id="/" root-directory="/some/other/path/webapp/ROOT"/>
    </host>

...but this results in the 'blank' host directive serving all requests
- http and https.

Declarations like...

    <host id=":8080" root-directory="/some/path">
                <web-app id="/" root-directory="/some/path/webapp/ROOT"/>
    </host>

    <host id=":8443" root-directory="/some/other/path">
                <web-app id="/" root-directory="/some/other/path/webapp/ROOT"/>
    </host>

...result in the server launching, but the user gets a 404 for each
request as it seems that nothing is mapped as resin would expect to
find it.

I even tried silly entries like "*" and "*:8443", but those resulted
in stack traces on server startup.


So when I said, "I was hoping to not have to set a host name at all",
I really meant that I was hoping to not lock myself in to an explicit
host name nor lock myself into a long list of host-alias names.

Thanks, again, for the help, Scott. Hopefully I was a little clearer
this time in what I am trying to accomplish.

+ jay


On 4/2/07, Scott Ferguson <[EMAIL PROTECTED]> wrote:
>
> On Mar 31, 2007, at 9:41 PM, Jay Ballinger wrote:
>
> > Scott,
> >
> > I've been playing around with the <host /> directives and could use a
> > little help.
> >
> > If I explicitly set the listen ports to 8080 and 8443, and then if I
> > set the host names to "foo.bar.com" and "foo.bar.com:8443", it works
> > exactly as expected by serving pages from different webapp
> > directories. But I was hoping to not have to set a host name at all.
>
> I'm not sure I understand.  If you want different webapp directories,
> you need separate <host/> blocks.  Otherwise it's the same host, not
> two different ones.
>
> So I don't understand how you would have two different directories
> without setting a host name.
>
> -- Scott
>
> >
> > If I set the hosts to "" and ":8443", I get both ports serving from
> > the same webapps directory (the one set for port 8080).
> >
> > If I set the hosts to ":8080" and ":8443", I get a 404 error saying
> > the "/" was not found, and the console reports that "web-app root
> > directory should not be the same as resin.home" and it appears to try
> > to start a non-existant webapp (WebApp[] starting).
> >
> > I tried "*:8443", but got a stack trace on server start.
> >
> > I was really hoping to not have to set a host name at all. I would
> > like to simply have any request hitting port 8080 served from one set
> > of defined webapps, while all requests hitting port 8443 served from
> > another set of defined webapps regardless of which host name has
> > brought the user to this server. Is this possible?
> >
> >
> > + jay
> >
> >
> >
> > On 3/30/07, Jay Ballinger <[EMAIL PROTECTED]> wrote:
> >> Thanks, Scott.
> >>
> >> I was about to try that combo, but hadn't done it yet. (I have a
> >> laundry list of config items to try.)
> >>
> >> I think I remember you giving that same solution to someone a few
> >> weeks ago, now that I think about it. Might be a good candidate for
> >> some examples in the docs. ;)
> >>
> >> Thanks again!
> >>
> >> + jay
> >>
> >>
> >> On 3/30/07, Scott Ferguson <[EMAIL PROTECTED]> wrote:
> >>>
> >>> On Mar 30, 2007, at 3:33 PM, Jay Ballinger wrote:
> >>>
> >>>> I am setting up a new resin installation and ran into a fork in the
> >>>> config.
> >>>>
> >>>> We would like to have http://foo.bar.com and https://foo.bar.com
> >>>> to be
> >>>> answered by the same resin, but with different webapps defined for
> >>>> each.
> >>>>
> >>>> http://foo.bar.com would answer with a welcome page while ...
> >>>> https://foo.bar.com would have all the functional pages.
> >>>>
> >>>> Looking at the resin.conf file, I find the following options...
> >>>>
> >>>> 1 - configure a different host which would require foo.bar.com:
> >>>> 80 and
> >>>> baz.bar.com:443 to be defined if I want to run with one resin
> >>>> instance.
> >>>>
> >>>> 2 - run separate resin instances - one for port 80 and the other
> >>>> for port 443
> >>>>
> >>>> 3 - run one resin instance and allow both ports to serve all
> >>>> content
> >>>> (and do some fancy url checking in the application to keep them
> >>>> parked
> >>>> on 443)
> >>>>
> >>>>
> >>>> Is there any possible way to have one resin instance with port 80
> >>>> defined with a webapp and port 443 defined with different webapps?
> >>>
> >>> Sure, just use
> >>>
> >>> <host id="bar.baz.com">
> >>>    ..
> >>> </host>
> >>>
> >>> <host id="bar.baz.com:443">
> >>>    ...
> >>> </host>
> >>>
> >>> -- Scott
> >>>
> >>>>
> >>>>
> >>>> Thanks for the help.
> >>>>
> >>>>
> >>>> + jay
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> resin-interest mailing list
> >>>> resin-interest@caucho.com
> >>>> http://maillist.caucho.com/mailman/listinfo/resin-interest
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> resin-interest mailing list
> >>> resin-interest@caucho.com
> >>> http://maillist.caucho.com/mailman/listinfo/resin-interest
> >>>
> >>
> >
> >
> > _______________________________________________
> > resin-interest mailing list
> > resin-interest@caucho.com
> > http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>


_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to