Deploying apps on Symbiosis

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.

  1. Login to your Symbiosis server over ssh as the admin user and install passenger and git. This should automatically enable the Apache module, and restart the webserver.

    $ sudo apt-get install libapache2-mod-passenger git
    
  2. 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.

  1. 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/ 
    
  2. The application code should be checked out into the public directory. 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
    
  3. This particular application uses the end_result branch for the passenger-enabled code.

    $ git checkout end_result
    
  4. Inside the /srv/app.my-brilliant-site.com/public directory, there is another public directory where rails keeps its static assets such as images. We need to symlink this to htdocs for the application to work.

    $ ln -s public htdocs
    
  5. Once that’s done, you need to ensure that the required gems have been installed:

    $ bundler install --path vendor/bundle
    
  6. Finally generate session secrets, and keep them in the .htaccess.

    $ 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, i.e., http://app.my-brilliant-site.com/.

If all is well you’ll see a response that contains “Hello world”.

You are currently viewing Symbiosis user documentation. Symbiosis also has a comprehensive technical reference manual.

Bytemark Cloud used to be called "BigV"—nothing has changed except the name! We’re hiring! Please visit careers.bytemark.co.uk to find out more.