Page tree

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-1.0.zip
$ sudo mv api /usr/local/.
Initial Setting
$ cd /usr/local/api

# Adjust permissions
$ sudo chown -R apache.apache /usr/local/api/app/tmp
$ sudo chmod +x /usr/local/api/cake/console/cake
$ sudo chmod +x /usr/local/api/app/vendors/shells/*.php
$ sudo chmod -R 777 /usr/local/api/app/tmp/cache

# 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 app/tmp/logs/*

# Copy of Configuration Files
$ cp app/config/database.template.php app/config/database.php
$ cp app/config/core.template.php app/config/core.php
# Put random data on 'Security.salt' and 'Security.cipherSeed' in core.php.
$ vi app/config/core.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/api/app/config/database.php
    In the 'password' => '',  set the password of database for mAP.
  • /usr/local/api/app/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/app/config/database.php
    In the 'host' => '',  set the host of database server.

    database.php
    @@ -76,9 +76,9 @@
            var $default = array(
                    'driver' => 'mysql',
                    'persistent' => false,
    -               'host' => 'localhost',
    +               'host' => 'YOUR-DATABASE-SERVER',
                    'login' => 'vouser',
                    'password' => 'xxxxx',
                    'database' => 'vo',
  • No labels