passenger

Seamless deployment in Rails

I would like to seamlessly upgrade my Rails app: Meaning: If no migrations need to run I would like to transparently upgrade the code and have no requests go 404 during the deployment. This is hard I would like to have some process that can upgrade the database seamlessly and during that time just hold back on the web requests (que...

Sinatra on Passenger always fails on first attempt

I have a small Sinatra app I'm running on a shared hosting account using Passenger. However, the first time the app is accessed after a while, I get a Passenger error page saying the application could not be started. Usually because Sinatra could not be found. I am assuming this is just a normal delay from when a new instance is spawned...

What should my Nginx rewrite rules be for Rails with Passenger for page caching in a subdirectory?

I'm using Nginx 0.7.64, Passenger 2.2.9, Rails 2.3.5. I have my page caching directory set to /public/cache, and I'd like to be able to serve cached pages when requested over HTTP, but always hit the Rails app when requested over HTTPS. The bulk of my config looks like this: server { listen 80; server_name website.com www.website....

How to show errors that occur in a modular Sinatra Application which is hosted by Passenger?

I have an application class class MyApplication < Sinatra::Base # ... do something ... end and a config.ru file # ... load libraries ... run MyApplication I usually use Passenger as my development environment which works perfectly fine for a normal – non-modular – Sinatra application. But in this case I have no error output inste...

Deploy rails app to non-root context - restful_auth not working

I'm running a rails app on http://www.naildrivin5.com/scalatour. It works fine. When I log in to the app using restful_authentication, I get taken to the http://www.naildrivin5.com instead of the app. Weird. This seems like I've misconfigured something. Further, there's a few places where I'm hand-creating some urls, and I need ac...

Passenger+nginx: Hosting a Rails application in a subdirectory

I'm trying to deploy an application in a subdirectory /a under www.myserver.com, following the steps in the Passenger docs here: http://www.modrails.com/documentation/Users%20guide.html#deploying_rails_to_sub_uri This seems to work, but the Rails routes are now all expecting the additional subdirectory /a, such that trying to access the...

Rails file upload size limit

Does anyone know a good solution to limit the file upload size when running a Rails application with Passenger/mod_rails. The request should immediately be declined, so that the file doesn't get transferred to the server. The solutions I've found so far all describe how to patch Mongrel to implement a limitation, but I have to use passe...

Passenger hosted Rails app *painfully* slow, but the server is a beast...

I have been working to deploy a relatively large Rails app (Rails 2.3.5) and recently doing some load testing we discovered that the throughput for the site is way below the expected level of traffic. We were running on a standard 32bit server, 3GB of RAM with Centos, and we were running Ruby Enterprise Edition (latest build), Passenger...

Does Phusion Passenger restart gracefully when I touch restart.txt

Will it finish serving all current requests before it restarts? ...

Rufus scheduler not logging in production

My rails app kicks off a process with rufus-scheduler in an initializer. Here's a stripped-down version of the initializer's code: # config.logger isn't available here, so we have to grab it from the Rails object logger = RAILS_DEFAULT_LOGGER logger.warn(Time.now.to_s + ": Starting Rufus Scheduler") # run every Wednesday at 10 AM cro...

CruiseControl.rb PATH

I'm trying to get CruiseControl.rb to run rcov during a build. It's currently failing with the following error: sh: rcov: not found Since I can run rcov from the shell when I log in, I figure that this is a PATH problem. (Additionally, I can run both rake test:rcov and rake cruise from the shell without errors). I added a p 'echo $PA...

Passenger installation with nginx fails

Hi all, I'm running an ubuntu 9.10 server on an amd-64 platform. Everything's pretty much standard, and I've got Sinatra 0.94 running on a ruby 1.8 installation. I want to install passenger in order to easily configure ssl. The problem is, it fails to find the installer. I run sudo gem install passenger or sudo gem install -r ...

jQuery with Rails when deployed to multiple subURIs

Hey. So I have a Rails app that's getting deployed to a production machine that serves it via Apache/Passenger to two subURIs. /app /app_2 both the above subURIs are running the same codebase. It's just two symlinks to the public dir that are both pointed to via Passenger by: RailsBaseURI "/app" RailsBaseURI "/app_2" Now, imma big ...

Capistrano to deploy rails application - how to handle long migrations?

So I am using Capistrano to deploy a rails application to my production server (apache+passenger) and at the moment deployment usually goes along the lines: $cap deploy $cap deploy:migrations It got me wondering, let's say my db:migrations took a long time to execute on the production server (a big refactor of the db schema) - in this...

Rails keeps being rebooted in production Passenger

I'm running an application that kicks off a Rufus Scheduler process in an initializer. The application is running with Passenger in production and I've noticed a couple weird behaviors: First, in order to restart the server and make sure the initializer gets run, you have to both touch tmp/restart.txt and load the app in a browser. At t...

Rails, Apache2 on Ubuntu (karmic) deployment

I just need some clarification on a couple of files. My site has an admin subdomain and SSL in addition to the normal *:80 details found in the virtual hosts. My question(s): Do I need to specify a 1) ServerName and 2) DocumentRoot in: /etc/apache2/apache2.conf? I currently enable my site from this directory: /etc/apache2/sites-availa...

Is it possible to tell the difference between an automatic and manual restart in Phusion Passenger?

I have a process I'd only like to run when I manually reboot my Rails app by touching tmp/restart.txt, not when Passenger restarts itself after an idle period. Is there anything I can check in my Rails code to determine whether a given reboot was one or the other? ...

mod_passenger, threads and singleton classes

I have a question regarding mod_passenger and Singleton classes (rails 2.3.5 and ruby 1.9.1). In my aplication, I have a Singleton class that implements a thread pool (thread safe). Also there is controller to manage all the threads (kill and start them). This controller uses the previous singleton class to do the actions over the thre...

Passenger 2.2.9 Ruby EE Ubuntu.. Can't get it to use 'default' production environment

Using Apache2 (2.2.12) / Passenger (2.2.9).. Have 2 apps running.. One runs fine in production mode the other insists on being in development mode. Have booted mongrel into production mode and the app works fine.. (script/server -e production) Tried the following with no result... Forced the RailsEnv in the apache virtual host. For...

looking for a Python based web-app to serve files

I am looking for a Python-based alternatives for AutoIndex PHP Script. Preferably it runs under WSGI. The features of AutoIndex are listed here and there is also a live demo. Note: + I'm not looking for a web server. My shared web hosting doesn't allow me to run my own background process. + Neither am I looking for web frameworks (I am...