Re: [Mojolicious] change from morbo to hypnotoad for multiple domains

2015-04-27 Thread mjb152
regex...works perfectly, thx.

I'm not using logging(), I'll play around some more with different configs, 
but the config is as basic as the code I posted above.

-- 
You received this message because you are subscribed to the Google Groups 
Mojolicious group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] change from morbo to hypnotoad for multiple domains

2015-04-27 Thread Jan Henning Thorsen
Pickup domain1 and domain2:

Oh! I've forgot to document that the matching headers can also take a 
regex. I will fix that later today.

So... you can either of these works:

# use a regex
mount test1 = {Host = qr/domain\d+\.com/};
# ...or mount the same app twice
mount test1 = {Host = domain1.com};
mount test1 = {Host = domain2.com};

I don't know why logging doesn't work. It should be something wrong in 
test1/test2, as long as you don't use logging 
https://metacpan.org/pod/Toadfarm::Manual::DSL#logging(). (But I'm 
guessing you *don't* use logging(), since it's not part of your example 
code). The only way for Toadfarm to take over logging from test1/test2 is 
if you have specified logging {combined=1}. See 
also https://metacpan.org/source/JHTHORSEN/Toadfarm-0.55/lib/Toadfarm.pm#L286 
and https://metacpan.org/pod/Toadfarm::Manual::DSL#logging


