I think the answers depends on your situation, but here is what I do, both 
at work and in personal projects:

1. Deploy with morbo, plackup, hypnotoad
"morbo" is not a best practice. You need very specific reasons to use that 
in production. "morbo" is for development, because it has the ability to 
restart the server when files on disk are changed. I don't know much about 
"plackup", but what I do know is that it will render the non-blocking 
features in Mojolicious useless. So if you have any place where you use a 
callback, a delay or something else non-blocking i would recommend NOT 
using anything that use plack.

In production I would use "hypnotoad" if you are on some unix based system 
and "prefork" if you are on windows. Both are indeed very fast web servers 
and they fork "workers" so you can handle multiple requests, even if your 
application is "blocking". Multiple workers are also a good idea if you are 
writing non-blocking applications, since it allows Perl to use multiple 
CPUs.

The only reason I see for using plackup is if you have a legacy plack 
application that have to run in the same process.

2. Stopping the processes.
"hypnotoad" can be be stopped with "hypnotoad -s /path/to/youapp.pl". The 
other servers (prefork, daemon, morbo) run in the foreground, so you just 
need to kill them yourself. I don't know of any init scripts, but it should 
be easy enough to write one, since they run in the foreground.

3. mod_perl/mod_proxy
Yes. mod_proxy is a good idea. I think the setup I've seen the most is 
using "nginx" in front of "hypnotoad". nginx is often used instead of 
Apache, especially when all you need is "mod_proxy".

4. Webserver neutral deployment
Not sure if I understand the question. Mojolicious already detects the 
environment it is running in. The most neutral deployment (in my opinion) 
is to use a reverse proxy config in the frontend web server.

5. Plack
Why are you looking at Plack? Do you have any existing Plack apps? If so: 
Start Mojolicious using hypnotoad and then the plack app in a different 
Starman server. If you don't have any Plack apps: Don't use any plack tools!


On Monday, February 29, 2016 at 2:30:16 PM UTC+1, 
[email protected] wrote:
>
> Hello Charlie,
>
> Here is a summary of actions i tried based on the postings posted by you, 
> Thorsen and Luc.
>
> 1. Used morbo and mod_proxy and verified changes to controllers and 
> templates are respected without restarting morbo
>
> morbo -w lib/ -w templates/ script/my_app -l "http://*:2999";
>
> There is no change in mod_proxy configuration i have posted earlier
>
> 2. Used plackup and mod_proxy and verified changes to controllers and 
> templates are respected without killing and restarting plackup
>
> plackup -R templates/ ./script/my_app -l localhost:2999
>
>
>
>
> *Here are my questions*
>
> 1. What is the best practice to deploy a mojolicious app to production? 
> should i stick to morbo or plackup or hypnotoad? 
>
> 2. How do we stop these middleware(morbo/plackup/hypnotoad) instead of 
> killing them using ctrl +C in development mode? Should i just create a 
> shell script to kill the process using pid? 
>
> 3. I undertstand from one of the earlier posts, using mod_perl may not be 
> a good idea. Is it ok to use mod_proxy?
>
> 4. Even though the requirement is to deploy our app on apache, would it be 
> possible to create a webserver neutral deployment? I have tried going 
> through psgi materials but i was stuck with the same routing issue i posted 
> earlier.
>
> Any help on this would be appreciated.
>
>
>
> On Saturday, February 27, 2016 at 8:59:09 PM UTC+5:30, Charlie Brady wrote:
>>
>>
>> On Fri, 26 Feb 2016, [email protected] wrote: 
>>
>> > just add a look of above link (mod_proxy). How does the virtual host 
>> config 
>> > will get addressed to the project directory (Mojo App) ? 
>>
>> You need to run the mojo app on a different port nnnn (e.g. by using 
>> hypnotoad). Then you configure mod_proxy to proxy the virtual host to 
>> localhost:nnnn. 
>>
>> The mod_proxy configuration doesn't need to know anything about the 
>> project directory - just what port (nnnn) the application is bound to. 
>>
>> Read the docs that Luc provided a link to. 
>>
>>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to