Scott,

Thanks, again, for giving me a hand.

The setup that includes ${host.regexp[1]} was something I found while
poking around your documentation. I figure that it is referencing the
<host regexp="..."> expression and giving me the second element. When
I do that in the <host-name> directive - and include the port - it
didn't work for me. When I get a chance, I'll try repeating the actual
regexp, like you did in your example, and see if that works.

What I was trying to accomplish was allowing the port to be
configured, rather than hard-wired, and combining that with the
wildcard regexp to answer any request presented to that port.

I must say that this exercise has been ... challenging and rewarding.
We're running ResinPro3.0.x on many windows hosts, but wanted to
employ Resin3.1 on a linux host in a very flexible manner for this
particular project. Between the config, the host directives, and the
port forwarding (to not run as root), it requires that you wrestle the
OS and Resin into the format that will work. I'll have to document the
setup in a blog somewhere for others to review.

+ jay


On 4/3/07, Scott Ferguson <[EMAIL PROTECTED]> wrote:
>
> On Apr 2, 2007, at 1:22 PM, Jay Ballinger wrote:
>
> > Scott,
> >
> > Thanks, very much, for your help. The following does work...
> >
> >     <host id="" root-directory="/some/path">
> >               <web-app id="/" root-directory="/some/path/webapp/ROOT"/>
> >     </host>
> >
> >
> >     <host regexp="[^:]+:8443">
> >               <root-directory>/some/other/path</root-directory>
> >       <web-app id="/" root-directory="/some/other/path/webapp/ROOT"/>
> >     </host>
> >
> >
> > ...but, is there any way to sneak in a variable in the regexp?
>
> Not in that attribute.
>
> > regexp="[^:]+:${someVar}" certainly doesn't work. I've been trying to
> > find other escaping mechanisms, but haven't been successful. I've also
> > tried...
>
>
> >
> >
> >     <host regexp="[^:]+">
> >               <host-name>${host.regexp[1]}:${someVar}</host-name>
> >               <root-directory>/some/other/path</root-directory>
> >       <web-app id="/" root-directory="/some/other/path/webapp/ROOT"/>
> >     </host>
>
> I'm not sure what the intention of that one is.  You might try:
>
> <host id="www.foo.com">
>    <host-alias-regexp>[^:]+:${someVar}</host-alias-regexp>
>
> It looks like the host-alias-regexp does allow variables.  (I'm not
> sure if this will work, though.  It's not a case we've tested.)
>
> -- Scott
>
> >
> > ...but resin doesn't act like I expected. It seems to want the port
> > number in the <host> tag.
> >
> > I'm about this > < close to having this new server environment
> > configured. This is my last hiccup, so far.
> >
> >
> > + jay
> >
> >
> >
> > On 4/2/07, Scott Ferguson <[EMAIL PROTECTED]> wrote:
> >>
> >> On Apr 2, 2007, at 10:27 AM, Jay Ballinger wrote:
> >>
> >>>
> >>>
> >>> 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.
> >>
> >> Ok, that makes sense.  Actually, I'm surprised that idea hasn't come
> >> up before.
> >>
> >> You could try using the regexp as a workaround
> >>
> >> <host regexp="[^:]+:8443" ...>
> >> </host>
> >>
> >> -- Scott
> >>
> >>>
> >>> 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
> >>
> >>
> >>
> >> _______________________________________________
> >> 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