Page 1 of 1

Ruby on Rails in Centos 7 using VestaCP

Posted: Tue Aug 13, 2019 10:16 pm
by mlopez
Have anyone make Ruby on Rails work on VestaCP?

I need to provide hosting for applications written on ROR and I have no idea how to install it.

Thank you in advance!

Re: Ruby on Rails in Centos 7 using VestaCP

Posted: Tue Aug 13, 2019 10:30 pm
by grayfolk
mlopez wrote:
Tue Aug 13, 2019 10:16 pm
Have anyone make Ruby on Rails work on VestaCP?

I need to provide hosting for applications written on ROR and I have no idea how to install it.

Thank you in advance!
Try to use search first.
search.php?keywords=ruby

Re: Ruby on Rails in Centos 7 using VestaCP

Posted: Thu Aug 22, 2019 10:14 am
by mlopez
grayfolk wrote:
Tue Aug 13, 2019 10:30 pm
Try to use search first.
search.php?keywords=ruby
Cool tip, @grayfolk but I had already search for it and I couldn't find anyone who has made it work.

Re: Ruby on Rails in Centos 7 using VestaCP

Posted: Thu Aug 22, 2019 10:25 am
by grayfolk
mlopez wrote:
Thu Aug 22, 2019 10:14 am
grayfolk wrote:
Tue Aug 13, 2019 10:30 pm
Try to use search first.
search.php?keywords=ruby
Cool tip, @grayfolk but I had already search for it and I couldn't find anyone who has made it work.
I'm use Passenger for RoR.
1. Install Ruby. You can use package manager or RVM.
2. Install Passenger for nginx.

I use this code in Vesta nginx template:

Code: Select all

root %docroot%/public;
passenger_enabled on;
passenger_ruby /usr/bin/ruby2.0; # Set to path of your Ruby
passenger_sticky_sessions on;
Try this. You can ask me if have any issues.

Re: Ruby on Rails in Centos 7 using VestaCP

Posted: Sun Aug 25, 2019 12:48 pm
by mlopez
grayfolk wrote:
Thu Aug 22, 2019 10:25 am
I'm use Passenger for RoR.
1. Install Ruby. You can use package manager or RVM.
2. Install Passenger for nginx.

I use this code in Vesta nginx template:

Code: Select all

root %docroot%/public;
passenger_enabled on;
passenger_ruby /usr/bin/ruby2.0; # Set to path of your Ruby
passenger_sticky_sessions on;
Try this. You can ask me if have any issues.
-------------------------------------------

grayfolk:

Thank you for the time you took to answer me. I followed your advice and I've got ruby installed in my server, but I've got a couple of issues. Firstly I tell you what I did:

--> I followed this tutorial for installing Passenger for nginx.

--> /etc/nginx/conf.d/passenger.conf contents are:

Code: Select all

passenger_root /usr/share/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;
passenger_instance_registry_dir /var/run/passenger-instreg;
--> I get ruby path using which:

Code: Select all

which ruby                                           
/usr/local/rvm/rubies/ruby-2.6.3/bin/ruby
--> I've created this template file /usr/local/vesta/data/templates/web/nginx/ror.tpl

Code: Select all

root %docroot%/public;
passenger_enabled on; 
passenger_ruby /usr/local/rvm/rubies/ruby-2.6.3/bin/ruby;
passenger_sticky_sessions on; 
and made it executable, like the others template files:

Code: Select all

chmod +x /usr/local/vesta/data/templates/web/nginx/ror.tpl
Issues:

1.- Command passenger-config validate-install returns:

Code: Select all

What would you like to validate?
Use <space> to select.
If the menu doesn't display correctly, press '!'

 ‣ ⬢  Passenger itself
   ⬡  Apache

-------------------------------------------------------------------------

 * Checking whether this Passenger install is in PATH... ✓
 * Checking whether there are no other Passenger installations... (!)

   You are currently validating against Phusion Passenger 6.0.2, located in:
   
     /usr/bin/passenger
   
   Besides this Passenger installation, the following other
   Passenger installations have also been detected:
   
     /usr/share/passenger
   
   Please uninstall these other Passenger installations to avoid
   confusion or conflicts.

Detected 0 error(s), 1 warning(s).
2.- Command passenger-memory-stats returns:

Code: Select all

Version: 6.0.2
Date   : 2019-08-25 09:36:10 -0300

--------- Apache processes ----------
PID    PPID  VMSize    Private  Name
-------------------------------------
2986   1     474.8 MB  1.4 MB   /usr/sbin/httpd -DFOREGROUND
21640  2986  233.9 MB  4.3 MB   /usr/sbin/httpd -DFOREGROUND
21641  2986  474.9 MB  0.5 MB   /usr/sbin/httpd -DFOREGROUND
21642  2986  474.9 MB  0.5 MB   /usr/sbin/httpd -DFOREGROUND
21643  2986  474.9 MB  0.5 MB   /usr/sbin/httpd -DFOREGROUND
21644  2986  474.9 MB  0.5 MB   /usr/sbin/httpd -DFOREGROUND
21645  2986  576.4 MB  2.7 MB   /usr/sbin/httpd -DFOREGROUND
### Processes: 7
### Total private dirty RSS: 10.27 MB


---------- Nginx processes -----------
PID    PPID   VMSize    Private  Name
--------------------------------------
30926  1      133.9 MB  0.4 MB   nginx: master process /usr/sbin/nginx
30929  30926  134.1 MB  0.9 MB   nginx: worker process
30930  30926  133.9 MB  0.6 MB   nginx: cache manager process
### Processes: 3
### Total private dirty RSS: 1.94 MB


----- Passenger processes -----
PID    VMSize    Private  Name
-------------------------------
30911  354.8 MB  1.8 MB   Passenger watchdog
30914  650.1 MB  3.5 MB   Passenger core
### Processes: 2
### Total private dirty RSS: 5.32 MB
Questions:

1.- Why are there 2 installations of Passenger?
2.- Is ror.tpl the only file I need to create to enable RubyOnRails?
3.- Do I need a ror.stpl and/or a ror.sh file?

Best regards,

Mauricio

Re: Ruby on Rails in Centos 7 using VestaCP

Posted: Sun Aug 25, 2019 1:09 pm
by grayfolk
mlopez wrote:
Sun Aug 25, 2019 12:48 pm
and made it executable, like the others template files:

Code: Select all

chmod +x /usr/local/vesta/data/templates/web/nginx/ror.tpl
This is not need.
mlopez wrote:
Sun Aug 25, 2019 12:48 pm

1.- Why are there 2 installations of Passenger?
2.- Is ror.tpl the only file I need to create to enable RubyOnRails?
3.- Do I need a ror.stpl and/or a ror.sh file?
1. Dont know, try to install again.
2-3. ror.sh not need. .tpl for http .stpl for https. Strongly recommended to create both.