Trying to run RoR 4.2.x + passenger 6.0.5 + apache 2.4.29 + Ubuntu 18.04

I created a new droplet with Ubuntu 18.04 and needed to run a Rails 4.2.1 app using PostgreSQL. I have successfully got the app running using Passenger standalone. I am able to access this from a React webapp with no issue. When I try and get this to run via an Apache front end using Passenger defined in a VirtualHost I am getting permissions errors.

[Wed Jun 03 22:08:29.273380 2020] [authz_core:error] [pid 6382:tid 140663413569280] [client] AH01630: client denied by server configuration: /var/www/html/

The only configuration directive I was able to find that looked related to /var/www/html permission was in the top level apache2.conf file.

<Directory /var/www> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>

Also, inside the default file, /etc/apache2/sites-available/000-default.conf, the DocumentRoot directive was “DocumentRoot /var/www/html”.

I am not even seeing any errors in /var/log/apache2/error.log related to my app trying to be served. There’s nothing in the app’s log directory.

Also, when I hit the server with my domain I am seeing the default Apache2 Ubuntu page. This is mapped via the default account and when I remove the file I see the permissions error. So it’s definitely processing the 000-default configuration but not my domain configuration and yes, it is enabled.

I have Rails apps running on older versions of Apache 2.2 and Passenger 4. This is bizarre. Also, I noticed that the Passenger process is running as root so maybe it’s a permissions thing, not certain.

Any help / pointers would be appreciated.

Thank you.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This question was answered by @bill.snapper:

Solved it. Turned out I needed to map the PassengerUser and PassengerGroup in order for this to run the application. This could have been done implicitly by adding a user and then placing the project with the same name as that user in a directory and Passenger would have figured it out.

Instead I chose to use the Passenger directives “PassengerUser” and “PassengerGroup” and set them to the user / group the app is mapped to.

View the original comment