| ## PGA Installation |
| <b>NOTE</b><br> |
| - These step by step instructions are for PGA with airavata 0.16 (previous) release.<br> |
| - For the latest PGA installation, please use ansible playbooks.<br> |
| - Here is link [1] to the playbook file on the ‘master’ branch. This playbook consist of two roles, env_setup [2] and pga [3] and you can look at those roles for further details. |
| - But first read [4] |
| |
| [1] <a href="https://github.com/apache/airavata/blob/master/dev-tools/ansible/pga.yml" target="_blank"> PGA Ansible Playbooks</a> <br> |
| [2] <a href="https://github.com/apache/airavata/tree/master/dev-tools/ansible/roles/env_setup/tasks" target="_blank">Env_setup</a> <br> |
| [3] <a href="https://github.com/apache/airavata/tree/master/dev-tools/ansible/roles/pga" target="_blank">PGA</a> <br> |
| [4] <a href="https://github.com/apache/airavata/blob/master/dev-tools/ansible/README.md" target="_blank">READ ME</a> <br> |
| |
| |
| <b>Pick your OS...</b></br/> |
| [<button type="button" style="color:#f2f2f2;text-align:center;font-weight:lighter;background-color:#2481b9;width:160px;border: 2px solid #2481b9;border-radius:4px">Cent OS</button>](#headPGACENTOS) |
| [<button type="button" style="color:#f2f2f2;text-align:center;font-weight:lighter;background-color:#2481b9;width:160px;border: 2px solid #2481b9;border-radius:4px">MAC OS</button>](#headPGAMAC) |
| [<button type="button" style="color:#f2f2f2;text-align:center;font-weight:lighter;background-color:#2481b9;width:160px;border: 2px solid #2481b9;border-radius:4px">Ubuntu OS</button>](#headPGAUB) |
| |
| ### <a name="head1234">General Prerequisites</a> |
| 1. A Unix or Unix like operating system. |
| 2. A web server (e.g apache web server) with PHP 5.4 or higher. Make sure to have enabled mod_rewrite module in httpd.conf file and enable PHP SOAP extension. |
| 3. Composer |
| 4. MYSQL database (Required if the user is hosting Airavata on his own. To communicate with hosted Airavata this step is not relevant) |
| 5. MCrypt PHP extension |
| 6. Enable OpenSSL PHP extension |
| 7. Follow instructions given in links to install the prerequisites based on the OS. |
| - <a href="http://www.dev-metal.com/install-laravel-4-ubuntu-12-04-lts/" target="_blank"> Ubunutu prerequisites</a> |
| - <a href="https://www.digitalocean.com/community/tutorials/how-to-install-laravel-4-on-a-centos-6-vps" target="_blank"> Cent OS prerequisites</a> |
| - <a href="http://sangatpedas.com/20140219/installing-laravel-osx-mavericks/" target="_blank"> MAC prerequisites</a> |
| 8. Important: Do not need to install Laravel. You can skip the steps given on the links |
| 9. WSO2 IS server |
| |
| ### <a name="headPGACENTOS">PGA Installation on CentOS 7</a> |
| #### Pre-Installations |
| 1. Install apache |
| <pre><code>Yum install httpd</code></pre> |
| 2. module_rewrite is auto enabled in apache version in centos7. Its in /etc/httpd/conf.modules.d/00-base.conf file and the line is LoadModule rewrite_module modules/mod_rewrite.so |
| 3. Enable php using <pre><code>yum install php-soap</code></pre> Could be be it is already enabled in CentOS7 |
| 4. Install php using <pre><code>yum install php</code></pre> |
| 5. Configure Selinux to allow outbound connection from web server; |
| <pre><code>setsebool -P httpd_can_network_connect 1</code></pre> |
| 5. install composer |
| <pre><code>yum install composer</code></pre> |
| 6. Install php-mcrypt <pre><code>yum install php-mcrypt</code></pre> |
| |
| #### PGA Installation |
| 1. As the document root (var/www/html) take the git clone https://github.com/apache/airavata-php-gateway.git |
| 2. Change the cloned folder name to your desired folder name(e.g.: airavata-php-gateway). This will carry sub folders for the gateway |
| <pre><code>cp - R airavata-php-gateway /* .</code></pre> |
| 3. In the gateway folder do a <pre><code>composer update</code></pre> |
| 4. Create a directory in var/www/ for user data (E.g.:gateway-user-data). |
| 5. Make this user data directory writeable by Apache httpd by making the following |
| SELinux update as root: |
| |
| chcon -R -t httpd_sys_rw_content_t /path/to/gateway-user-data |
| |
| 6. Copy ./app/config/pga_config.php.template to ./app/config/pga_config.php |
| 7. In pga_config.php change airavata server, change; |
| - Airavata Client Configurations |
| - 'airavata-server' => 'localhost’, |
| - 'gateway-id' => 'php_reference_gateway', |
| - 'experiment-data-absolute-path' => '/var/www/gateway-user-data',(Here user has to create the experimentData folder in var/www) |
| - 'gateway-data-store-resource-id' => '' (This is the ID of the gateway preferred storage resource) |
| - Portal Related Configurations |
| - 'super-admin-portal' => false, (User has one gateway and need to use it to configure the compute resources, storage resources, etc...) |
| - 'admin-emails' => ['airavatatest100@gmail.com'], |
| - 'portal-email-username' => 'airavatatest100@gmail.com', |
| - 'portal-email-password' => '&airavaxxxxxx', |
| - WSO2 Identity Server Related Configurations |
| - 'tenant-domain' => 'prod.airavata', (Provided by the Gateway Admin to WSO2 IS at tenant creation) |
| - 'admin-username' => 'Gateway-Admin', (Provided by the Gateway Admin to WSO2 IS at tenant creation) |
| - 'admin-password' => 'Gateway-Admin-Password', (Provided by the Gateway Admin to WSO2 IS at tenant creation) |
| - 'oauth-client-key' => 'G1khg0I0Xf444rereggrteret', (Generated by WSO2 IS at tenant creation) |
| - 'oauth-client-secret' => 'G1khg0I0Xf444rere', (Generated by WSO2 IS at tenant creation) |
| - 'verify-peer' => true, (Set this to false if trusted server certificates are not used. Refer <a href='http://wso2.com/library/knowledge-base/2011/08/adding-ca-certificate-authority-signed-certificate-wso2-products/' target ='_blank'>Adding CA Signed Certificate</a> on adding trusted certificates.) |
| 8. Give writing permission chmod -R g+rwx app/storage/ |
| 9. Make sure SElinux comparability of airavata_php_gateway folder. For that give |
| <pre><code>chcon -Rv --type=httpd_sys_content_t airavata-php-gateway/</code></pre> |
| This is to make sure the gateway folder is readable by http |
| 10. ls - lZ shows the SELinux context. After the above chcon command do the same for storage folder as well |
| <pre><code>su -c "chcon -R -h -t httpd_sys_script_rw_t [fullpath]/app/storage”</code></pre> |
| This is to make sure the storage folder is writable. |
| 11. Configure firewall to allow http and https |
| - Check existing configurations using <pre><code>firewall-cmd --zone=public --list-services</code></pre> |
| - To open access for http <pre><code>firewall-cmd --zone=public --permanent --add-service=http</code></pre> |
| - To open access for https <pre><code>firewall-cmd --zone=public --permanent --add-service=https</code></pre> |
| - To get above rules applied <pre><code>firewall-cmd —reload - refresh</code></pre> |
| 12. Locate httpd.conf file in location /etc/httpd/conf/ |
| <br> Make sure below 'Allow Override' has 'All' option. |
| <pre><code> |
| # |
| # AllowOverride controls what directives may be placed in .htaccess files. |
| # It can be "All", "None", or any combination of the keywords: |
| # Options FileInfo AuthConfig Limit |
| # |
| AllowOverride All |
| </code></pre> |
| |
| |
| |
| ### <a name="headPGAMAC">PGA Installation on MAC Yosemite OS</a> |
| #### Pre-Installation |
| 1. Follow instructions in <a href="http://coolestguidesontheplanet.com/install-mcrypt-php-mac-osx-10-10-yosemite-development-server/." target="_blank">MCrypt Installation</a> for PHP on MAC |
| 2. First check whether your MAC has Apache installed. To check availability; |
| <pre><code>apache ctrl start</code></pre> |
| 3. To stop running Apache use; |
| <pre><code>apache ctl stop</code></pre> |
| 4. Once above is completed follow the <a href="https://web.archive.org/web/20150507101703/http://sangatpedas.com/20140219/installing-laravel-osx-mavericks" target="_blank"> Installation Steps</a> given for |
| - Configuring Apache |
| - Installing Composer (Use sudo commands as and when required for installation) |
| 5. To install Composer use |
| <pre><code>curl -sS https://getcomposer.org/installer | php</code></pre> |
| 6. Then move Composer using |
| <pre><code>mv composer.phar /usr/local/bin/composer</code></pre> |
| |
| #### PGA Installation |
| 1. Go to cd /Library/WebServer/Documents |
| 2. Take a copy from GIT using |
| <pre><code>git clone https://github.com/apache/airavata-php-gateway.git</code></pre> |
| 3. Navigate to PGA folder |
| <pre><code>cd /Library/WebServer/Documents/airavata-php-gateway</code></pre> |
| 4. Make sure the storage folder is writable by all users |
| <pre><code>sudo chmod -R 777 app/storage</code></pre> |
| 5. Move out of app folder and give; |
| <pre><code>sudo composer update</code></pre> |
| This will take few minutes |
| 6. You might get an error like this |
| <pre><code> |
| Mcrypt PHP extension required. |
| Script php artisan clear-compiled handling the post-update-cmd event returned with an error |
| [RuntimeException] |
| Error Output: |
| </code></pre> |
| 7. Install mcrypt installation |
| <a href="http://coolestguidesontheplanet.com/install-mcrypt-php-mac-osx-10-10-yosemite-development-server/" target="_blank">MCrypt Installation</a> |
| 8. (Optional) Go to [PGA_HOME]/app/config/pga_config.php and change the configuration to match your settings |
| 9. Enable Apache extensions (mod_rewrite module and PHP SOAP extension) |
| <pre><code>sudo vim /etc/apache2/httpd.conf</code></pre> |
| uncomment #LoadModule rewrite_module libexec/apache2/mod_rewrite.so |
| uncomment #LoadModule php5_module libexec/apache2/libphp5.so |
| 10. Now issue composer update command |
| <pre><code>sudo composer update</code></pre> |
| 11. Restart the web server |
| <pre><code>sudo apachectl restart</code></pre> |
| |
| #### Link Airavata and PGA |
| 1. Once the PGA and Airavata are downloaded and locally running; in PGA app/config folder locate the file called pga_config.php.template |
| 2. Copy the located file and name it as pga_config.php |
| 3. In the newly copied file find two configurations for |
| - Airavata host |
| - Port |
| 4. Change above configurations |
| - Airavata host = localhost |
| - Port = 9930 |
| 5. You are all set to run your own PGA! |
| 6. For steps to register resources, applications, etc… use <Link to admin guide> |
| 7. For steps to create projects, experiments and monitor them use <Link to end user guide> |
| IMPORTANT: In places where the hosted PGA link is used please replace by your locally running PGA URL. |
| |
| |
| ### <a name="headPGAUB">PGA Installation on Ubuntu OS</a> |
| #### Pre-Installation |
| 1. To install dependencies use commands in <a href="http://www.dev-metal.com/install-laravel-4-ubuntu-12-04-lts/" target="_blank">Ubuntu Installation</a> |
| <br>In the command avoid installing mysql and mariaDB. |
| 2. Enable the appropriate extensions: navigate to php.ini |
| <pre><code>sudo vi /etc/php.ini</code></pre> |
| - Uncomment the following extensions: mcrypt.so, openssl.so, and soap.so. If they do not exists add them as extensions. |
| <pre><code>extension=mcrypt.so</code></pre> |
| <pre><code>extension=openssl.so</code></pre> |
| <pre><code>extension=soap.so</code></pre> |
| 3. Locate httpd.conf file |
| <pre><code>sudo vi /etc/httpd/conf/httpd.conf</code></pre> |
| - Find 'AllowOverride None' and change to 'AllowOverride All' (Two places to change) |
| |
| #### PGA Installation |
| 1. The following guide give a sample installation starting from a fresh Ubunutu 12.04 installation. Similar instructions should be used in other operating systems. |
| 2. Update the ubuntu package manager |
| <pre><code>sudo apt-get update</pre></code> |
| <pre><code>sudo apt-get upgrade </pre></code> |
| 3. Install Apache |
| </pre></code>sudo apt-get install apache2</pre></code> |
| 4. Install PHP 5.4 |
| <pre><code>sudo apt-get install python-software-properties</pre></code> |
| <pre><code>sudo add-apt-repository ppa:ondrej/php5-oldstable</pre></code> |
| <pre><code>sudo apt-get update</pre></code> |
| <pre><code>sudo apt-cache policy php5</pre></code> |
| <pre><code>sudo apt-get install php5</pre></code> |
| 5. You can check the installed versions of apache and php using <pre><code>apache2 -v</pre></code> and <pre><code>php -v commands</pre></code> |
| 6. Install the necessary php extensions |
| <pre><code>sudo apt-get install unzip</pre></code> |
| <pre><code>sudo apt-get install curl</pre></code> |
| <pre><code>sudo apt-get install openssl</pre></code> |
| <pre><code>sudo apt-get install php5-mcrypt</pre></code> |
| <pre><code>sudo apt-get install php-soap</pre></code> |
| 7. Install Composer System Wide |
| <pre><code>curl -sS https://getcomposer.org/installer | php</pre></code> |
| <pre><code>sudo mv composer.phar /usr/local/bin/composer</pre></code> |
| 8. Activate mod_rewrite |
| <pre><code>sudo a2enmod rewrite</pre></code> |
| <pre><code>sudo service apache2 restart</pre></code> |
| 9. Open the default vhost config file: |
| <pre><code>sudo nano /etc/apache2/sites-available/default. </pre></code> |
| 10. Now search for “AllowOverride None” corresponding “DocumentRoot /var/www <Directory /var/www>” |
| <br>(which should be there TWO times) and change both to “AllowOverride All“. Search for these two lines.</br> |
| <br> |
| 11. Exit and save with CTRL+X, Y, ENTER. |
| |
| Go to <a href="Airavata-Installation" target="_blank">Airavata Installation on CentOS 7</a> |