First time installation of ERDDAP, on Ubuntu 16.04 VM

115 views
Skip to first unread message

Ricardo Lemos

unread,
Jul 7, 2019, 2:12:00 AM7/7/19
to ERDDAP
Hello ERDDAP community,

I've been an infrequent but enthusiastic user of ERDDAP for almost ten years, and I've finally decided to set up my own ERDDAP. 
Since this is a personal project, I did it on a fresh Ubuntu 16.04 virtual machine inside a Synology NAS 218+ box, so that I would have a few Tb of disk available, a couple Gb of RAM and a fair dual-core CPU. The whole installation, including the OS, took me about 6h. 
The instructions (https://coastwatch.pfeg.noaa.gov/erddap/download/setup.html) were mostly super clear and easy to follow -- thank you, Bob! 

The following are a few comments about the installation on this fresh machine; I hope that may be of use to others.

- Installing AdoptOpenJDK's OpenJDK 8 was effortless.
- I had to work a bit harder to install tomcat correctly. First I tried to use synaptic package manager to get it done fast, only to realize that I hadn't defined $JAVA_HOME yet on the machine. Then I read, in Bob's instructions and elsewhere, that for security reasons I should install tomcat as a separate user (tomcat), so I took my time and did things manually. I found this resource very useful: https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04 
- The ERDDAP setup instructions do not say anything about the installation of apache, but at some point they begin mentioning it. So I installed apache2. I am not sure if this is the correct thing to do.
- More importantly, the instructions mention a file /etc/httpd/conf/httpd.conf, which does not exist in my machine, even after installing apache. I searched and found e.g. this, https://help.ubuntu.com/lts/serverguide/httpd.html, which indicates that such file is no longer used in Ubuntu. So I worked on apache2.conf instead.
- The installation of ERDDAP proper was straightforward; the instructions in the xml are very useful.
- I was not able to figure out to execute step 5 (how to use ProxyPass). The problem has to do with the lack of httpd.conf. Pasting the code into apache2.conf (or other .conf files) did not work. Having a pretty URL is not a need for me, so I ignored this step.
- By the end of the 5th hour I had ERDDAP running in the Ubuntu VM and was able to access it through the other machines in my home network.

Bob Simons

unread,
Jul 8, 2019, 11:00:21 AM7/8/19
to ERDDAP
Thank you very much for posting your ERDDAP-On-Synology-NAS installation tips so others can benefit from them.

This is an interesting way to get a small server with a ton of disk space for a super low price. 
Such a device might be of interest for personal use, for development, for backup, or for use in places where there is limited or no internet connectivity, e.g., on a ship or in a remote place. 

A Synology NAS is basically a small, inexpensive (starting at ~$300) computer that uses Linux on an Arm processor, with 2-12 disk drive bays, packaged and sold as a NAS.
Since hard drives can now have 12TB for ~$350, you can build a 4 bay server with 48TB for about $1700.
Since it is Linux, you can (as Ricardo has done here) install Ubuntu (or other Linux distributions) in a virtual machine (so you aren't messing around with the NAS software). Search the web for instructions.
Then you can install Apache and Tomcat, and then ERDDAP.
While the drives are pretty fast, the server is not, so this is no match for a proper server with a RAID, but it comes at a fraction of the cost of what data centers typically pay for servers.

As Ricardo's experience points out, the ERDDAP installation instructions are geared toward installing ERDDAP on a Linux server (for public use) or on Windows (for private use). But in different situations, there are often little quirks to the Apache and Tomcat installation process. The best solution is to search Google or Duck Duck Go for solutions, since someone else has probably faced the same problem before. 

Replies to Ricardo's comments:
* I am also surprised that you had to separately install Apache -- I thought it was included with Ubuntu.
* You only need to create and use user=tomcat if you are making a public server. Then, if a hacker somehow finds a way to abuse ERDDAP and act (partly) as user=tomcat, they won't be able to do much. I don't know the details of Ricardo's setup to know if this is needed here or not.
* Yes, you only need to set up the ProxyPass if you are making a public server. I just use port :8080 when accessing my development ERDDAP on my PC.
* I'm very impressed that you did the whole project in ~5 hours.

Best wishes.

Devender Raju

unread,
Jul 19, 2019, 1:36:45 AM7/19/19
to ERDDAP
Dear Ricardo,

Can you share the detailed document regarding installation. Please provide the xml which you were talking.

regards,
Raj
Message has been deleted

Ricardo Lemos

unread,
Jul 20, 2019, 1:08:08 PM7/20/19
to ERDDAP
Dear Raj,
 
The xml file I was referring to is tomcat/content/erddap/setup.xml, which is created automatically as part of the tomcat installation. Please see step 3 of the instructions in https://coastwatch.pfeg.noaa.gov/erddap/download/setup.html

Ricardo

Graeme Diack

unread,
Mar 23, 2020, 7:15:45 AM3/23/20
to ERDDAP
Thanks Ricardo, I just used your pointers to successfully deploy a test ERDDAP.

I had managed previously to get one up and running using just Bob's guide, but I deleted the VM without capturing the history (I thought I had, but it was very late at night/early in the morning *yawn*) and couldn't repeat it! I was tearing my hair out till I read your post :)

I used the ubuntu server 18.04 version of the digital ocean guide https://www.digitalocean.com/community/tutorials/install-tomcat-9-ubuntu-1804 and full disclosure, I also just installed the default-jdk mentioned there via APT
So, I acknowledge that I have the wrong version of Java running (11) and the wrong version of Tomcat (9), but I have a working ERDDAP server now, phew.
I'm now off to try the same thing again, but on ubuntu 19.10!

Cheers, Graeme

Ricardo Lemos

unread,
Mar 24, 2020, 1:13:56 AM3/24/20
to ERDDAP
I'm glad it was useful!
Cheers,
Ricardo
Reply all
Reply to author
Forward
0 new messages