|
|
### TOC
|
|
|
|
|
|
1. [Summary](#1-summary)
|
|
|
2. [Start your Apache instance](#2-start-your-apache-instance)
|
|
|
3. [Add new apps](#3-add-new-apps)
|
|
|
4. [Passenger Apps Details](#4-passenger-apps-details)
|
|
|
|
|
|
### 1. Summary
|
|
|
|
|
|
AweSim developer accounts at OSC are apart of the `awsmdev` group.
|
|
|
|
|
|
To have an app, first you must give it a place to live in your home directory. AweSim apps that you want to serve up must live in `$HOME/awesim_dev/`. In this directory:
|
|
|
|
|
|
* wsgi apps will be in `django1` - `django10` i.e. `$HOME/awesim_dev/django1/`
|
|
|
* rack apps will be in `rails1` - `rails10` i.e. `$HOME/awesim_dev/rails1/`
|
|
|
|
|
|
We will allow up to 10 apps of either kind. If you need more we can update the config to support more.
|
|
|
|
|
|
Each of the django and rails directories acts like a public html directory one may be familiar with from shared hosting environments. Each directory will map to a particular URL space, for that given user. For example, if I am logged in (OpenID) as efranz, and go to `https://websvcs02.osc.edu/awesimdev/rails2`*, my Per User Apache will look in `/nfs/17/efranz/awesim_dev/rails2`. You do not need to create each of the directories if they are not needed.
|
|
|
|
|
|
Apps are run using an Apache instance running as your developer account user (the Per User Apache or PUA). Only you will be able to access the app served from your home directory.
|
|
|
|
|
|
_* https://websvcs02.osc.edu is not a permenant address - the domain for development PUAs may change in the future_
|
|
|
|
|
|
|
|
|
### 2. Start your Apache instance
|
|
|
|
|
|
* Go to https://apps.awesim.org/devapps/
|
|
|
* This will create ~/awesim_dev directory if that does not exist and initiate
|
|
|
|
|
|
|
|
|
This will take you to an open id login page. Ignore the fact that it says "Log into OnDemand" for now.
|
|
|
|
|
|
[[images/dev_login.png]]
|
|
|
|
|
|
After logging in you will be redirected back to https://apps.awesim.org/devapps/ and then two things will occur:
|
|
|
|
|
|
* an `~/awesim_dev` directory will be created
|
|
|
* your Per User Apache will be started
|
|
|
|
|
|
This may take a few minutes. Then you will see this page:
|
|
|
|
|
|

|
|
|
|
|
|
This is PHP rendering of `~/awesim_dev/index.php`. You can modify this to your liking.
|
|
|
|
|
|
|
|
|
|
|
|
For example, in my home directory I have an awesim_dev directory:
|
|
|
|
|
|
```
|
|
|
-bash-3.2$ pwd
|
|
|
/nfs/17/efranz/awesim_dev
|
|
|
-bash-3.2$ ls -1
|
|
|
cgi-bin
|
|
|
index.php
|
|
|
tmp
|
|
|
```
|
|
|
|
|
|
### 3. Add new apps
|
|
|
|
|
|
3 types of apps are supported:
|
|
|
|
|
|
* PHP apps - just create a new directory under awesim_dev and add PHP files below that directory
|
|
|
* WSGI (Passenger) apps - create a directory named django[1-10] i.e. django1, django2, up to django10
|
|
|
* Rack (Passenger) apps - create a directory named rails[1-10] i.e. rails1, rails2, up to rails10
|
|
|
|
|
|
For example if I do:
|
|
|
|
|
|
```
|
|
|
-bash-3.2$ pwd
|
|
|
/nfs/17/efranz/awesim_dev
|
|
|
-bash-3.2$ mkdir {rails1,django1,myphpapp}
|
|
|
-bash-3.2$ ls -1
|
|
|
cgi-bin
|
|
|
django1
|
|
|
index.php
|
|
|
myphpapp
|
|
|
rails1
|
|
|
tmp
|
|
|
```
|
|
|
|
|
|
And then refresh "https://apps.awesim.org/devapps/" (or click on the "AWESIM" logo) then I'd see:
|
|
|
|
|
|

|
|
|
|
|
|
Clicking on a link opens the app in an iframe with the banner above. This is useful for simulating the environment the user will use the app in (in the context of a catalog with a banner on top). For dev purposes, you may want the app in a separate window. Just right click and open the link in a new browser tab/window.
|
|
|
|
|
|
### 4. Passenger Apps Details
|
|
|
|
|
|
Passenger WSGI apps require a minimum of these three things:
|
|
|
|
|
|
* passenger_wsgi.py
|
|
|
* tmp/
|
|
|
* public/
|
|
|
|
|
|
Passenger Rack apps require a minimum of these three things:
|
|
|
|
|
|
* config.ru
|
|
|
* tmp/
|
|
|
* public/
|
|
|
|
|
|
To restart either app, you can `touch restart.txt` inside the tmp dir.
|
|
|
|
|
|
Currently we have a defect in the configuration of Passenger that we are trying to fix. The root URL is inaccessible to WSGI or Rack apps. A work around is explained in each of the tutorials.
|
|
|
|
|
|
See the [[Django Hello World Tutorial]] and the [[Rails Hello World Tutorial]] for details. |
|
|
\ No newline at end of file |