Difference between revisions of "Analytics"

From CoGepedia
Jump to: navigation, search
m (Get Analytics Running:)
 
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= CoGe - Analytics  =
 
  
 
CoGe Analytics is a metrics and analytics engine for the CoGe platform written on Clojure's web framework Noir.  
 
CoGe Analytics is a metrics and analytics engine for the CoGe platform written on Clojure's web framework Noir.  
 
<br>
 
  
 
== How To: Deploy on a Server via Apache Webserver  ==
 
== How To: Deploy on a Server via Apache Webserver  ==
Line 18: Line 15:
 
*Leingingen - [https://github.com/technomancy/leiningen Leiningen - Automate Clojure projects without setting your hair on fire.]
 
*Leingingen - [https://github.com/technomancy/leiningen Leiningen - Automate Clojure projects without setting your hair on fire.]
  
<br>
+
=== 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:  ===
 
=== Get Analytics Running:  ===
  
#Once you have all the prerequisites installed, you need to get the Greentea (Analytics) repo from Github.
+
Install&nbsp;[http://genomevolution.org/wiki/index.php/Teabag Teabag] to get Greentea running.  
##Run: `$ git clone https://github.com/LyonsLab/Greentea.git`
+
#Inside the cloned directory run: `$ lein run &amp;` it 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 /analytics Endpoint  ===
+
'''---Alternatively---'''
  
#Now to setup apache to point localhost/analytics/ to port 3456  
+
Inside the cloned directory run:
##Open '/etc/apache2/apache.conf' in your favorite editor and add these lines:
+
 
 +
  $ lein run &amp;&gt;&nbsp;/dev/null &amp;
 +
 
 +
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  
 
  RewriteEngine On  
Line 39: Line 46:
 
  ServerAdmin coge.genome@gmail.com ServerName localhost  
 
  ServerAdmin coge.genome@gmail.com ServerName localhost  
 
  #ServerAlias geco.com.analytics
 
  #ServerAlias geco.com.analytics
  ErrorLog /home/rchasman/logs/error.log CustomLog &lt;PATH&gt;/logs/access.log combined LogLevel warn  
+
  ErrorLog /home/rchasman/logs/error.log CustomLog &lt;PATH&gt;/logs/access.log combined LogLevel warn                  
&lt;Directory &lt;PATH&gt;/Greentea/resources/public/&gt;                   
+
                                                     
  AllowOverride All                                                       
+
  Order Allow,Deny                                                       
+
  Allow from all                                                         
+
&lt;/Directory&gt;                                                               
+
                                                             
+
DocumentRoot &lt;PATH&gt;/Greentea/resources/public                   
+
                                                             
+
 
  ProxyPass /analytics/ http://localhost:3456/analytics/                       
 
  ProxyPass /analytics/ http://localhost:3456/analytics/                       
ProxyPassReverse /analytics/ http://localhost:3456/analytics/               
+
                                                     
                                                             
+
 
  ProxyPass /analytics http://localhost:3456/analytics/                         
 
  ProxyPass /analytics http://localhost:3456/analytics/                         
ProxyPassReverse /analytics http://localhost:3456/analytics/               
+
                                                                   
                                                             
+
ProxyPass /greentea/ http://localhost:3456/greentea/                       
+
ProxyPassReverse /greentea/ http://localhost:3456/greentea/                 
+
                                                             
+
ProxyPass /greentea http://localhost:3456/greentea/                         
+
ProxyPassReverse /greentea http://localhost:3456/greentea/                 
+
 
  &lt;/VirtualHost&gt;  
 
  &lt;/VirtualHost&gt;  
  
'''*In the case of a common dependency issue with iplant-clojure-commons:'''
+
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.  
 
+
#We need to point to the missing dependency manually:
+
##<pre>Run:
+
 
+
`$ git clone https://github.com/iPlantCollaborativeOpenSource/iplant-clojure-commons.git`</pre>
+
##<pre>In the iplant-clojure-commons directory, run:
+
 
+
`$ lein uberjar`
+
 
+
In lein 2.0 this will create a file at "&lt;PATH&gt;/iplant-clojure-commons/clojure-commons-1.3.3-SNAPSHOT-standalone.jar"</pre>
+
##<pre>Replacing with appropriate &lt;PATH&gt;, run:
+
 
+
`mvn install:install-file -DgroupId=org.iplantc -DartifactId=clojure-commons -Dversion=1.3.3-SNAPSHOT -Dpackaging=jar -Dfile=&lt;PATH&gt;/iplant-clojure-commons/clojure-commons-1.3.3-SNAPSHOT-standalone.jar`</pre>
+
##<pre>Now try
+
  
`$ lein clean`
+
Finally:
  
and then
+
  $ sudo services apache2 restart
  
`$ lein run`
+
If it says OK, it means the server should be started and you should be able to point a browser at it.
  
The dependency issue should be resolved.</pre>
+
If everything was configured properly point your browser to &lt;DNS&gt;/analytics and Analytics should be up and running! <br> <br>

Latest revision as of 17:29, 3 June 2016

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!