This page documents the process of using Phusion Passenger to deploy an example Ruby on Rails application on Bytemark Symbiosis.
We’re going to use the standard passenger example application. To get started, you’ll need to install both passenger & git.
- Login to your Symbiosis server over ssh as the
adminuser and install passenger and git. This should automatically enable the Apache module, and restart the webserver.
$ sudo apt-get install libapache2-mod-passenger git
- The sample application also has a few additional dependencies. Note that this may vary for other applications.
$ sudo apt-get install ruby-dev bundler \ libxml2-dev zlib1g-dev libsqlite3-dev nodejs
Now that we’ve installed passenger, you need to use
git to clone the sample application code to your server. Symbiosis uses directories to configure domains, websites & email (virtual hosts). Directories for each of your domains can be created under the
/srv directory and Symbiosis will automatically configure them as per documentation.
- Pick a hostname beneath which to run your example app, e.g.
app.my-brilliant-site.com, and create the directory.
$ mkdir /srv/app.my-brilliant-site.com/ $ cd /srv/app.my-brilliant-site.com/
- The application code should be checked out into the
publicdirectory. If this directoy already exists, you should (re)move it first.
$ git clone https://github.com/phusion/passenger-ruby-app-demo.git public $ cd /srv/app.my-brilliant-site.com/public
- This particular application uses the end_result branch for the passenger-enabled code.
$ git checkout end_result
- Inside the
/srv/app.my-brilliant-site.com/publicdirectory, there is another
publicdirectory where rails keeps its static assets such as images. We need to symlink this to
htdocsfor the application to work.
$ ln -s public htdocs
- Once that’s done, you need to ensure that the required gems have been installed:
$ bundler install --path vendor/bundle
- Finally generate session secrets, and keep them in the
$ echo "SetEnv SECRET_KEY_BASE $(./bin/rake secret)" > .htaccess
At that point you should be complete, and you can open the sample-site in your browser, ie. http://app.my-brilliant-site.com/.
If all is well you’ll see a response that contains “Hello world”.