Joyent

 
Translations of this page:

Quick Start

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

Preflight

  • Information from your Joyent Facebook Welcome email.
    • Your Server Name .fb.joyent.us
    • Your User name is xxxxxxxx part of the Server Name.
  • A method to SFTP your files onto your accelerator.
  • In a browser go to http://xxxxxxxx.fb.joyent.us and check that you see the “Welcome Home” webpage.
  • If you require a database, then in a browser log into https://xxxxxx.fb.joyent.us:10000/ as admin and please follow these instructions.

PHP

Copy Files

  • SFTP to your server with user xxxxxxxx server xxxxxxxx.fb.joyent.us
  • Place your files into /home/xxxxxxxx/web/public

Rails

Copy Files

  • SFTP to your server with user xxxxxxxx server xxxxxxxx.fb.joyent.us
  • Place your rails application into /home/xxxxxxxx/web

Migration

  • Follow the instructions above on creating your database(s) if you have not already done so.
  • Follow the instructions below on running a command from the server to do your migration
    1. In Command to run enter:
      • cd /home/xxxxxx/web && rake db:migrate RAILS_ENV=production

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

  • SFTP to your server with user xxxxxxxx server xxxxxxxx.fb.joyent.us
  • Place your files into /home/xxxxxxxx/myapps/ (for example)

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 
  • Select Webmin from the left-hand navibation
  • Select System
  • Select Running Processes
    1. In Command to run enter:
      • cd /home/xxxxxx/web && rake db:migrate RAILS_ENV=production
    2. Select “Run”
 
facebook/kb/faststart.txt · Last modified: 2008/09/05 02:26 by lderezinski
 
Recent changes RSS feed Creative Commons License Driven by DokuWiki