Skip to content

Installation_Instruction

Chris Churas edited this page Sep 10, 2018 · 7 revisions

Prerequisites

Please read the REST API installation instructions first.

CIL website installation

  1. cd $YOUR_GIT_FOLDER

  2. git clone https://github.com/slash-segmentation/CIL_PHP_Website.git

  3. cd /var/www

  4. rm -rf html

  5. mkdir html

  6. mv $YOUR_GIT_FOLDER/CIL_PHP_Website/CIL/* ./html

  7. Create an external configuration file, cil_config.json

{
  "cil_auth":"username:password",
  "base_url_dev":"http://localhost",
  "base_url_stage":"http://stage_host_name",
  "base_url_prod":"http://prod_host_name",
  "service_api_host_dev":"http://localhost:8080",
  "service_api_host_stage":"https://stage_api_host_name",
  "service_api_host_prod":"https://prod_api_host_name",
  "cil_data_host":"https://data_host_name",
  "elasticsearchHost_dev":"http://dev_es_host:9200",
  "elasticsearchHost_stage":"http://stage_es_host:9200",
  "elasticsearchHost_prod":"http://prod_es_host:9200"
}


  1. Edit /var/www/html/application/config/config.php
$cil_config_file = "C:/data/cil_config.json";

/****************************Base URL************************************************/

$config['base_url'] = $cil_config_json->base_url_dev; //Development

//$config['base_url'] = $cil_config_json->base_url_stage; //Staging

//$config['base_url'] = $cil_config_json->base_url_prod; //Production

/**************************************************************************************/

/****************************Service API************************************************/

//$service_api_host = $cil_config_json->service_api_host_dev; //Development

$service_api_host = $cil_config_json->service_api_host_stage; //Staging

//$service_api_host = $cil_config_json->service_api_host_prod; //Production

 /****************************************************************************************/

 /****************************Elasticsearch server************************************************/

$config['elasticsearchHost'] = $cil_config_json->elasticsearchHost_stage; //Staging

//$config['elasticsearchHost'] = $cil_config_json->elasticsearchHost_prod; //Production

  /*************************************************************************************************

Apache configuration

Put a directory block in your httpd.conf:

<Directory "C:\Users\Willy\Documents\apache\Apache24\CIL_PHP_Website\CIL_PHP_Website\CIL">
    DirectoryIndex index.html
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride None
    #AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
    
    RedirectMatch ^/$ /home
    #
    # Willy: Rewrite for escaping index.php
    #
      RewriteEngine On
      RewriteBase /
      
      # Protect application and system files from being viewed when the index.php is missing
      RewriteCond $1 ^(application|system|private|logs)
      
      # Rewrite to index.php/access_denied/URL
      RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]
      
      # Allow these directories and files to be displayed directly:
      RewriteCond $1 ^(index\.php|index\.html|robots\.txt|favicon\.ico|public|assets|css|js|resources|Knowledge_Space_files|img|static|pic|pix|swf|assets|videos|template|old_cil|fonts|display_images)
      
      # No rewriting
      RewriteRule ^(.*)$ - [PT,L]
      
      # Rewrite to index.php/URL
      RewriteRule ^(.*)$ index.php/$1 [PT,L]
</Directory>

Restart the Apache HTTP server

service httpd restart

Testing

Go to http://localhost or http://YOUR_HOST_NAME