Differences between revisions 2 and 3
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
This pages describe how to install V2 and MAPS on public beta and production systems. This page describes:

 1. The server architecture for deploying publicly accessible MAPS and V2 systems
 1. The software infrastructure that supports MAPS and V2 deployment
 1. How to install publicly accessible beta instances of V2 and MAPS

= Server Architecture =

== Overview ==

 1. Host one or more physical servers, accessible via a limited number of public IP addresses
    1. Use virtual hosts (DNS aliases) for addressing services and application instances
    1. Use a reverse proxy server to dispatch to the appropriate server, virtual machine

 1. The physical servers will collectively support multiple services:
    1. Rails-based MAPS and V2 systems
    1. PHP-based DrawMGT systems
    1. Wiki systems
    1. Web servers
    1. DNS servers
    1. CVS and Git servers

 1. Services hosted in virtual machines

 1. Automated deployment of V2 systems:
    1. Creation of an instance of a, largely pre-configured, virtual machine
    1. Provisioning of the virtual machine (VM) with all site and instance specific configuration
    1. Deployment of the V2 application instance, including the site an instance specific configuration

 1. Automated monitoring:
    1. MAPS and V2 instances
    1. Virtual machines
    1. Physical servers
    1. Supporting infrastructure (DNS servers, reverse-proxy servers, etc.)


== Supporting Technologies ==

