Re: Where does Tomcat 9 (apt managed / standard config) store sessions in Ubuntu 18?

2021-06-20 Thread Carsten Klein

Gustavo,

On 20.06.21 04:54, Gustavo Almeida wrote:

"Configuration Reference - The Manager Component" says:
"A Manager element MAY be nested inside a Context component. If it is not
included, a default Manager configuration will be created automatically"

My Context has no nested Manager element.

So, guessing I'm using by default the Standard Manager Implementation,
where does it store active sessions, if it does at all?


Olaf is right. StandardManager keeps active sessions in Memory. However, 
when its _Persistence Across Restarts_ features comes into play 
(https://tomcat.apache.org/tomcat-10.0-doc/config/manager.html#Persistence_Across_Restarts), 
it persists active sessions to disk in order to preserve these across a 
restart of either the context or the whole server.


Configuration option 'pathname' specifies, where on disk sessions are 
persisted. StandardManager serializes all sessions into a single file 
specified by 'pathname'. This defaulted to "SESSIONS.ser" and was a file 
path relative to the context's TEMP directory. However, on 2020-02-18 
that was changed to null, effectively disabling the Session Persistence 
Feature by default due to possible performance issues with a large 
number of sessions.


If you want it back, you could set 'pathname' to an absolute path of 
your choice. However, on Ubuntu, Tomcat runs in a sandbox and by default 
only has write access to a defined list of directories (see file 
tomcat9.service) as well as to /tmp and /cache.


Option 'pathname' can also take a path relative to the context's work 
directory, which is in /var/lib/tomcat9/work (a symlink to 
/var/cache/tomcat9/). There, under Catalina/localhost> is a directory named after the context. That is the context's 
working directory. This is where "SESSIONS.ser" used to be.






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Where does Tomcat 9 (apt managed / standard config) store sessions in Ubuntu 18?

2021-06-20 Thread Olaf Kock


On 20.06.21 04:54, Gustavo Almeida wrote:
> "Configuration Reference - The Manager Component" says:
> "A Manager element MAY be nested inside a Context component. If it is not
> included, a default Manager configuration will be created automatically"
>
> My Context has no nested Manager element.
>
> So, guessing I'm using by default the Standard Manager Implementation,
> where does it store active sessions, if it does at all?

Without looking it up (thus I could easily be proved wrong): My
assumption is that the active sessions are in memory. Is there any
particular reason why you'd expect them on disk?

Olaf


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Where does Tomcat 9 (apt managed / standard config) store sessions in Ubuntu 18?

2021-06-19 Thread Gustavo Almeida
-Ubuntu 18.04.5
-Tomcat/9.0.16 (Ubuntu)
-JVM 11.0.11+9

"Configuration Reference - The Manager Component" says:
"A Manager element MAY be nested inside a Context component. If it is not
included, a default Manager configuration will be created automatically"

My Context has no nested Manager element.

So, guessing I'm using by default the Standard Manager Implementation,
where does it store active sessions, if it does at all?

With this setup, the locations of interest that I found until now are:
/var/lib/tomcat9
/etc/tomcat9
usr/share/tomcat9
var/log/tomcat9
/etc/default/tomcat9