I have a server (ubuntu) which runs some Rails app with Apache & Phusion Passenger.
Every Rails app stopped to work since I upgraded Apache to 2.18.
The server always respond with a 403 status (forbidden) but the public/ directory is not private (I can access via http any .html, .jpg, etc... inside it).
In error.log from Apache there are some entries like:
No matching DirectoryIndex (none) found, and server-generated directory index forbidden by Options directive
Anyone has any idea?
UPDATE:
I managed to solve this issue reinstalling (purge than install) Apache 2.4 and Passenger (and all its dependencies). Running ok with Apache 2.4.18 and Passenger 5.
Related
Using Passenger Standalone on version 5.1.12 works just fine. All the routes to rails and it's specified ports in nginx configs pull up great.
But after that version, the app's routing returns a 404. Also subsequent reload causes images to go missing. Then back again tot he routing 404 on the next reload.
Has anyone faced the same issue and any solutions out there?
I'm running a rails app in prodction with nginx an apache2.
The application starts properly, but the assets were not served by nginx. The Assets are under public/assets available.
But nginx says 404 Not Found.
any ideas how to solve this issue?
its a debian server with plesk17
Apache config looks like this:
restarting server and resassign ssl certificate solves my problem
So I've bought and set up my DigitalOcean Ubuntu 14.04 Droplet, set up SSH keys, bought a domain name, transfered my app to the DigitalOcean cloud server using Filezilla and install Passenger with NGINX. It took a lot of trial, error and research but I've learned a lot from it.
The problem is, I still can't get the it to work! When I start my $rails s -e production in the cloud, I noticed it still uses Webrick despite already installing NGINX. I also get a 500 Internal Service Error from NGINX when I visit my website's IP address.
Its likely that I did something wrong, but due to my inexperience, I have no way of really knowing what procedure was incorrect/skipped. Maybe something with Capistrano? my secret keys still need some work done, not sure :/
Can someone help me out?
My checklist:
Install Ruby and Rails and bundle install in my Cloud Server [done]
Install NGINX and Passenger following the tutorial at: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-nginx-on-ubuntu-14-04 [done]
Edited my NGINX config file to:
server {
listen 80 default_server;
server_name 45.55.136.43;
passenger_enabled on;
passenger_app_env production;
root /origins/public;
}
After updating to OS X Maverick on my MacBook, my local dev environment was broken - Apache httpd.h file missing on MacOSX after Mavericks Upgrade (** Updated for Yosemite **)
Now after resolving the issues I can't seem to run my local web server on port 80 (localhost).
If I go to 'localhost' I see It works! which is the default apache page.
If I run passenger start I can view my app at localhost:3000 but that's a passenger standalone web server running, not apache.
If I run sudo passenger start -p 80 --user=martin I get the message:
The address 0.0.0.0:80 is already in use by another process,
perhaps another Phusion Passenger Standalone instance.
If you want to run this Phusion Passenger Standalone instance on another port,
use the -p option, like this:
passenger start -p 81
I can't remember what I did when I first set up Rails on my laptop, I'm sure I ran passenger start at the very beginning and didn't need to do it after that and from reading more about it online, apache should run passenger automatically by itself but apache doesn't seem to be doing anything but show the default start page and I don't know why.
I think Maverick created a new httpd.conf but I don't see much difference, I have made sure that the three extra lines running passenger-install-apache2-module returns is at the end of the config file.
The passenger gem is the latest version, Rails version is 2.3.14 and ruby is 1.8.7 so quite old but shouldn't matter I don't think as it worked perfectly on localhost before without having to add port 3000 to the url so just hoping someone with a bit more experience of using Passenger can help.
I've tried reading loads of other questions and forums and also the Phusion Apache documentation.
`
I had the same problem. I restored the previous httpd.conf file in /etc/apache2. The file had been renamed httpd.conf.pre-update. I restarted the server with apachectl restart and all was fine again.
I checked the differences between the old and new httpd.conf files, and they were very small (but crucial):
1) The line to include virtual hosts was commented out.
2) The line to include the PHP module was commented out.
I uncommented both lines and problem solved.
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.