Analytics

From CoGepedia
Jump to: navigation, search

CoGe Analytics is a metrics and analytics engine for the CoGe platform written on Clojure's web framework Noir.

How To: Deploy on a Server via Apache Webserver

Prerequisites:

(You can install these CLI tools using your linux distributions preferred package manager)

Configuring Analytics to the Database

Once you have all the prerequisites installed, you need to get the Greentea (Analytics) repo from Github. Run:

 $ git clone https://github.com/LyonsLab/Greentea.git

Get Analytics Running:

Install Teabag to get Greentea running.

---Alternatively---

Inside the cloned directory run:

 $ lein run &> /dev/null &

Leiningen should pull in all the required dependencies* and start a Jetty servlet running on port 3456.

Check localhost:3456 to verify that the analytics platform is running.

Configure Apache to Proxy the Servlet Port to the /analytics Endpoint

Now to setup apache to point localhost/analytics/ to port 3456. Open '/etc/apache2/apache.conf' (or another conf location) in your favorite editor and add these lines:

RewriteEngine On 
NameVirtualHost *:90 
Listen 90

<VirtualHost *:90> 
ServerAdmin coge.genome@gmail.com ServerName localhost 
#ServerAlias geco.com.analytics
ErrorLog /home/rchasman/logs/error.log CustomLog <PATH>/logs/access.log combined LogLevel warn                   
                                                     
ProxyPass /analytics/ http://localhost:3456/analytics/                       
                                                     
ProxyPass /analytics http://localhost:3456/analytics/                        
                                                                   
</VirtualHost> 

These lines proxy calls to /analytics and /analytics/ to port 3456/analytics so that we don't have to type any ugly numbers to reach our site.

Finally:

 $ sudo services apache2 restart

If it says OK, it means the server should be started and you should be able to point a browser at it.

If everything was configured properly point your browser to <DNS>/analytics and Analytics should be up and running!