Rv

A little init.d system for running Camping apps.

License

Copyright 2007 Cloudburst, LLC. See the included LICENSE file.

Features

  • cluster support

  • custom database configuration

  • automated setup tasks

Linux is required. Ubuntu is known to work; Gentoo should work; others should work with minor or no changes.

Installation

First, run:

sudo gem install rv
sudo rv install

Now you have a file /etc/init.d/rv. Open it and change the 'user' keypair in the file if your app user is not httpd. There are a few other options you can set; see the Rv class for details.

Now, install it as a boot service. On Ubuntu, run:

sudo /usr/sbin/update-rc.d /etc/init.d/rv defaults

On Gentoo, run:

sudo rc-update add rv default

Application setup

Each Camping app should live in its own directory. Traverse to this directory and run:

sudo rv setup

It will now start at boot. You can start it manually (along with your other Rv apps) by running:

sudo /etc/init.d/rv start

Check /var/log/rv.log as well as the application log if you’re having problems.

Apache configuration

If you’re using Apache 2.2, here’s how to configure it to see your Camping proxy. Add a VirtualHost entry in your httpd.conf as follows:

<VirtualHost *:80>
  ServerName myapp.example.com

  ProxyRequests Off
  ProxyPass / http://127.0.0.1:4000/
  ProxyPassReverse / http://127.0.0.1:4000/
  ProxyPreserveHost On

  #Fix for Apache bug 39499
  SetEnv force-proxy-request-1.0 1
  SetEnv proxy-nokeepalive 1
</VirtualHost>

If you configured a cluster, use a Proxy balancer instead:

<Proxy balancer://myapp_custer>
  BalancerMember http://127.0.0.1:4000
  BalancerMember http://127.0.0.1:4001
  BalancerMember http://127.0.0.1:4002
  # etc.
</Proxy>

and then configure your ProxyPass to point to the balancer:

ProxyPass / balancer://myapp_custer/
ProxyPassReverse / balancer://myapp_custer/

Do not use the line ProxyRequests Off.

Further resources