Table of Contents

Quick Start

Through out this guide you see xxxxxxx. This is to be replaced with your username from your welcome email.

Preflight

PHP

Copy Files

Rails

Copy Files

Migration

Create a bootup action

  1. Click Service in the left-hand navigation, then click Bootup Actions
  2. From the top of boot-up actions page, click Add Mongrel.
  3. Enter a short name (letters, digits, '-' or '_' are allowed, but not spaces) into the Action name field.
  4. Enter a description into Description.
  5. Choose whether you want the action to start (and keep running) right away using the Started? option. You'll most likely want to leave this as Yes
  6. Enter the port number you wish to run the application on into Port number field. This can be a path to a binary or to a script with optional parameters etc. Typically 8001.
  7. Enter the rails application root into Rails root directory field. Typically it will be /home/xxxxxxxx/web/.
  8. Select which environment to run from Environment field. Typically production.
  9. Click Create.

Apache proxy

  1. Click Server Configuration, then Edit Proxy Website.
  2. Set Proxying enabled? to Yes.
  3. For Proxy to URL, enter the destination URL of your application, e.g. http://127.0.0.1:8001/, replacing 8001 with the port number you entered on step 7 above.
  4. Click Save and Apply.

Do not forget the trailing slash on the Proxy to URL. The correct proxying URL ends with a port number followed by a slash. Failing to provide the slash can result in non-functional URLs on your application.

Python

mod_python is not enabled in apache by default to save on memory for the people who do not require python. If you require MySQL then please follow these instructions for building the current version of MySQLdb.

Copy Files

mod_python & handler

  1. In a browser log into https://xxxxxxxx.fb.joyent.us:10000/ as admin
  2. Select Webmin below Joyent Accelerator
  3. From the left-hand navigation select Server
  4. Select Apache Webserver
  5. From the right side select the Global configuration tab
  6. Select the Edit Config Files icon
    1. Select the /opt/local/etc/httpd/includes/dso.cfg file from the combobox
    2. Select the Edit Directives in File: pushbutton
    3. Look for the line
      #LoadModule python_module lib/httpd/mod_python.so

      and change to

      LoadModule python_module lib/httpd/mod_python.so
    4. select Save
  7. From the right side select the Existing Virtual Hosts tab
  8. Select the Virtual Server for your django application xxxxxxxx.fb.joyent.us
  9. Select the Edit Directives icon
    1. Add your handler something like shown below:
       <Location "/mysite/">
      SetHandler python-program
      PythonHandler django.core.handlers.modpython
      SetEnv DJANGO_SETTINGS_MODULE mysite.settings
      PythonDebug On
      PythonPath "['/home/xxxxxxx/myapps'] + sys.path"
      </Location>
    2. Select the Save pushbutton
  10. From the upper right select Apply changes to restart apache

Running a command on the server

If you need to run any commands on the server you are able to ssh as xxxxxxxx@xxxxxxxx.fb.joyent.us. You are also able to do it from your browser. Below is shown how to run a rails migration. The basic format for any command is

  cd /path/to/current/directory && COMMAND_TO_EXECUTE param1, param2