

Now add gem "passenger", ">= 5.0.25", require: "phusion_passenger/rack_handler" (the Passenger gem) below the commented out Puma gem.Īdd the Passenger packages into Ubuntu with the following sudo commands.If it's there, "comment out" the Puma gem in the Gemfile by placing a # at the beginning of the Puma gem line.Run sudo nano Gemfile to edit the Gemfile.

Navigate to the applications "backend" folder, if not there already, with cd /var/www/etcpasswdapp/backend.Step 3: Accessing Rails Routes Step 1: Adding in an Application Serverįirst thing first is to add Passenger into the server to be used. Step 2: Setting Apache Passenger configuration That being said, if you created your own Rails API from scratch for this you might not want to use Passenger and use a straight PHP interface or Puma instead. Though I was originally using Puma as a stand alone server, and because it's Heroku's Recommended Ruby Webserver, this section will be about my process of changing over to the Application Server, Passenger, to help handle the Ruby on Rails routing and how I dealt with CORS for my API. You could use an Apache module, like Phusion Passenger, to manage the processes and any needed reverse proxying.You could set up Apache with a reverse proxy for a stand alone Rack-specific web server, like Puma or Unicorn.This is where an Application Server, like Phusion Passenger or Apache Tomcat, or a Rack-compatible web server, like Puma, are needed to process the dynamic content requests got the HTTP server.īecause I had built a Rack specific application there are, like always, a few ways you could set this up. See, for a dynamic application like a Rails API there needs to be some kind of Rack-Compatible Server to handle the incoming requests that the HTTP server isn't able to process.
#RAILS UNICORN HTTPS APACHE HOW TO#
This is because the Apache HTTP Server doesn't know how to communicate with the Ruby API. At this point basically everything is set up but you probably can't access anything yet or your may only be able to see a landing page with no useful information on it.
