How to install CloudGateway API

How to install CloudGateway API

Purpose

The purpose of this document is to install and validate the (global) mAP environment.

Environment

The mAP is required for installing mAP-API. Please see here for installation of mAP.

Installing the Application

Download files from the following URL.
Deployment
$ unzip cloudgateway-api-r<version>.zip $ sudo mv api /usr/local/.
Initial Setting
$ cd /usr/local/api # Adjust permissions $ sudo chown -R apache.apache /usr/local/api/tmp $ sudo chown -R apache.apache /usr/local/api/logs # Deletion of Log Files and Cache Files $ sudo rm -rf app/tmp/cache/models/* $ sudo rm -rf app/tmp/cache/persistent/* $ sudo rm -rf app/tmp/cache/views/* $ sudo rm -rf logs/* # Copy of Configuration Files # Put random data on 'Security.salt' and 'Security.cipherSeed' in core.php. $ vi app/config/app.php
Configuration of httpd.conf

Include following configuration in /etc/httpd/conf/httpd.conf

<VirtualHost _default_:80> Redirect permanent / https://[HOST-NAME-OF-THIS-SERVER]/ </VirtualHost> Alias /api "/usr/local/api" <Directory "/usr/local/api"> Order allow,deny Allow from all Options ExecCGI FollowSymLinks AllowOverride All Require all granted </Directory> <Location "/api"> SSLVerifyClient optional_no_ca SSLOptions +ExportCertData </Location>
Configuration of .htaccess

Include following configuration in /usr/local/api/.htaccess.

 RewriteRule services/(.*)$ ../map/connector/services/$1 [L]
Restart
$ sudo systemctl restart httpd.service
Application Configuration File
  • /usr/local/map/config/app.php
    In the 'password' => '',  set the password of database for mAP.

    @@ -297,6 +296,11 @@ 'className' => Connection::class, 'driver' => Mysql::class, 'persistent' => false, + 'host' => 'localhost', + 'username' => 'vouser', + 'password' => 'YOUR-OWN-PASSWORD', + 'database' => 'vo', + 'encoding' => 'utf8', 'timezone' => 'UTC', /*
  • /usr/local/api/config/system.php
    In the 'entityID', set the entityID of this server.
    In the 'ip' in 'api', set the IP addresses to allow connections.

Advanced Configuration

Clustering

If you want to run on multiple servers to set the following.

Application Configuration File
  • /usr/local/map/config/app.php
    In the 'host' => '',  set the host of database server.
    app.php

    @@ -297,6 +296,11 @@ 'className' => Connection::class, 'driver' => Mysql::class, 'persistent' => false, - 'host' => 'localhost', + 'host' => 'HOST-NAME-OF-THIS-SERVER', 'username' => 'vouser', 'password' => 'YOUR-OWN-PASSWORD', 'database' => 'vo', 'encoding' => 'utf8', 'timezone' => 'UTC',