Rails and https (ssl) running on linux - ruby-on-rails

I've been looking for tutorials how to start SSL on my localhost. But ones that I found was related to using nginx or apache. I'm wondering is it possible to use HTTPS(SSL) on localhost using usual ruby server (like webrick, thin, unicorn)?

Have you checked Thin with SSL support and ruby-debug
Additionally you will need your own certificate try this page http://hints.macworld.com/article.php?story=20041129143420344 for a step-by-step tutorial for osX

Related

SSL on DigitalOcean without Apache or Nginix

Ok, I am very new to this, so I'm very sorry If what I say does not make sense. I'm a ruby on rails developer and I want to host my web application using Digital Ocean. Now I installed Ubuntu 18.04, and I followed this article to deploy my rails app to my web server:
https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/standalone/oss/install_language_runtime.html
This article explains how to deploy a ruby on rails app to Digital Ocean using a library called Passenger. Nowhere in the installation do we install Apache or Nginx.
This is where the problem lies... Every tutorial or article I find are explanations on how to configure an SSL certificate with either Apache or Nginx. They use libraries such as Let's Encrypt. But, like I said, I'm not using Apache or Nginx. I'm using Passenger.
How can I implement an SSL certificate on my digital ocean droplet without needing Apache or Nginx. Or if any of you have any articles that can help me with this, I'd really appreciate it if you could share them. Thank you so much!
I don't know if you have found it or not but this is the official tutorial: Using SSL with Passenger in Production

Setting up multiple rails apps using nginx and Puma

I have a web server serving multiple Rails applications using a combination of nginx and Passenger. This is pretty straightforward, because the Passenger install sets-up pretty much everything you need to connect to nginx.
I found "Rails app with Puma" that seems to explain how to set up nginx and Puma together. How would this configuration need to be modified in order to serve a second Rails application on the same server?
Also, this guide doesn't say anything about restarting the application automatically if there is a system reboot or some other issue. Is there a way to do that? The nginx + Passenger combo seems to do it by default.

Starting Rails server on boot on CentOS

I'm pretty new to rails and trying to figure things out, I looked online but not much luck.
I have some servers that are running rails on startup without using rc.local at all, but I can't figure out why.
All I need is for rails to start on boot in production mode on port 80 (instead of 3000, as the rest of the servers also start on port 80).
Any ideas?
ATM relaying on webrick
Have a look at setting up nginx with ruby enterprise edition.
Check out Phusion Passenger. It supports both the standard Apache web server and Nginx web server.
http://www.modrails.com/

Mac OS X + Rails 3.1 + Unicorn + HTTPS

Here is my setup:
Mac OS X 10.6
Ruby 1.8.7
Rails 3.1
I have a Rails 3.1 application that starts with Unicorn every time this machine starts up (via a .plist in /Library/LaunchDaemons). The .plist essentially does this:
cd /my_application_directory
sudo unicorn -E production -p 80
And everything's working fine. However, I'd like to be able to set up SSL so that traffic is encrypted. I don't need a real certificate signed by a real CA, because the application is only accessible over a local network.
I've found articles like this one on generating certs, but I'm not sure where to go from there (or even if that's the correct starting place).
For my basic needs, I've found the .plist method to be much easier to work with than something like Phusion Passenger, so I'd like to continue doing it that way if possible.
Any help would be greatly appreciated!
I don't believe Unicorn supports being an SSL endpoint, so you're going to need another process to decrypt/encrypt the traffic for you.
On Mac, it's probably easiest to use apache, because it's already installed.
Sorry to not have detailed steps, but you're looking to do the following:
Change the port unicorn listens on, to prevent conflicts with apache.
Set up Apache to serve SSL, just like your linked reference.
Also set up apache to proxy requests to be handled by Unicorn, on the new port you setup. This involves the ProxyPass (and possibly ProxyPassReverse) directive.
Configure apache to start when the Mac boots.

Rails framework & Nginx web server

As we install rails it uses its own web server WEBrick. If i want to run ths application in Nginx server, then how to configure or set the Nginx web werver?
You should run your rails application in a production server such as mongrel_cluster or thin (I have used the former, and am currently switching to the latter). To put nginx in front of it, I would use the upstream and proxy_pass directives. I found a nice blog post comparing ways of running rails applications that shows their config for mongrel_cluster + nginx.
Passenger is also available for nginx, I've used that with Apache and it was very easy to set up.

Resources