PGA Installation

Pick your OS...
                 

General Prerequisites

  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.
  8. Important: Do not need to install Laravel. You can skip the steps given on the links
  9. WSO2 IS server

PGA Installation on CentOS 7

Pre-Installations

  1. Install apache 
    Yum install httpd
  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
    yum install php-soap
    Could be be it is already enabled in CentOS7
  4. Install php using  
    yum install php
  5. Configure Selinux to allow outbound connection from web server;
    setsebool -P httpd_can_network_connect 1
  6. install composer
    yum install composer
  7. Install php-mcrypt
    yum install php-mcrypt

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
    cp - R airavata-php-gateway /* .
  3. In the gateway folder do a
    composer update
  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 Adding CA Signed Certificate 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 
    chcon -Rv --type=httpd_sys_content_t airavata-php-gateway/
    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 
    su -c "chcon -R -h -t httpd_sys_script_rw_t [fullpath]/app/storage”
    This is to make sure the storage folder is writable.
  11. Configure firewall to allow http and https
    • Check existing configurations using
      firewall-cmd --zone=public --list-services
    • To open access for http
      firewall-cmd --zone=public --permanent --add-service=http
    • To open access for https
      firewall-cmd --zone=public --permanent --add-service=https
    • To get above rules applied
      firewall-cmd —reload - refresh
  12. Locate httpd.conf file in location /etc/httpd/conf/
    Make sure below 'Allow Override' has 'All' option.
    
        #
        # 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 
    

PGA Installation on MAC Yosemite OS

Pre-Installation

  1. Follow instructions in MCrypt Installation for PHP on MAC
  2. First check whether your MAC has Apache installed. To check availability;
    apache ctrl start
  3. To stop running Apache use;
    apache ctl stop
  4. Once above is completed follow the Installation Steps given for
    • Configuring Apache
    • Installing Composer (Use sudo commands as and when required for installation)
  5. To install Composer use
    curl -sS https://getcomposer.org/installer | php
  6. Then move Composer using
    mv composer.phar /usr/local/bin/composer

PGA Installation

  1. Go to cd /Library/WebServer/Documents
  2. Take a copy from GIT using
    git clone https://github.com/apache/airavata-php-gateway.git
  3. Navigate to PGA folder
    cd /Library/WebServer/Documents/airavata-php-gateway
  4. Make sure the storage folder is writable by all users
    sudo chmod -R 777 app/storage
  5. Move out of app folder and give;
    sudo composer update
    This will take few minutes
  6. You might get an error like this
    
    Mcrypt PHP extension required.
    Script php artisan clear-compiled handling the post-update-cmd event returned with an error
    [RuntimeException]
    Error Output:
    
  7. Install mcrypt installation MCrypt Installation
  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)
    sudo vim /etc/apache2/httpd.conf
    uncomment #LoadModule rewrite_module libexec/apache2/mod_rewrite.so uncomment #LoadModule php5_module libexec/apache2/libphp5.so
  10. Now issue composer update command
    sudo composer update
  11. Restart the web server
    sudo apachectl restart
  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
  7. For steps to create projects, experiments and monitor them use IMPORTANT: In places where the hosted PGA link is used please replace by your locally running PGA URL.

PGA Installation on Ubuntu OS

Pre-Installation

  1. To install dependencies use commands in Ubuntu Installation
    In the command avoid installing mysql and mariaDB.
  2. Enable the appropriate extensions: navigate to php.ini
    sudo vi /etc/php.ini
    • Uncomment the following extensions: mcrypt.so, openssl.so, and soap.so. If they do not exists add them as extensions.
      extension=mcrypt.so
      extension=openssl.so
      extension=soap.so
  3. Locate httpd.conf file
    sudo vi /etc/httpd/conf/httpd.conf
    • 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
    sudo apt-get update
    sudo apt-get upgrade 
  3. Install Apache sudo apt-get install apache2
  4. Install PHP 5.4
    sudo apt-get install python-software-properties
    sudo add-apt-repository ppa:ondrej/php5-oldstable
    sudo apt-get update
    sudo apt-cache policy php5
    sudo apt-get install php5
  5. You can check the installed versions of apache and php using
    apache2 -v
    and
    php -v commands
  6. Install the necessary php extensions
    sudo apt-get install unzip
    sudo apt-get install curl
    sudo apt-get install openssl
    sudo apt-get install php5-mcrypt
    sudo apt-get install php-soap
  7. Install Composer System Wide
    curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer
  8. Activate mod_rewrite
    sudo a2enmod rewrite
    sudo service apache2 restart
  9. Open the default vhost config file:
    sudo nano /etc/apache2/sites-available/default. 
  10. Now search for “AllowOverride None” corresponding “DocumentRoot /var/www
    (which should be there TWO times) and change both to “AllowOverride All“. Search for these two lines.

  11. Exit and save with CTRL+X, Y, ENTER.

Go to Airavata Installation on CentOS 7