librelist archives

« back to archive

Replying for any host

Replying for any host

From:
Carlo Pires
Date:
2010-08-30 @ 20:42
Hi,

Is there a way to config mongrel2 (beta5) to reply for any host?

Re: [mongrel2] Replying for any host

From:
Christopher Mahan
Date:
2010-08-30 @ 21:12
On Mon, Aug 30, 2010 at 1:42 PM, Carlo Pires <carlopires@gmail.com> wrote:
> Is there a way to config mongrel2 (beta5) to reply for any host?

I'm interested in that too. Tried '0.0.0.0' and '' (empty string)

Update: and '.*'

and that didn't work...



Chris Mahan
(818) 671-1709
http://christophermahan.com/
chris.mahan@gmail.com

Re: [mongrel2] Replying for any host

From:
Carlo Pires
Date:
2010-08-30 @ 21:24
Filled a ticket:

http://mongrel2.org/tktview?name=45bfc4a311

--
  Carlo

Re: [mongrel2] Replying for any host

From:
Alex Gartrell
Date:
2010-08-30 @ 21:32
Have you tried setting default_host in the Server function?

main = Server(
    default_host="alexgartrell.com",
    uuid="2f62bd5-9e59-49cd-993c-3b6013c28f05",
    access_log="/logs/access.log",
    error_log="/logs/error.log",
    chroot="./",
    pid_file="run/mongrel2.pid",
    port=80
)

On Mon, Aug 30, 2010 at 5:24 PM, Carlo Pires <carlopires@gmail.com> wrote:

> Filled a ticket:
>
> http://mongrel2.org/tktview?name=45bfc4a311
>
> --
>   Carlo
>

Re: [mongrel2] Replying for any host

From:
Carlo Pires
Date:
2010-08-30 @ 21:38
Yes. Didn't work.

2010/8/30 Alex Gartrell <alexgartrell@gmail.com>:
> Have you tried setting default_host in the Server function?
> main = Server(
>     default_host="alexgartrell.com",
>     uuid="2f62bd5-9e59-49cd-993c-3b6013c28f05",
>     access_log="/logs/access.log",
>     error_log="/logs/error.log",
>     chroot="./",
>     pid_file="run/mongrel2.pid",
>     port=80
> )
> On Mon, Aug 30, 2010 at 5:24 PM, Carlo Pires <carlopires@gmail.com> wrote:
>>
>> Filled a ticket:
>>
>> http://mongrel2.org/tktview?name=45bfc4a311
>>
>> --
>>  Carlo
>
>

Re: [mongrel2] Replying for any host

From:
Zed A. Shaw
Date:
2010-08-30 @ 23:54
On Mon, Aug 30, 2010 at 06:38:52PM -0300, Carlo Pires wrote:
> Yes. Didn't work.

Yep, just tried a few and it's busted.  I'll fix it in a few minutes and
let you know.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Replying for any host

From:
Zed A. Shaw
Date:
2010-08-30 @ 21:07
On Mon, Aug 30, 2010 at 05:42:32PM -0300, Carlo Pires wrote:
> Hi,
> 
> Is there a way to config mongrel2 (beta5) to reply for any host?

Hmm, actually I hadn't tried that.  You should be able to just do (.*)
for Host.name and it'll work.

If not, put in a ticket for it and I'll make it work.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Replying for any host

From:
Christopher Mahan
Date:
2010-08-30 @ 21:15
On Mon, Aug 30, 2010 at 2:07 PM, Zed A. Shaw <zedshaw@zedshaw.com> wrote:

> Hmm, actually I hadn't tried that.  You should be able to just do (.*)
> for Host.name and it'll work.

Wait, I need to put the parens? like
Host(name="(.*)", route

how do I specify the (.*) on m2sh launch?

Chris Mahan
(818) 671-1709
http://christophermahan.com/
chris.mahan@gmail.com

Re: [mongrel2] Replying for any host

From:
Zed A. Shaw
Date:
2010-08-30 @ 23:39
On Mon, Aug 30, 2010 at 02:15:11PM -0700, Christopher Mahan wrote:
> On Mon, Aug 30, 2010 at 2:07 PM, Zed A. Shaw <zedshaw@zedshaw.com> wrote:
> 
> > Hmm, actually I hadn't tried that.  You should be able to just do (.*)
> > for Host.name and it'll work.
> 
> Wait, I need to put the parens? like
> Host(name="(.*)", route
> 
> how do I specify the (.*) on m2sh launch?

This is why we added the various ways to start, if you do m2sh help -for
start:

m2sh start -db config.sqlite -uuid 3d815ade-9081-4c36-94dc-77a9b060b021
m2sh start -db config.sqlite -host localhost
m2sh start -db config.sqlite -name test
m2sh start -db config.sqlite -every

That way you can use name for the *server* (not host), or -host if you
have a simple default host, or the uuid to be very exact, or just -every
to run them all.

Let me actually try this though and get back to everyone since I hadn't
actually done it.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Replying for any host

From:
Alex Gartrell
Date:
2010-08-30 @ 21:16
you actually have to use name= and pattern=.  name is the name (for the
purpose of starting it) and pattern is the regex it matches against (.*)

Alex

On Mon, Aug 30, 2010 at 5:15 PM, Christopher Mahan <chris.mahan@gmail.com>wrote:

> On Mon, Aug 30, 2010 at 2:07 PM, Zed A. Shaw <zedshaw@zedshaw.com> wrote:
>
> > Hmm, actually I hadn't tried that.  You should be able to just do (.*)
> > for Host.name and it'll work.
>
> Wait, I need to put the parens? like
> Host(name="(.*)", route
>
> how do I specify the (.*) on m2sh launch?
>
> Chris Mahan
> (818) 671-1709
> http://christophermahan.com/
> chris.mahan@gmail.com
>

Re: [mongrel2] Replying for any host

From:
Zed A. Shaw
Date:
2010-08-30 @ 23:53
On Mon, Aug 30, 2010 at 05:16:33PM -0400, Alex Gartrell wrote:
> you actually have to use name= and pattern=.  name is the name (for the
> purpose of starting it) and pattern is the regex it matches against (.*)

Nope, looks like host matching is a little broken.  In the C code we
have pattern= but not in the config since we break it up for you.  Turns
out a few edge cases don't work, like (.*) and (.*).org if you just want
a TLD, etc.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Replying for any host

From:
Christopher Mahan
Date:
2010-08-30 @ 21:22
http://twitter.com/chris_mahan





On Mon, Aug 30, 2010 at 2:16 PM, Alex Gartrell <agartrell@cmu.edu> wrote:
> you actually have to use name= and pattern=.  name is the name (for the
> purpose of starting it) and pattern is the regex it matches against (.*)


How do I define the pattern in the m2sh startup command (do I need to)

and how do I define the default_host in the config file if the host has no name?



Chris Mahan
(818) 671-1709
http://christophermahan.com/
chris.mahan@gmail.com