These procedures were tested on an Ubuntu 11.10 and Ubuntu ubuntu-12.04.4-server-amd64 but should also work on other GNU/Linux distros based on Debian.
Use Java 7
$ sudo apt-get update
$ sudo apt-get install openjdk-7-jdk
$ sudo apt-get install maven2 git
Ant is used by the server to create the mobile APKs. Xvfb and Firefox are called during the integration tests phase.
$ sudo apt-get install ant xvfb firefox
Download and install RabbitMQ from the repository:
$ sudo apt-get install rabbitmq-server
Configure RabbitMQ to be used by maritaca:
$ sudo rabbitmqctl add_user maritaca maritaca
$ sudo rabbitmqctl add_vhost Maritaca
$ sudo rabbitmqctl set_permissions -p Maritaca maritaca ".*" ".*" ".*"
Finally, you should build the rabbit-consumer.jar, from maritaca-code/services/rabbit-consumer, and execute it from console:
$ java -jar rabbit-consumer.jar
$ wget -O cassandra.tgz http://www.eu.apache.org/dist/cassandra/1.2.15/apache-cassandra-1.2.15-bin.tar.gz
$ tar zxvf cassandra.tgz
$ wget -O tomcat7.tgz http://www.eu.apache.org/dist/tomcat/tomcat-7/v7.0.52/bin/apache-tomcat-7.0.52.tar.gz
$ tar zxvf tomcat7.tgz
$ wget -O solr.tgz http://archive.apache.org/dist/lucene/solr/4.2.0/solr-4.2.0.tgz
$ tar zxvf solr.tgz
$ apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/10gen.list
$ apt-get update
$ apt-get install mongodb-10gen
In the Cassandra folder type:
$ sudo ./bin/cassandra
Using another terminal start the Cassandra client and create the Maritaca keyspace:
$ ./bin/cassandra-cli -h localhost
create keyspace Maritaca;
exit;
Create the following file structures:
//AFC solr42/solr/data, not necessarily in /opt
$ sudo mkdir -p /opt/solr42/solr/data
$ cd /opt
$ sudo chown -R maritaca:maritaca solr42
Copy the tomcat file tomcat7.tgz to /opt/solr42, and extract its content
$ cp PATH_TO/tomcat7.tgz /opt/solr42/
$ tar zxvf tomcat7.tgz
Open the server.xml file.
$ vi /opt/solr42/tomcat/conf/server.xml
And edit it:
<Server port="8005" shutdown="SHUTDOWN"> for <Server port="8105" shutdown="SHUTDOWN">
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> for <Connector port="8983" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> for <Connector port="8109" protocol="AJP/1.3" redirectPort="8443" />
Start tomcat
$ /opt/solr42/tomcat/bin/startup.sh
Check if it is working: http://localhost:8983
Stop tomcat
$ /opt/solr42/tomcat/bin/shutdown.sh
Copy the solr.war file from the Solr distribution to the webapps directory of this other tomcat.
$ cp -p DOWNLOADS/solr/dist/solr-VERSION.war /opt/solr42/solr/solr.war
Create the context for Solr in Tomcat
$ vi /opt/solr42/tomcat/conf/Catalina/localhost/solr.xml
<Context docBase="/opt/solr42/solr/solr.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/opt/solr42/solr/data" override="true" />
</Context>
Copy the Solr configuration files:
$ cp -R DOWNLOADS/solr/example/solr/* /opt/solr42/solr/data/.
Define the dataDir for Solr:
$ vi /opt/solr42/solr/data/collection1/conf/solrconfig.xml
<dataDir>${solr.data.dir:/opt/solr42/solr/data}</dataDir>
Copy the schema used for Maritaca from maritaca-code/server/search/src/main/resources/schema.xml to /opt/solr42/solr/data/collection1/conf/schema.xml
Start Tomcat and visit: http://localhost:8983/solr
Install FFmpeg using the following guide: https://trac.ffmpeg.org/wiki/UbuntuCompilationGuide
Download the Android SDK from: http://developer.android.com/sdk/index.html
$ wget -O android-sdk-linux.tgz http://dl.google.com/android/android-sdk_r22.3-linux.tgz
$ tar zxvf android-sdk-linux.tgz
Go to the folder where Android SDK was extracted, and using a terminal, type:
$ sudo android-sdk-linux/tools/android list sdk
It is going to show the packages availables to install. Maritaca needs the API 7 and 15:
7- SDK Platform Android 4.1.2, API 16, revision 4
8- SDK Platform Android 4.0.3, API 15, revision 3
15- SDK Platform Android 2.1, API 7, revision 3
To install them, type:
$ sudo android-sdk-linux/tools/android update sdk --no-ui
//AFC sudo android-sdk-linux/tools/android update sdk -u --no-ui
/ OLD, TEST! $ android-sdk-linux/tools/android update sdk -u -n -t 7,8,15 --dry-mode /
$ git clone git://git.code.sf.net/p/maritaca/code maritaca-code
$ cd maritaca-code
$ cd server
$ mvn clean install -Dmaven.test.skip=true
$ sudo apt-get install apache2
Create the following file structures into /var/www, and change the permissions, so that, tomcat can write in these files.
hadoop_mounted/user/maritaca/apk
hadoop_mounted/user/maritaca/audio
hadoop_mounted/user/maritaca/picture
hadoop_mounted/user/maritaca/video
$ mkdir -p hadoop_mounted/user/maritaca/{apk,audio,picture,video}
$ sudo chown -R maritaca:maritaca hadoop_mounted/
Create a file called configuration.properties and edit it. It should contain the following properties:
| Property | Description | Example |
|---|---|---|
| maritaca_mobile_path | Path to Maritaca mobile project | /home/user/workspace/maritaca/client/ |
| android_sdk_path | Path to Android SDK | /opt/android/android-sdk-linux |
| maritaca_uri_server | URL to Maritaca server | http://10.0.2.2:8080/maritaca |
| filesystem_path | Where all data will be saved | /var/www/hadoop_mounted |
| http_uri_server | URL to the server hosting multimedia | http://localhost/hadoop_mounted |
| ffmpeg_path | Path to execute ffmpeg | /usr/bin/ffmpeg |
| tmp_directory | Path to temporary folder | /tmp/ |
| mongo_host | MongoDB will use this host | localhost |
| mongo_port | MongoDB will use this port | 27017 |
| mongo_timeout | Set the timeout for MongoDB | 30000 |
| cluster_addr | Cassandra cluster address | localhost:9160 |
For example:
maritaca_mobile_path=/home/maritaca/maritaca-code/client/
android_sdk_path=/home/mobile/android-sdk-linux
maritaca_uri_server=http://192.168.1.105:8080/maritaca
...
Configure URI Encoding
Go to the folder where Tomcat7 was extracted and edit the following file:
$ vi DOWNLOADS/TOMCAT_PATH/conf/server.xml
Add URIEncoding="UTF-8", so:
Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"
Move the war file generated by the build process to the Tomcat deployment folder. The deploy folder is in the Tomcat folder in the following path: tomcat7/webapps/
The war file resides in the following path: maritaca-code/server/web/target/maritaca.war
To build a war file, from server source code, execute: $ mvn clean install -Dmaven.test.skip=true
Substituting YOUR_PATH_TO_CONFIG_FILE with the path to the configuration.properties created before:
$ ./bin/ startup.sh -DMARITACA_CONFIG_PATH=YOUR_PATH_TO_CONFIG_FILE/configuration.properties
Visit: http://localhost:8080/maritaca
Verificar:
mkdir apps em maritaca-code/client
android-sdk-linux/tools/android update sdk -u --no-ui
Se for um linux de 64-bits: sudo apt-get install ia32-libs
iptables