Allow a Tomcat9 webapp to read/write to a folder

From EN Ikoula wiki
Revision as of 11:33, 12 July 2021 by Ikbot (talk | contribs) (Created page with "<span data-link_translate_fr_title="Autoriser une webapp Tomcat9 à lire/écrire dans un dossier" data-link_translate_fr_url="Autoriser une webapp Tomcat9 à lire/écrire dan...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽

fr:Autoriser une webapp Tomcat9 à lire/écrire dans un dossier
This article has been created by an automatic translation software. You can view the article source here.

Introduction

We will see how to authorize a Tomcat9 webapp under Debian to read and write in a folder. Because under Debian the system rights are not enough for Tomcat, it is indeed put in "sandbox" mode by Systemd and has only write access to the :

   - /var/lib/tomcat9/conf/Catalina
   - /var/lib/tomcat9/logs 
   - /var/lib/tomcat9/webapps
   - /var/lib/tomcat9/work 


Course

To override this security, you have to edit the Tomcat9 configuration file of Systemd /etc/systemd/system/multi-user.target.wants/tomcat9.service, configuration file, then in the :

[Service]

Add, to for example allow access to the directory /data/ :

ReadWritePaths=/data/

Once the modification is done, you have to reload the Systemd daemon:

# systemctl daemon-reload

Then restart Tomcat9 :

# service tomcat9 restart




Cet article vous a semblé utile ?

0



You are not allowed to post comments.