Forum: Ruby on Rails How to make Apache start Puma automaticaly on a Rails app

C52a5e068c9ac5b57d0bd409d8e80f89?d=identicon&s=25 Exel Dev (Guest)
on 2013-07-28 12:39
(Received via mailing list)
Is there a way to get an Apache vhost to start Puma automatically on a
Rails app?

I'm installing Apache and Puma on a linux ubuntu 12.04 box, first I
tried
it with Passenger but it seemed quite slow compared to Puma.

Is there a preferred recommended setup that's more ideal?

Thanks,
The Dude Abides.
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2013-07-28 15:09
(Received via mailing list)
On Sun, Jul 28, 2013 at 12:40 AM, Exel Dev <exeldev@gmail.com> wrote:
> Is there a way to get an Apache vhost to start Puma automatically on a Rails
> app?

What is an "Apache vhost" ??

> I'm installing Apache and Puma on a linux ubuntu 12.04 box, first I tried it
> with Passenger but it seemed quite slow compared to Puma.
>
> Is there a preferred recommended setup that's more ideal?

I use nginx to proxy to Puma, but as far as "starting automatically"
the Linux-standard approach would be to write a start/stop script for
/etc/init.d/.  Alternatively, use something like monit to manage any
necessary processes (Puma, memcached, etc.)

HTH,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Aa082c8b00a50928e5860dcd70bf2368?d=identicon&s=25 tamouse m. (tamouse_m)
on 2013-07-29 02:32
(Received via mailing list)
On Jul 28, 2013, at 8:08 AM, Hassan Schroeder
<hassan.schroeder@gmail.com> wrote:

> On Sun, Jul 28, 2013 at 12:40 AM, Exel Dev <exeldev@gmail.com> wrote:
>> Is there a way to get an Apache vhost to start Puma automatically on a Rails
>> app?
>
> What is an "Apache vhost" ??

I hope this was just a joke. nginx is quite adept at dealing with
virtual hosting as well.

>
>> I'm installing Apache and Puma on a linux ubuntu 12.04 box, first I tried it
>> with Passenger but it seemed quite slow compared to Puma.
>>
>> Is there a preferred recommended setup that's more ideal?
>
> I use nginx to proxy to Puma, but as far as "starting automatically"
> the Linux-standard approach would be to write a start/stop script for
> /etc/init.d/.  Alternatively, use something like monit to manage any
> necessary processes (Puma, memcached, etc.)

What is ideal will always depend on your application and usage profile.
Many things work, some better than others, again, depending on each
case.

Hassan mentioned nginx, I am using nginx as well, with several unicorns.
I haven't done extensive research, I just knew that Apache+Passenger was
going to wreak havoc on my already bloated VPS. If you are just using a
single server the nginx+puma/thin/unicorn things works well.

Unless you are using your linux box for serving up multiple vhosts and
web apps in PHP, Perl, and such, it really makes more sense to me to put
in a trim, fast web server like nginx for tossing back static content,
and something to manage the Rails stuff such as puma.
C52a5e068c9ac5b57d0bd409d8e80f89?d=identicon&s=25 Exel Dev (Guest)
on 2013-07-29 08:45
(Received via mailing list)
Well my ideal situation would be Nginx with puma on the vps. However I
couldn't get nginx to recognize the vhosts based on the blog articles I
followed as examples, so I went to Apache/Passenger, but too slow. Then
Apache/Puma, much faster.

Thanks for your responses, can you point me to any article or
instructions
on how to get it setup with Nginx and Puma with a way for Puma to auto
start when Nginx starts.

I have some legacy coldfusion apps to move off a windows host, but I
think
I'll just put them on a separate vps and keep the Rails apps on its own
vps. The benchmarks seem to indicate Puma as being lightest/fastest at
this
time, it was a v noticeable diff between Passenger and Puma.
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2013-07-29 16:07
(Received via mailing list)
On Sun, Jul 28, 2013 at 11:44 PM, Exel Dev <exeldev@gmail.com> wrote:

> Thanks for your responses, can you point me to any article or instructions
> on how to get it setup with Nginx and Puma with a way for Puma to auto start
> when Nginx starts.

As far as the first part - have you been using the actual documentation,
e.g. http://wiki.nginx.org/ServerBlockExample ? I don't recall having
any
problems setting up nginx originally.

And as for the second part, I'll repeat:

>> > the Linux-standard approach would be to write a start/stop script for
>> > /etc/init.d/.  Alternatively, use something like monit to manage any
>> > necessary processes (Puma, memcached, etc.)

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.