ODK Aggregate Port 80 Redirect Fails

Hello!

I'm having trouble setting up Aggregate on an a tomcat8 sever running on an ubuntu 18.04 server on an AWS EC2 instance.

I can set up the server to run fine on port 8080 and have set up mysql and tomcat as specified. I can access the page subdomain.example.com but, after seeing a redirect message to subdomain.example.com/Aggregate.html I am shown a 404 error on the page.

I am using approximately this configuration for port 80.

./ODK-Aggregate-v1.6.1-Linux-x64.run --mode unattended --parent_installdir /tmp --platform mysql --tomcat_http_port 80 --raw_hostname [subdomain.example.com] --database_port 3306 --instance_display_name [ORG_NAME] --username [user] --app_id '' --master_slave_app_id '' --jdbc_username odk_user --jdbc_password [PASSWORD] --jdbc_database odk_prod --jdbc_gae_mysql_password [PASSWORD] --jdbc_sqlserver_url localhost --jdbc_gae_mysql_instance_name ''

I moved
sudo mv /tmp/ODK\ Aggregate/ODKAggregate.war /odk/tomcat/webapps/ROOT.war

I used authbind to access port 80 according to the second answer here and changed
/opt/tomcat/conf/server.xml
to connect to port 80 instead of 8080
and updated
/etc/default/tomcat8
to use authbind=yes
I can't find anything errors in
/opt/tomcat/logs/catalina.out
that seem related

These is the general configuration that I followed

Allocate an EC2 instance with an elastic IP
Connect the instance with a domain name
Install tomcat by following [these directions](https://www.digitalocean.com/community/tutorials/install-tomcat-9-ubuntu-1804).
Install the Java 8 JDK 
    sudo apt-get install openjdk-8-jdk
Install mysql server
    only apt-get install mysql-server not mysql
    my.cnf in/etc/mysql/my.cnf
    sudo systemctl start mysql
Install mysql-connector java for ubuntu
    wget`/mysql-connector-java_8.0.12-1ubuntu18.04_all.deb
    sudo dpkg -i mysql-connector-java_8.0.12-1ubuntu18.04_all.deb
Install aggregate
    wget https://github.com/opendatakit/aggregate/releases/download/v1.6.1/ODK-Aggregate-v1.6.1-Linux-x64.run
    sudo ./ODK-Aggregate-v1.6.1-Linux-x64.run
Copy the aggregate files into the tomcat directory
    $CATALINA_HOME = /opt/tomcat
    cp ‘ODK AGGREGATE’/ODK-AGGREGATE.WAR /opt/tomcat/webapps/
    … chown + chgrp

Please let me know if you have any ideas!
Thanks,

Jared

Thanks for providing so much great detail, @jaredm. There's nothing that's obviously wrong here. Perhaps you can share your logs?

If you are redirecting to Aggregate.html on port 80, then Aggregate is installed and it's also not an authbind issue. My guess is that there might be something broken with the permissions in the webapps directory? Or maybe the CLI installer isn't passing through all the correct variables?

Hi @yanokwa thanks for getting back to me.

Okay here's some more info.

Initially the ROOT.war file was not owned by tomcat so I changed that and restarted tomcat (sudo systemctl restart tomcat) to no avail.

The webapp permissions now look like this.

$ sudo ls -l /opt/tomcat/webapps
total 53996
drwxr-x---  9 tomcat tomcat     4096 Nov  3 14:36 ROOT
-rw-r--r--  1 tomcat tomcat 55267838 Nov  2 19:57 ROOT.war
drwxr-x--- 14 tomcat tomcat     4096 Oct 10 21:44 docs
drwxr-x---  6 tomcat tomcat     4096 Oct 10 21:44 examples
drwxr-x---  5 tomcat tomcat     4096 Oct 10 21:44 host-manager
drwxr-x---  5 tomcat tomcat     4096 Oct 10 21:44 manager

I'm inclined to believe that the problem is not introduced by the CLI installer. I seem to have the same output for the gui installter, the interactive cli, and the cli with just arguments.

I also realize that I was reaching a cached page and that might have been causing the redirection problem. Now, in a private browsing window, I visit subdomain.example.com and am only served the Apache2 Ubuntu Default Page. Still, this isn't what I want, but now the logs, as you mention, do see to indicate more of a configuration problem.

On restarting tomcat, I see the following output.

catalina.txt (100.7 KB)

You have a SocketException when trying to bind to port 80. Something to try

2 Likes

Ah thank you Yaw! I somehow had an apache server running on port 80. It works now.

2 Likes