The Academic Platform for ONline Experiments (APONE) is a Maven dynamic web project developed using Eclipse Oxygen Release (4.7.0). It requires access to running instances of MongoDB and RabbitMQ Server. The project has been developed in Java, so a Java-compliant server is required for its deployment. The server currently used is Tomcat v.8.5. Below you can see the steps to install and run the platform.
Download and install Tomcat Server: http://tomcat.apache.org
Tested version 8.5.27
Download and install Mongo Database: https://www.mongodb.com
Tested version 2.6.10
The port by default is 27017, although this can be changed in the configuration file (step 4).
Currently, the platform works with a predefined database user which has access to a database which contains three collections: experiment, user and event. The database and the database user must be set in the configuration file (see step 4). The database and collections may be created dynamically by the platform, but the user must be created previously, with read/write permissions on the database.
Download and install RabbitMQ Server: https://www.rabbitmq.com
Tested version 3.6.10
The port by default is 5672, although this can be changed in the configuration file (step 4).
A web management tool can be activated with the command:
rabbitmq-plugins enable rabbitmq_management
It is listening to port 15672, and you can access (only from localhost) by using the following credentials: user:guest, password:guest. Check https://www.rabbitmq.com/management.html for more and maybe more updated information.
Download or clone the project APONE from github and check the file config.properties located in WEB-INF. Set the appropriate configuration for Mongo and RabbitMQ, and save the changes:
Property |
Predefined Value |
Comment |
---|---|---|
MONGOHOST |
localhost |
Host of MongoDB |
MONGOPORT |
27017 |
Port of MongoDB |
MONGODB |
irep |
Name of the database (it will be created if it does not exist) |
MONGOUSER |
irepuser |
User of the Mongo database |
MONGOUSERPWD |
0000 |
Password of the user |
RABBITHOST |
localhost |
Host of RabbitMQ |
RABBITPORT |
5672 |
Port of RabbitMQ |
RABBITEXCHANGE |
irep-exchange |
RabbitMQ Exchange Name |
ADMINTWITTERNAME |
socialdatadelft |
Twitter user name of admin (make sure the same user does not exist already in the database with a different rol) |
ADMINTWITTERID |
937708183979773955 |
Twitter id of admin |
LIMITEDACCESS |
false |
If true, only users already registered in the database (collection *user*) are able to access the platform |
Generate the WAR file to deploy in Tomcat. You can get it directly from the repository (release) or you can generate it easily with Maven, by writing the following command in the project folder:
mvn clean install -DskipTests
It will generate the WAR file in the target folder of the project. Make sure you skip the tests (-DskipTest) to generate the WAR file, as they requires the WAR file already deployed in a server in order to test the functionality.
With Tomcat running (as well as Mongo and RabbitMQ servers), copy that file in the webapps folder in Tomcat to have it automatically deployed. After some seconds, you should be able to access it from http://localhost:8080/APONE, assuming you are running Tomcat in localhost with the default port.
A test designed to test the main services of the platform is included. You can run it with maven:
mvn test
Previously, you have to make sure that the platform is deployed, and the config.properties file for testing, located at /src/test/java contains the proper host, port and context where APONE is deployed:
Property |
Predefined Value |
Comment |
---|---|---|
HOST |
localhost |
Server host where APONE is deployed |
PORT |
8080 |
Server port where APONE is deployed |
CONTEXT |
APONE |
Name of the context where APONE is deployed |
TIMEBEFORETEST |
60000 |
Time (in ms) before testing the events have been properly registered by Rabbit |
You can also run the test from the browser by requesting the following service to the platform:
GET /service/test/{time (ms) between registering and testing events; default TIMEBEFORETEST property}
After some time, you should see ‘Test completed’ in the browser if it was successful.