Deploy in vm

How does it work.

Geo2tag now consist of five parts:
 * webside(web-client)
 * service(process JSON requests)
 * tracker(periodicaly add marks into service)
 * observer(represent marks added by tracker)
 * wikigps-client(represent marks and allow to manage channels)

all parts interact with service using JSON Exchange_protocol. service process JSON requests and response also by JSON.

Installation from repo

sudo apt-get update sudo apt-get install wikigps-service
 * add this line into your /etc/apt/sources.list deb http://www.zps.spb.su/osll_repo binary_i386/
 * run

Building libs


 * install dependencies, needed for builded application (they are described in trunk/debian/control)
 * uncomment platform target in trunk/config.pri
 * run qmake && make
 * if you rebuild wikigps libs, you should do this command export LD_LIBRARY_PATH="absolute_path_for_libs" because wikigps applications will use default path for libs in other cases.
 * onther way to use compiled libraries is to copy them from /trunk/srs/libs into /usr/lib (must be root)

Building service

this steps means that you have wikigps-service installed using apt

and run following command sudo /etc/init.d/lighttpd restart
 * first steps are the same as first tree steps for libs
 * copy just compiled binary (/trunk/src/service/fcgi_server) into /opt/geo2tag/

Testing and debuging service


 * use this scripts for testing Exchange_protocol_curl (adapt it for your ip). example for login request curl -d "{\"login\":\"Mark\",\"password\":\"test\"}" http://YOUR_SERVER_IP:PORT/service?query=login
 * on machine, where service are runned you can look into logs, that are created by service: tail -f /var/log/messages

If you see some problems on service side, you can use process attaching for debug.


 * run ps aux | grep fcgi_server | grep -v grep you will see something like this www-data 24309 0.0  0.3  37208  1528 ?        Sl   Jan18   0:44 /opt/geo2tag/fcgi_server copy number in second column (PID) to clipboard
 * run gdb as root sudo gdb
 * in gdb use command attach PID
 * debuger will attach to process. after you need to run command continue because application are frized.

Creation virtual machine from vdi file.

At first you need to install VirtualBox and create virtual machine. After that you should add g2t_server.vdi into list of Vbox disks and attach it into your VM. Now you can start VM. It contain installed platform (package wikigps-service and wikigps-libs).

Building applications for VM.

trunk/src/common/inc/defines.h
 * create network between your pc and virtual machine
 * change SERVER_HTTP_URL for virtual machine IP (and DEFAULT_PORT, if you change it) in