Follow the steps below to deploy PROMPT on a new server.
- The MySQL schema, eg. Vagrant-config/sql/empty.sql
- Access to this GitHub repo
- Create server
- Login via SSH and generate an SSH key (https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)
- Add this key to the deploy keys for GitHub
git clone git@github.com:IntAlert/ProjectsDB.git
- Create a MySQL database
- Load your MySQL export of the application database
- Save credentials for later
If your server has a default root folder for serving HTML, delete the target folder and create a soft link to the 'frontend' folder
rm -rf public_html
ln -s ProjectsDB/site/application/frontend public_html
These files are gitignored - ideally, these values should be set at environment variable level, but this isn't available on TSO Hosts for Command line environment variables, so we use configuration files that are hidden from this public repo
Create the following configuration file:
nano ProjectsDB/site/application/backend/app-common/Config/database-common.php
Example content:
<?php
class DATABASE_CONFIG {
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => '***',
'login' => '***',
'password' => '***',
'database' => '***',
'prefix' => '',
'encoding' => 'utf8',
);
}
?>
Create the following configuration file:
nano ProjectsDB/site/application/backend/app-common/Config/office365.php
Example content:
<?php
// API keys.. not in Git
define('OFFICE365_TENANT_ID', '***');
define('OFFICE365_CLIENT_ID', '***');
define('OFFICE365_CLIENT_SECRET', '***');
?>
Email Configuration
Create the following configuration file:
nano ProjectsDB/site/application/backend/app-common/Config/email-common.php
<?php
class EmailConfig {
public $default = array(
'host' => 'smtp.office365.com',
'port' => 587,
'username' => '***@***',
'password' => '***',
'transport' => 'Smtp',
'tls'=>true,
'from' => array('***@***' => 'FROM NAME'),
);
}
?>
- Visit http://manage.windowsazure.com
- Select "International Alert"
- Select "Applications"
- Select "PROMPT"
- Select "Configure"
- To the "Single Sign-on" add a reply URL of the form: http://staging-prompt.intalert.org/pdb/office365users/callback (replacing staging-prompt.intalert.org with your domain)
- Click "Save"
You should now be able to visit PROMPT