Step-by-step eLog server & GUI installation for co-developers

This page will guide each step of eLog library installation for the eLog server co-developer.

Testing environments

* Mac OS X Yosemite 10.10.2

Required software

Apache, PHP and MySQL

Yosemite comes with pre-installed Apache/2.4.9 and PHP/5.5.14 (on 1 Feb 2015). We need to slighly configure it. You may follow the instruction here (http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/). For MySQL, we test with mysql-5.7.5-m15 and proceeded the same instruction.

Copy eLog library

Copy the eLog library under Apache web root directory. For OS X, the default html root is /Library/WebServer/Docments. If you have created a user Sites, then it should be /Users/username/Sites/.

 

Developer configuration

For server component developers, they should set up xdebug for remote debugging. Yosemite comes with xdebug.so (See http://akrabat.com/php/setting-up-php-mysql-on-os-x-yosemite/). For remote debugging, (Refer http://www.elifelog.org/book/elog2-server-configuration) see the below instruction.

Using Eclipse, RSE and XDebug remote through SSH, the remote PHP debugging is configured based on the instruction at http://stackoverflow.com/questions/4876064/debug-remote-php-cli-scripts and http://stackoverflow.com/questions/4200623/xdebug-remote-debugging-with-port-9000-forwarded-through-ssh-tunnel-how-to-makhttp://ubuntuforums.org/showthread.php?t=525257&page=2 might be also useful. From the client side, put alias dssh='ssh -R 9000:localhost:9000 useid@elogserverhostaddressinto your .bash_login for easy access. This allows complete server-side debugging editing and debugging remote files online. From the client side, to make it easy to debug from the web interface, install the xdebug browser extension (Read http://www.xdebug.org/docs/remote) and set the IDE key same as the server. In our case, we use Safari and thus installed Xdebug Toggler (https://github.com/benmatselby/xdebug-toggler/downloads). To enable this, the server side xdebug.ini (located at/etc/php5/conf.d/xdebug.ini for Ubuntu). See the below example.

Download:

  • For the developer (Mac):
    1. Download Eclipse for PHP Developers from  http://code.google.com/p/zend-sdk/
      • Set Preferences: Goto PHP->Debug. Set XDebug as PHP Debugger, Change configure of XDebug for Accept remote session to "any"
      • Set Network Connections for Active Provider to "Direct"
    2. Install Xdebug Toggler for Safari from https://github.com/benmatselby/xdebug-toggler/downloads.  Set Preferences for Xdebug Toggler preference for IDE Key to like the below xdebug.idekey setting. For other web browsers, see http://xdebug.org/docs/remote
  • For the server (Ubuntu):
    1. Install most recent Xdebug from the source (http://www.xdebug.org/download.php). Run rebuild.sh to install. Restart Apache (sudo /etc/init.d/apache2 restart). Set /etc/php5/conf.d/xdebug.ini like below.
====
xdebug.remote_mode=req
zend_extension=/usr/lib/php5/20090626/xdebug.so
xdebug.idekey=YourIDEKey
xdebug.default_enable=On
xdebug.remote_autostart=Off
xdebug.remote_connect_back=Off
xdebug.remote_cookie_expire_time=3600
xdebug.remote_enable=On
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_mode=req
xdebug.remote_port=9000
====
 
Above configuration disable remote_autostart and it only invokes the remote debugger when the proper IDEKey is specified in the HTTP request. The remote debugger is only allowed for the local connection (127.0.0.1). Thus the SSH enabled port fowarding is necessary. This limites the remote debug through SSH connections.
 
Before finishing, you may want to increase the PHP memory limit to handle large size files (ex. RAW camera images):
====
memory_limit = 512M
max_execution_time = 0
====
The Apache server should be restarted (Ex. sudo apachectl restart)
 
Server setup

Now let's configure the eLog server. For the server configuration, we provide GUI which you can access from the browser by pointing the server file location (ex. http://127.0.0.1/lab/server/). You can simply follow the instruction there and the server will set it up or else you may directly modify localconfig.php under server/management directory. When manually modiying localconfig.php, be careful in keeping the JSON format. You may try JSON syntax checker or use Sublime like text tool supporting JSON syntax format.

eLog server utilizes external libraries. Let us list up current software libraries used by our media analysis engine.

  1. ffmpeg (For OS X, download the binary at here: http://ffmpegmac.net and sudo copy them under /usr/local/bin)
  2. Install convert and montage from (http://www.imagemagick.org/script/binary-releases.php#macosx) and copy all under /usr/local/)
  3. gpsbabel (GPS data manipulator from http://www.gpsbabel.org/download.html). For OS X, sudo copy /Applications/GPSBabelFE.app/Contents/MacOS/gpsbabel to /usr/local/bin
  4. exiftool (http://www.sno.phy.queensu.ca/~phil/exiftool/)
  5. For eLog CEP developers, install the binary and give a permisson to run for Apache to run (user name: _www for OS X).

MySQL setup

Server UI will fill up fundamental tables. But you also need to fill in time_zone data of mysql database (See http://dev.mysql.com/doc/refman/5.5/en/mysql-tzinfo-to-sql.html). For OS X, some zone information is too long to fit into the time zone tables. So you have to slightly modify the output of mysql_tzinfo_to_sql. Follow the procedure, 

  1. mysql_tzinfo_to_sql /usr/share/zoneinfo > zoneinfo.sql
  2. Modify zoneinfo.sql to replace 'INSERT INTO' to 'INSERT IGNORE INTO'
  3. Then run 'mysql -u root -p mysql < zoneinfo.sql'