|| Server operating system || [[http://wiki.centos.org|CentOS 6.4]] ||
|| Virtual Machines || [[http://www.vagrantup.com|Vagrant]], which runs on top of [[https://www.virtualbox.org|VirtualBox]] ||
|| VM provisioning || [[https://puppetlabs.com/|Puppet]], a Ruby-based tool ||
|| Application deployment || [[https://github.com/capistrano/capistrano|Capistrano]], a Ruby Gem ||
|| Revery_proxy server || [[http://httpd.apache.org/docs/2.2/mod/mod_proxy.html|mod_proxy]] ||

== Access Requirements ==

Requirements:

 1. Access to MAPS and multiple instances of V2:
    1. Via a single (or limited number of) IP address(es)
    1. Which can be hosted on multiple dedicated or virtual servers
 1. Hosting of multiple instances of V2 on a single server
 1. Ability to easily and quickly migrate an instance of V2 to another server


= Server Deployment =


= MAPS & V2 Deployment =

= Beta Systems =

----

'''''Old Content Follows'''''
Line 152: Line 216:

= Production Deployment =

== Hardware Platform ==

== Virtual Machines ==

=== Vagrant and VirtualBox ===

=== VM Provisioning ===

== Application Deployment ==

V2 Deployment

V2Master

Introduction

This page describes:

  1. The server architecture for deploying publicly accessible MAPS and V2 systems
  2. The software infrastructure that supports MAPS and V2 deployment
  3. How to install publicly accessible beta instances of V2 and MAPS

Server Architecture

Overview

  1. Host one or more physical servers, accessible via a limited number of public IP addresses
    1. Use virtual hosts (DNS aliases) for addressing services and application instances
    2. Use a reverse proxy server to dispatch to the appropriate server, virtual machine
  2. The physical servers will collectively support multiple services:
    1. Rails-based MAPS and V2 systems
    2. PHP-based DrawMGT systems
    3. Wiki systems
    4. Web servers
    5. DNS servers
    6. CVS and Git servers
  3. Services hosted in virtual machines
  4. Automated deployment of V2 systems:
    1. Creation of an instance of a, largely pre-configured, virtual machine
    2. Provisioning of the virtual machine (VM) with all site and instance specific configuration
    3. Deployment of the V2 application instance, including the site an instance specific configuration
  5. Automated monitoring:
    1. MAPS and V2 instances
    2. Virtual machines
    3. Physical servers
    4. Supporting infrastructure (DNS servers, reverse-proxy servers, etc.)

Supporting Technologies

Server operating system

CentOS 6.4

Virtual Machines

Vagrant, which runs on top of VirtualBox

VM provisioning

Puppet, a Ruby-based tool

Application deployment

Capistrano, a Ruby Gem

Revery_proxy server

mod_proxy

Access Requirements

Requirements:

  1. Access to MAPS and multiple instances of V2:
    1. Via a single (or limited number of) IP address(es)
    2. Which can be hosted on multiple dedicated or virtual servers
  2. Hosting of multiple instances of V2 on a single server
  3. Ability to easily and quickly migrate an instance of V2 to another server

Server Deployment

MAPS & V2 Deployment

Beta Systems


Old Content Follows

Installation on V2 Server

Environment

The V2 server is a virtual host on the zg-3.softxs.ch server.

The server has following software systems:

  1. FreeBSD 9.0-RELEASE FreeBSD 9.0-RELEASE #0
  2. Apache Server version: Apache/2.2.23 (FreeBSD)
  3. Phusion Passenger apache module
  4. Ruby: ruby 1.9.3p327 (2012-11-10 revision 37606) [amd64-freebsd9]
  5. Rails 3.2.11
  6. mysql Ver 14.14 Distrib 5.5.28, for FreeBSD9.0 (amd64) using 5.2
  7. And many Gems

The installation location for Rails applications:

  1. /v01/local/www/rails

For each application two items are required:

  1. In the rails directory the following is required:
    1. A directory with the path {app}-app where the git repository is cloned
    2. A symbolic link {app} which points to the {app}-app/public directory
  2. In /usr/local/etc/apache22/httpd.conf there must be a RackBaseUri defined. See below

Example directory structure for the V2pp and MAPS installations:

  1. Note that the V2p0 and MAPS applications are currently configured for the development environment
    • $ cd /v01/local/www/rails
      $ ls -l
      lrwxr-xr-x   1 alan  www    16 Jan 24 13:00 maps -> maps-app/public
      drwxrwxr-x  13 root  www    21 Jan 24 13:00 maps-app
      lrwxr-xr-x   1 root  www    15 Jan 17 16:20 v2p0 -> v2p0-app/public
      drwxrwxrwx  15 alan  www    23 Jan 24 17:14 v2p0-app

Apache Configuration

The following is configured in usr/local/etc/apache22/httpd.conf

  • ## ====== Rails ======
    
    LoadModule passenger_module /usr/local/lib/ruby/gems/1.9/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
    PassengerRoot /usr/local/lib/ruby/gems/1.9/gems/passenger-3.0.17
    PassengerRuby /usr/local/bin/ruby19
    
    <VirtualHost *:80>
      DocumentRoot  /v01/local/www/rails
      ServerName    v2.softxs.ch
      <Directory /v01/local/www/rails>
        Allow from all
      </Directory>
    
      # -- v2p0 app
    
      RackBaseURI   /v2p0
      <Directory /v01/local/www/rails/v2p0>
        RailsEnv    development
        Options     -MultiViews
      </Directory>
    
      # -- maps app
    
      RackBaseURI   /maps
      <Directory /v01/local/www/rails/maps>
        RailsEnv    development
        Options     -MultiViews
      </Directory>
    
      # -- test0 app
    
      RackBaseURI   /test0
      <Directory /v01/local/www/rails/test0>
        RailsEnv    development
        Options     -MultiViews
      </Directory>
    
      # -- test1 app
    
      RackBaseURI   /test1
      <Directory /v01/local/www/rails/test1>
        RailsEnv    test
        Options     -MultiViews
      </Directory>
    </VirtualHost>

Procedure

  1. Log into zg-3.softxs.ch
    1. You must be a member of group www
  2. cd to the {app}-app dircetory
  3. Git pull/fetch. Typically:
    • git pull origin master
  4. Bundle install
    • bundle install
      Use 'sudu gem install' as necessary to install any missing Gems. Note that it appears that bundle install detects the presence of sudo and asks for a password for the bundle install if new gems must be installed. If any Gems are installed then you need to restart Apache:
      • cd /usr/local/etc/rc.d
        sudo ./apache22 restart
      Then check in /var/log/httpd-error.log to make sure there were no errors when Apache restarted.
  5. Run rake tasks as necessary. The typical list of rake tasks is:
    • rake db:drop
      rake db:create
      rake db:migrate
      rake db:seed_fu
      rake db:populate
  6. If you need to perform any tweaks in the database, use the following user/password to access the DB server:
    • mysql -uroot -psqladmin
  7. Test the result. Links:
    1. MAPS http://v2.softxs.ch/maps

    2. V2p0 http://v2.softxs.ch/v2p0

Production Deployment

Hardware Platform

Virtual Machines

Vagrant and VirtualBox

VM Provisioning

Application Deployment

V2Deployment (last edited 2013-11-08 18:12:23 by 172)

Copyright 2008-2014, SoftXS GmbH, Switzerland