jump to navigation

Passenger with Rails 2.3 application (MissingSourceFile) March 1, 2009

Posted by John Dewey in Apache, New Category, Passenger, WebServers.
11 comments

I’m such an idiot. I spent the last few days, trying to figure out the following error reported on my Ubuntu 8.10 Passenger install.

Error message:
no such file to load -- application (MissingSourceFile)

Exception class:
Passenger::UnknownError

I was installing libapache2-mod-passenger_2.0.3 from the apt-get repo, which does not understand the application_controller.rb rename.

2.0.6 mod-passenger has yet to show up in the apt-get repo. You can use these instructions to install the brightbox mod-passenger build.

Advertisements

chef-solo VPS provisioning February 21, 2009

Posted by John Dewey in Apache, Automation, Chef, Code, Configuration.
add a comment

I probably built a naive chef solo configuration. I also know I could have used one of the many “Ready Stack” solutions VPS providers are creating. However, I like my systems setup a particular way.

Take a peek the configuration is pretty cool. The code is on github.

Ideally chef would have built my system from the ground up, installing ruby, libs, etc… Since I do not control this piece, there are a few prerequisites to setting up chef.

Once complete, drop in your virtualhost, and deploy your code. This is not intended as zero-conf. Merely a standard base configuration for all of my hosts.

mrocstat – Mongrel pROCess title information stats August 18, 2008

Posted by John Dewey in Command Line, Mongrel, Plugins & Gems, Ruby, WebServers.
add a comment

I wrote a little tool which reports Mongrel’s process title information when using the mongrel_proctitle plugin. There is a gem which reports similar information, however, I like bundling utility scripts as SVN externals with my applications.

You can find the script on github.

Disable mongrel mod_proxy_balancer workers via Capistrano August 15, 2008

Posted by John Dewey in Capistrano, Configuration, Deployment, Mongrel, Rails, WebServers.
add a comment

I created a Capistrano task for disabling workers inside a given balancer, from Daniel Wharton’s Deploying Rails post.

Here’s the pastie. BTW I really hate linking off to pastie for these things. Any suggestions?

The task disables the worker, and is not specific to Mongrel.

Multi-App Mongrel Cluster Init Script January 22, 2008

Posted by John Dewey in Capistrano, Configuration, Deployment, Mongrel, Rails.
2 comments

I found the mongrel_cluster.sh script, everyone uses — doesn’t quite cut it.   Especially, when a system may host several RoR applications.  Why, you ask?  The ability to easily control, and dynamically discover applications is missing.  In most cases, this doesn’t matter.  Especially when the applications are deployed with Capistrano, since it is leveraged for various tasks (including stop, starts, and restarts).

The SAs on the other hand, usually do not use Capistrano (they should!), or have a recent version of the app checked out.  Having a standard init script across all your applications and servers becomes useful.

You get bonus points for dynamically discovering new application installs.We can make certain assumptions in our environment.

We use Capistrano, apps run as the same user,  live under the same base directory, and link to common Subversion Rake tasks.  That enables the use of a generic Rake task to control all RoR applications. Furthermore, the Rake task can be wrapped by a system init script for use under /etc/init.d/.

Scrape mongrel status from Apache’s mod_proxy_balancer January 4, 2008

Posted by John Dewey in Apache, Capistrano, Code, Command Line, Configuration, Example, Rails, Rake, WebServers.
1 comment so far

Access to Apache’s load balancer manager (mod_proxy_balancer) is typically protected.  Rather than maintaining an ever changing list of ACLs or configuring HTTP authentication, I wrote a simple scraper Rake task.

This task is bundled with all of our rails applications as a svn external, and included in our common Capistrano tasks.This task is a quick and dirty solution to checking the status of your Mongrels.

Feel free to modify, and provide a pastie.http://pastie.caboo.se/135223

P.S. The SAs can plug this into their monitoring software as well.

Track which mongrel handled a request December 26, 2007

Posted by John Dewey in Code, Configuration, Example, Mongrel, Rails, WebServers.
add a comment

I wrote a plugin which collects system information, and returns the data as HTML comments at the bottom of the page. When running multi-system / multi-Mongrel environments, knowing which server and Mongrel handled a request is paramount.

Unfortunately, getting a handle on this information is difficult, since ‘request.port’, ‘request.env[‘HTTP_HOST’], and ‘request.env[‘SERVER_PORT’], display the origin port, when your Mongrels are behind a reverse proxy.

Ezra clued me into a nice hack.You can add the following code to environment.rb, or in our case the plugin’s init.rb.

Apache mod_rewrite maintenance.html woes December 15, 2007

Posted by John Dewey in Apache, Configuration, Rails, WebServers.
add a comment

Every self.respecting Rails site, has a configuring Rails with Apache section.

The recipe contains a mod_rewrite rule, allowing staff to dynamically enable or disable maintenance mode. The mod_rewrite rule, however, does not work on Solaris, OS X or systems with a ‘/system’ directory.

I have notified the Pragmatic Studio folks, and Charles (who wrote the documentation hosted at http://mongrel.rubyforge.org/).  Below are further details of the problem, along with a solution.  Hopefully the word gets out.