Deployment Ge2Tag image using Vagrant

This article describes how you can generate a VirtualBox machine with Geo2Tag instance is installed using Vagrant. The machine can be deployed on any computer that support VirtualBox.

  • Clone project repo: git clone git@bitbucket.org:osll/geomongo.git
  • Install Vagrant (the last version is at https://www.vagrantup.com/downloads.html)
  • Install VirtualBox: apt-get install virtualbox
  • Go to directory vagrant/ and run the command vagrant up. Then the virtual  machine with ubuntu 14.04 will be created, the last stable version (master branch geomongo) will be downloaded and deployed.
  • To test of  virtual  machine functionality you have to run command vagrant ssh and also command curl http://geomongo/instance/log after login into virtual machine (login and password vagrant). The command should return an empty list.

The generated image need additional configuration:

  • network interfaces
  • domain name mapping
ShareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VKEmail this to someone

Usage local_deploy.sh

This script is designed for local deployment geomongo. The script should be run under the root user.

The next parameters will be used for running the script:

-с <name_of_catalog> specifies in which catalog all geomongo sources will be copied (by default it’s geomongo);

-f  flag which specifies that not need to overwrite config/config.ini;

-d <name of the config ini file> specifies which config file should be copied  (by default config/config.ini);

-e <name of the config file> specifies which config file should be copied to /etc/apache2/sites-available/ (by default config/geomongo.conf).

-el <the name of file for errors logging> specifies to which file you need to output errors (by default error);

-s <Server Name> specifies which server should be written in the config file  (by default geomongo).

The script performs the following steps:

– copies files to directory /var/www/DIRECTORY where DIRECTORY is specified after the key -c;

– runs the script scripts/setup_pip_dependencies.sh which specifies all dependencies of the project;

– records information about commit (commit hash, data, number of branch and version) to file /var/www/geomongo/DEBUG;

– makes the website available;

– restart apache.

Examples

– sudo ./scripts/local_deploy.sh # the script is called with default parameters: config is overwritten and copying sources is performed in geomongo.

– sudo ./scripts/local_deploy.sh -f -c test # config isn’t overwritten and copying sources is performed to the catalog test.

– sudo ./scripts/local_deploy.sh -e 000-default.conf -s localhost # config will create  000-default.conf with server localhost

ShareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VKEmail this to someone

Usage and extending papache_conf_generator.py

  1. Usage

    For creating config we have to perform:

    $  ./scripts/papache_conf_generator.py -n %server_name% -o %config_file_output% -f %site_catalog% -e %error_log_name%

    -n  Host name (for example localhost, geomongo) Mandatory parameter

    -o  Name of output config (by default output.conf) it will be saved in directory config/

    -f  Name of the catalog where the website will be hosted (by default geomongo)

    -e  Name of log where apache errors will be written (by default error)

    Example:

    $  ./scripts/papache_conf_generator.py -n localhost -o 000-default.conf -f geomongo

    It will create a config config/000-default.conf with server name localhost which is located in /var/www/geomongo.

  2. Structure template.conf

    config/template.conf is the template of config where instead of parameters the keys are %template_key% which will be replaced by script.

    Example:

    WSGIScriptAlias / /var/www/%geomongo_path%/geomongo.wsgi
    DocumentRoot /var/www/%geomongo_path%

    where %geomongo_path% is the path to the website scripts.

  3. Extension methods

    For adding new parameters we need to add it to template.conf and to add parameters of command line to the script. Also we have to extend method generate adding to it the needed argument.

    Example:

def generate(...., value): 
  ...... 
 .replace("%template_key%", value)
 ......
ShareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VKEmail this to someone

How to download and install Geo2Tag

To download the source code 

Repository with source code is at https://github.com/geo2tag/geo2tag. To clone the source code repo you should use the next command:

git clone https://github.com/geo2tag/geo2tag.git

How to prepare the environment 

For  ubuntu 14.04

sudo apt-get install mongodb python-pip python-dev git apache2 libapache2-mod-wsgi

How to deploy locally

sudo ./scripts/local_deploy.sh

How to test that deployment was successful

Running command curl http://geomongo/instance/status should return “OK”. Also it’s possible to deploy Geo2Tag image via Vagrant.

ShareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VKEmail this to someone

Как скачать и установить Geo2Tag

Скачать исходники

Репозиторий с исходным кодом расположен по ссылке:

https://bitbucket.org/osll/geomongo

Загрузить исходный код можно с помощью следующей команды:

git clone git@bitbucket.org:osll/geomongo.git 

Как подготовить среду

Для ubuntu 14.04

sudo apt-get install mongodb python-pip python-dev git apache2 libapache2-mod-wsgi
git clone git@bitbucket.org:osll/geomongo.git

Как локально развертывать

sudo ./scripts/local_deploy.sh

Как проверить, что все развернулось

Выполнение команды curl http://geomongo/instance/status должно вернуть “OK”

Так же возможен вариант развертывания образа Geo2Tag через Vagrant.

ShareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VKEmail this to someone

Deployment Geo2Tag image via Vagrant

This article describes how you can generate a VirtualBox machine with Geo2Tag instance is installed using Vagrant. The machine can be deployed on any computer that support VirtualBox.

  • Clone project repo: git clone https://github.com/geo2tag/geo2tag.git
  • Install Vagrant (the last version is at https://www.vagrantup.com/downloads.html)
  • Install VirtualBox: apt-get install virtualbox
  • Go to directory vagrant/ and run the command vagrant up. Then the virtual  machine with ubuntu 14.04 will be created, the last stable version (master branch geomongo) will be downloaded and deployed.
  • To test of  virtual  machine functionality you have to run command vagrant ssh and also command curl http://geomongo/instance/log after login into virtual machine (login and password vagrant). The command should return an empty list.

The generated image need additional configuration:

  • network interfaces
  • domain name mapping
ShareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VKEmail this to someone

Развертывание образа Geo2Tag через Vagrant

  • Выкачать репозиторий проекта git clone git@bitbucket.org:osll/geomongo.git
  • Установить Vagrant (последняя версия https://www.vagrantup.com/downloads.html).
  • Установить VirtualBox (apt-get install virtualbox).
  • Перейти в папку vagrant/ и выполнить команду vagrant up. После этого будет создана виртуальная машина с ubuntu 14.04, скачана и развернута последняя стабильная версия проекта (master branch geomongo).
  • Для проверки работоспособности виртуальной машины необходимо выполнить команду vagrant ssh и – после входа в виртуальную машину (логин и пароль vagrant) – команду curl http://geomongo/instance/log, которая должна вернуть пустой список.
ShareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VKEmail this to someone