Skip to content

Instantly share code, notes, and snippets.

@AliFlux
Created November 7, 2015 14:27
Show Gist options
  • Save AliFlux/cc274122d56995e8e02d to your computer and use it in GitHub Desktop.
Save AliFlux/cc274122d56995e8e02d to your computer and use it in GitHub Desktop.
TSERP Environment Configuration

Server Environment Configuration

Domain names

Two domain names are required to provide a better UX for end-users.

  1. ERP domain name (for main site, links to the Load Balancer)
  2. DAV domain name (for CDN and filesystem, links to Apache)

These domains would be linked to access points on the system via a static public IP.

Load Balancer

A load balancer is required to filter user queries using roundrobin. recommended specs for a soft load blancer are:

  1. Ubuntu 14.04.3 LTS (or any newer LTS)
  2. HAProxy 1.6.1 (or newer)

If a hardware based load balancer is available, then that would be recommended.

This load balancer then forwards queries to multiple nodes (for start, a single node is required).

Computation Node

Computation node would host the application and framework. It requires the following features:

  1. Ubuntu 14.04.3 LTS (or any newer LTS)
  2. Apache 2.4.17 (or newer)
  3. PHP 5.6.12 (would be upgraded to PHP7 when released).

Apache Configuration

Apache must be configured with MPM Event for optimal performance, PHP-FPM might be required for this. Following modules are required apart from built-in Apache modules:

  1. rewrite_module
  2. mime_module

PHP Configuration

Apache should forward requests to PHP. Following PHP extensions are required by the system:

  1. php_curl
  2. php_fileinfo
  3. php_gd2
  4. php_openssl
  5. php_pdo_mysql
  6. php_sockets
  7. php_xdebug
  8. php_mbstring

The PHP working directory should be: /var/www. The PHP user should not be able to access anything outside of it.

Resources Server

The resources server is a centeralized site for providing database, cache, sessions, and filesystem to the nodes. The following features are expected:

  1. Ubuntu 14.04.3 LTS (or any newer LTS)
  2. MySQL Community Edition 5.7 (or newer)
  3. Redis 3.0 (or newer)
  4. Apache 2.4.17 (or newer)
  5. phpMyAdmin 4.5.1 (or newer)

MySQL Server

A global/privilaged admin should be created and the credentials should be stored/transfered safely.

Redis Cache

Redis key-value storage would be used for cache and sessions.

Apache for DAV

DAV (Distributed Archiving and Versioning) system would be used for a centeralized filesystem. Fortunately, it comes built-in with Apache. This system would be used for storing user-uploaded files such as:

  1. Profile pictures
  2. Customer data (staging/selected)
  3. Reports ...

For direct access and better performance, this system should be directly accessible online (without any load balancer or proxy). The DAV domain name should be linked to this Apache. Following modules are required:

  1. rewrite_module
  2. dav_module
  3. dav_fs_module
  4. dav_lock_module

DAV modules can be easily enabled via simple shell commands (ref: google).

phpMyAdmin

phpMyAdmin should be installed and configured with a global user to access/manage all databases in MySQL. Since it requires PHP as a dependency, any good PHP version (5.6.12+) may work.

  • It should be secured via HTTP Basic Auth.

End-User Machines

The system can work on any modern browser. However, the following browsers are recommended:

  1. Google Chrome v46
  2. Mozilla Firefox v41
  3. Microsoft Edge

Browser usage for TouchStone staff should be enforced, or it can cause serious problems in terms of safety, security, and UX.

Overview

      DAV Domain Name                                                        ERP Domain Name            Firewall        via Internet or Intranet
╔══════════════════════════╗       ╔══════════════════════════╗       ╔══════════════════════════╗         ╥╥         ╔══════════════════════════╗
║    Resources Server      ║       ║    Computation Node #    ║       ║    Load Balancer         ║         ║║         ║    Client                ║
║                          ║       ║                          ║       ║                          ║         ║║         ║                          ║
║    Ubuntu                ║<══════║    Ubuntu                ║<══════║    Ubuntu                ║<════════║║════════<║    Windows/Linux/Mac     ║
║    MySQL                 ║>══════║    Apache                ║>══════║    HAProxy               ║>════════║║════════>║    Chrome/Firefox/Edge   ║
║    Redis                 ║       ║    PHP                   ║       ║                          ║         ║║         ║        ^                 ║
║    Apache WebDav         ║       ║                          ║       ║                          ║         ║║         ║        ║                 ║
║    phpMyAdmin            ║       ║                          ║       ║                          ║         ║║         ║        ║                 ║
║     ╥                    ║       ║                          ║       ║                          ║         ║║         ║        ║                 ║
╚═════║════════════════════╝       ╚══════════════════════════╝       ╚══════════════════════════╝         ║║         ╚════════║═════════════════╝
      ║                                                                                                    ║║                  ║
      ╚════════════════════════════════════════════════════════════════════════════════════════════════════║║══════════════════╝
                                                                                                           ╨╨
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment