Tomcat 9 on Ubuntu 18.04

276 views
Skip to first unread message

Sean Carte

unread,
May 20, 2021, 7:20:32 AM5/20/21
to DSpace Technical Support
I'm having trouble getting tomcat 9 to work with dspace, yet I have no problems with tomcat 8. This is on Ubuntu 18.04.

When using tomcat 9, no log files are created in /dspace/log and the dspace GUI indicates an internal error.

This is my (working) configuration for tomcat 8:

ls -ld /dspace/
drwxr-xr-x 16 tomcat8 tomcat8 4096 May 20 11:07 /dspace/

/etc/default/tomcat8
TOMCAT8_USER=tomcat8
TOMCAT8_GROUP=tomcat8
JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m -Xms64M -XX:+UseConcMarkSweepGC -Dfile.encoding=UTF-8"
#TOMCAT8_SECURITY=no

For tomcat 9, the user is 'tomcat', so this is what I have for tomcat 9:

ls -ld /dspace/
drwxr-xr-x 16 tomcat tomcat 4096 May 20 11:07 /dspace/

/etc/default/tomcat9
JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m -Xms64M -XX:+UseConcMarkSweepGC -Dfile.encoding=UTF-8"
SECURITY_MANAGER=false

I tried adding (variations of)
TOMCAT9_USER=tomcat
TOMCAT9_GROUP=tomcat
to /etc/default/tomcat9, but that hasn't made any difference.

The contexts are identical (I copied /etc/tomcat9/Catalina/localost/*.xml to /etc/tomcat8/Catalina/localhost/):
/etc/tomcat9/Catalina/localhost/ROOT.xml
<?xml version='1.0'?>
<Context
        docBase="/dspace/webapps/jspui"
        reloadable="true"
        cachingAllowed="false"
/>

/etc/tomcat9/Catalina/localhost/solr.xml
<?xml version='1.0'?>
<Context
        docBase="/dspace/webapps/solr"
        reloadable="true"
        cachingAllowed="false"
/>

/etc/tomcat9/Catalina/localhost/jspui.xml
<?xml version='1.0'?>
<Context
        docBase="/dspace/webapps/jspui"
        reloadable="true"
        cachingAllowed="false"
/>

No errors are reported in /var/log/tomcat9/catalina.2021-05-20.log, yet it seems like tomcat9 does not have access to /dspace, and I can't figure out why.

Does anybody know where I've gone wrong?

Sean

dieg...@gmail.com

unread,
May 20, 2021, 12:01:26 PM5/20/21
to DSpace Technical Support
You can find the solution in the "Edit" section of the most voted question in https://stackoverflow.com/questions/56827735/how-to-allow-tomcat-war-app-to-write-in-folder
Tomcat 9 only writes to specific folders. You have to add new dirs to 'ReadWritePaths' directive, in your case "/dspace/log"

Sean Carte

unread,
May 21, 2021, 2:04:00 AM5/21/21
to dieg...@gmail.com, DSpace Technical Support
Thank you, diegoucha!

As someone else in that thread commented, I had no idea that systemd could do that.

Sean

--
All messages to this mailing list should adhere to the Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/6eac177e-32f1-4a7a-88ea-aab05d959743n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages