1

I am trying to have two Rails applications run on the same Virtual Private Server. I have only one domain name, so if the first app is example.com, the second app I am guessing would need to be example.com/second_app. I tried following this article, since it appeared to be using the same tech as me (Passenger): https://beforeitwasround.com/2013/03/serving-multiple-rails-apps-under-one-virtual-host-with-phusion-passenger.html

Before taking the steps in that article, I deployed my second app to the server using the same instructions as the currently working first app (up to, but not including the part where you add a VirtualHost/config file for the app): https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/digital_ocean/apache/oss/trusty/deploy_app.html

And I even restarted the primary app using the following command from the first app's directory: passenger-config restart-app $(pwd)

The first app is still working, however, first_app.com/second_app does not appear to work as described in the first article. I am guessing there is a ton of knowledge assumed, however I am just starting with Rails, and am learning as I go. Do I need to create a VirtualHost/config file for the second app?

My specifics: VPS: Digital Ocean Ruby: 2.3.4 Rails: 4.2.5 Ubuntu: 16.04 Apache: 2.4.18 Passenger

S. Harper
  • 167
  • 9

1 Answers1

0

So, I figured out what I didn't know to do. That is, I did not restart apache after editing the VirtualHost/config file:

sudo apache2ctl restart

Which then gave me the error: "AH00526: Syntax error on line 19 of /etc/apache2/sites-enabled/test_app.conf: Either all Options must start with + or -, or no Option may"

Upon googling the error, It appears that there was a syntax error in the code from the article I read. Which doesn't surprise me, as the article is 4-5 years old. But i'm surprised that it was as easy as changing:

Options Indexes FollowSymLinks -MultiViews

to

Options +Indexes +FollowSymLinks -MultiViews

My second app now correctly shows when I go to the link now! Very psyched.

S. Harper
  • 167
  • 9