On Monday, April 27, 2015 at 11:26:30 AM UTC+2, mjb152 wrote:

 this code works without nginx, and I have 2 questions.

 I'd like to mount the first app to pickup both domain1.com , and 
 www.domain1.com , currently it doesn't. Is there a way to achieve that ?
 Secondly, no logging is being output to the normal log/development.log (in 
 each app), nor does it go to /var/log/toadfarm , I could combine them both 
 into 1 log, but I'd like to keep them separate if possible ?


 *mount /home/mojouser/apps/test1/script/test1 = { Host = domain1.com 
 http://domain1.com,   };*
 *mount /home/mojouser/apps/test2/script/test2 = { Host = domain2.com 
 http://domain2.com, };*

 *start [http://*:80];*


-- 
You received this message because you are subscribed to the Google Groups 
Mojolicious group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] change from morbo to hypnotoad for multiple domains

2015-04-27 Thread mjb152
this code works without nginx, and I have 2 questions.

I'd like to mount the first app to pickup both domain1.com , and 
www.domain1.com , currently it doesn't. Is there a way to achieve that ?
Secondly, no logging is being output to the normal log/development.log (in 
each app), nor does it go to /var/log/toadfarm , I could combine them both 
into 1 log, but I'd like to keep them separate if possible ?


*mount /home/mojouser/apps/test1/script/test1 = { Host = domain1.com, 
  };*
*mount /home/mojouser/apps/test2/script/test2 = { Host = domain2.com, 
};*

*start [http://*:80];*

-- 
You received this message because you are subscribed to the Google Groups 
Mojolicious group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


[Mojolicious] Config options for standalone M::L application running under prefork?

2015-04-27 Thread Charlie Brady

I see in Cookbook this standalone M::L app running under hypnotoad.

...
use Mojolicious::Lite;

app-config(hypnotoad = {listen = ['http://*:80']});

get '/' = {text = 'Hello Wor...ALL GLORY TO THE HYPNOTOAD!'};

app-start;
...

I want to do something very similar, but using prefork mode (to behave 
nicely under runit supervision, where the parent process is expected to 
survive until terminated).

I can't find a way to configure mode and options in-line, rather than 
provided via @ARGV.

Thanks for your advice...


Re: [Mojolicious] Config options for standalone M::L application running under prefork?

2015-04-27 Thread Charlie Brady

On Mon, 27 Apr 2015, Dan Book wrote:

 What do you mean by in-line? I'm not sure I follow the question.

I would like to have a file called 'run', which I can start using './run', 
which will start up in prefork mode, using listen parameters which are 
specified within the file 'run'.

 The prefork command takes command-line options:
 https://metacpan.org/pod/Mojolicious::Command::prefork

Yes, I know, but I would rather have one file than two, so I don't need a 
shell script which just does:

#! /bin/sh
./my_command prefork -l http://127.0.0.1:3006 -w 10 -c 1 [etc]

With hypnotoad I can have one file with:

...
#! /usr/bin/hypnotoad -foreground
...
app-config(hypnotoad = {listen = ['http://127.0.0.1:3006'], workers 
= 3});
...

 Otherwise if you just need hypnotoad to stay in the foreground (and you
 don't need hot-deployment) you can use hypnotoad -f.

As we've discussed recently on this list, hypnotoad doesn't play nicely 
under process supervisors such as runit, daemontools, etc. prefork was the 
recommended option.

https://groups.google.com/forum/#!msg/mojolicious/sgUj3obB6eU/HdTCgMhzrvYJ

 On Mon, Apr 27, 2015 at 4:11 PM, Charlie Brady 
 charlieb-m...@budge.apana.org.au wrote:
 
 
  I see in Cookbook this standalone M::L app running under hypnotoad.
 
  ...
  use Mojolicious::Lite;
 
  app-config(hypnotoad = {listen = ['http://*:80']});
 
  get '/' = {text = 'Hello Wor...ALL GLORY TO THE HYPNOTOAD!'};
 
  app-start;
  ...
 
  I want to do something very similar, but using prefork mode (to behave
  nicely under runit supervision, where the parent process is expected to
  survive until terminated).
 
  I can't find a way to configure mode and options in-line, rather than
  provided via @ARGV.
 
  Thanks for your advice...
 
 
 


Re: [Mojolicious] Config options for standalone M::L application running under prefork?

2015-04-27 Thread Dan Book
What do you mean by in-line? I'm not sure I follow the question.

The prefork command takes command-line options:
https://metacpan.org/pod/Mojolicious::Command::prefork

Otherwise if you just need hypnotoad to stay in the foreground (and you
don't need hot-deployment) you can use hypnotoad -f.

On Mon, Apr 27, 2015 at 4:11 PM, Charlie Brady 
charlieb-m...@budge.apana.org.au wrote:


 I see in Cookbook this standalone M::L app running under hypnotoad.

 ...
 use Mojolicious::Lite;

 app-config(hypnotoad = {listen = ['http://*:80']});

 get '/' = {text = 'Hello Wor...ALL GLORY TO THE HYPNOTOAD!'};

 app-start;
 ...

 I want to do something very similar, but using prefork mode (to behave
 nicely under runit supervision, where the parent process is expected to
 survive until terminated).

 I can't find a way to configure mode and options in-line, rather than
 provided via @ARGV.

 Thanks for your advice...


-- 
You received this message because you are subscribed to the Google Groups 
Mojolicious group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] [Security] Mojolicious 6.10 (user/group assignment)

2015-04-27 Thread Jan Henning Thorsen
These are the issues I know of:

* If you only specify user, then the workers will run with the groups of 
root.
* If you specify a group, then the workers will only run as that group 
and not all the secondary groups of the user you specified.


On Monday, April 27, 2015 at 10:39:57 AM UTC+2, Ludwig Nussel wrote:

 sri schrieb: 
  TLDR: The group assignment fix in Mojolicious 5.53 did not work out, 
  and you should now be using Mojolicious::Plugin::SetUserGroup. 
  
  Yesterday we've been made aware that the user/group assignment feature 
  of all our built-in web servers was still not working correctly. This 

 What was the problem exactly? 

 cu 
 Ludwig 

 -- 
   (o_   Ludwig Nussel 
   //\ 
   V_/_  http://www.suse.de/ 
 SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Jennifer 
 Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg) 
 Maxfeldstraße 5; 90409 Nürnberg; Germany 


-- 
You received this message because you are subscribed to the Google Groups 
Mojolicious group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Config options for standalone M::L application running under prefork?

2015-04-27 Thread Charlie Brady

On Mon, 27 Apr 2015, Dan Book wrote:

 What do you mean by in-line? I'm not sure I follow the question.
 
 The prefork command takes command-line options:
 https://metacpan.org/pod/Mojolicious::Command::prefork

OK, and I can use those as args to app-start(). Like so:

...
#! /usr/bin/perl
use Mojolicious::Lite;

get '/' = {text = 'Hello Wor...ALL GLORY TO THE HYPNOTOAD!'};

app-start('prefork', '--listen' = 'http:/127.0.0.1:3004');
...

Well almost...

[root@sdfsdfds netrestore_rest]# perl x
Use of uninitialized value in string eq at 
/usr/share/perl5/vendor_perl/Mojo/Server/Daemon.pm line 151.
Use of uninitialized value in string eq at 
/usr/share/perl5/vendor_perl/Mojo/Server/Daemon.pm line 175.
Server available at http:/127.0.0.1/*:3004.
^C[root@sdfsdfds netrestore_rest]#

That's with Mojolicious 5.50. I'll check again with most recent.


[Mojolicious] Re: Troubleshooting Hypnotoad Workers

2015-04-27 Thread sri


 I was hoping to be able to take advantage of hot swapping, but the service 
 manager does not appear to be able to support this.


This thread appears to have confused some folks. Nathan was specifically 
talking about a proprietary service manager with limited functionality, not 
some generic init system. For example systemd can handle daemonized 
processes and hot deployment perfectly well, as long as you have a PID file.

--
sebastian

-- 
You received this message because you are subscribed to the Google Groups 
Mojolicious group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.