Google Groups Home Help | Sign in
Recent pages and files
Installation Instructions    

At this time SwitchPipe has only been tested on Linux and OS X installations, both running Ruby 1.8.6 and RubyGems. It is likely to work on other platforms, however, and you are encouraged to post your findings in the Discussion board.


Getting SwitchPipe


At the current time, SwitchPipe is only accessible via SVN or a tarball. Information about both are available at http://switchpipe.org/ (or you can get the 1.04 tarball here). Alternatively, if you wish to be risky and run SwitchPipe's edge / trunk version, check out like so:


  # svn co http://switchpipe.org/switchpipe1/trunk switchpipe

 

To See A Quick Demo

 

A demo script at script/demo has been created that installs dependencies, sets up a basic config file, runs SwitchPipe, does a single request to a backend application, and then cleans up.. all without you doing anything (except perhaps typing your password). Ideally you will take a quick look at this file before running it to make sure it does nothing you find distasteful. The only "dangerous" thing it does is use "sudo gem install" on a few gems, but you might still want to check. In any case, run like so:


  # ./script/demo


Note that you MUST run it from the base SwitchPipe directory.

 

Manual Installation and Testing 

  

Step 1: Install dependencies

 
  # sudo gem install daemons eventmachine open4

 
Step 2: Get a configuration file in place

 

The easiest technique when just starting out is to copy the example configuration file to config.yml. There aren't many settings in there and it should work well enough to give SwitchPipe a basic test.


  # cp config.yml.example config.yml
 

Step 3: Get the configs for the demo apps into the apps directory

 

Move application configurations for the demo apps into the "apps" directory:


  # mv demo_apps/*.yml apps/

 

Step 4: Run SwitchPipe!

 

Run SwitchPipe as an interactive process:
  # ./script/switchpipe run
 

Step 5: Give it a test 

 

Visit these URLs in a browser:
  http://127.0.0.1:10000/webrick_thing/hello
  http://127.0.0.1:10000/python_http_server/ (won't run unless Python is installed)
  http://127.0.0.1:10000/camping_demo_app/ (won't run unless Camping is installed)

(Later on, if you like, you can set up the apps with hostnames in their config files to avoid using the subdirectory technique..) 

 

You should notice SwitchPipe start and manage the relevant processes, killing them whenever the timeouts kick in. Use CTRL+C to break out of SwitchPipe's non-daemonized mode.

 

Step 6: Put SwitchPipe Somewhere Proper

 

Ideally:

 

  # sudo mkdir /usr/local/switchpipe

  # cp -r * /usr/local/switchpipe/
 

Note: Other documentation on this site assumes SwitchPipe is installed in /usr/local/switchpipe 


Further steps

 

Beyond the stage of just testing SwitchPipe out, you will want to create configuration files for your own applications in the 'apps' folder, set up proxy settings from Apache (or nginx, etc) to SwitchPipe, and run SwitchPipe as a daemonized process. Detailed information about setting up an application of your own with SwitchPipe is available.

 

Running SwitchPipe as a Daemonized Process


To run SwitchPipe as a background process:


  # ./script/switchpipe start


To stop SwitchPipe:


  # ./script/switchpipe stop

 

Setting Up SwitchPipe as a "service" on Linux


SwitchPipe comes with a script designed for running as a service, accessible via /etc/init.d (and as a result, through "service" on RedHat-esque distributions). This script is located at script/initdscript. Firstly, however, SwitchPipe needs to be "installed" in a standard location. By default it will be assumed your SwitchPipe directory is /usr/local/switchpipe. If it is not, you will need to edit the init.d script, as it contains a constant variable at the top with SwitchPipe's path.

 

To get the init.d script running once SwitchPipe is "installed":

 

  # cp script/initdscript /etc/init.d/switchpipe

  # chmod +x /etc/init.d/switchpipe

 

(alternatively you could use a symbolic link, which would give the benefit of allowing updates of SwitchPipe to update the init.d script automatically..)

 

To test:

 

  # /etc/init.d/switchpipe start

  # /etc/init.d/switchpipe stop

 

or

 

  # service switchpipe start

  # service switchpipe stop

 

To make SwitchPipe run automatically at boot:

 

  # chkconfig --add switchpipe

 

 ...


Version: 
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google