Re: Tomcat Valve
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Lance, On 8/27/18 19:21, Christopher Schultz wrote: > Lance, > > On 8/24/18 11:52, Campbell, Lance wrote: >> Tomcat 9 Use Case 1: I want to store the last N number of URLs >> sent to Tomcat 9 application. Then if Tomcat shuts down I want >> to write out these last N number of URLs to the log file. > >> Strategy: I figured I would use a valve to keep track of the last >> N number of URLs. However I don’t know how to tell when the >> valve is shutting down. > >> Does anyone have any suggestions? > > Sounds like an X-Y problem: http://xyproblem.info/ > > Maybe you can tell us what Y is in this case? Uhh... actually I meant "what is X, here?" ;) - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAluEveUACgkQHPApP6U8 pFh5Og//djlqDz0WsiVlHg+Z6w6cGUiXAOd8FiQOMPPvgps9fl0rLU5bMteyRO4D YKrU8zECfbvZxDnt1aVtxcqrKVaVvu/YyObIUG/6xQAN7pqEz3iJJ/7tWLhaGvHn /fw+8oFHiO2rrodr9M8OFpeYklhqLkP1N0yxZVn9pfUQKcN0hWgOEwdHL2TWicZm kx2MRs2hr2SRTs0dxmIYNVpy6ajRL8CDYY02rItCWGZZ3BLLNaePvRfkBn+BMfdm W8XF1vArV8JvMkydvNk6Nq1U0uxRCf8eeDuT7DtJ8ls6j8FFIA34OuLmiXao+5Bl E6YfKcpjJgxxlJqbuz3UTPiSSJ7HK/XkR1lZhz/GSJP5BhoCGFv8wiEwscH2b6pF sbsT8gn1OqfVgHZPYMViqxXHxpLitbV1ZrtbmtY0QGyyGW8lUOWWTO/Jor1CTgKo Jh+G1FOT4L5q0bE1WmloRxjwj+lg7beMwGjLKp9+Lu+yZRjvz+bJUJNacHr5ysG2 EQiCTKGHdaImtSs0vg0N8t13RmjgMhZljMxeX46bk4nZ+MsAX1SxnBN8kZdXVHKy aVXIez73a3FhjLy0+fVZlObsHWPvHtvSpX3VN3Slnc0g5Lm6X2feeZLpnv6irs3y Wos/zAFA5opTa4pBoqz6+q9A5Btx3EHJQAK9XqagqZbYWjJ/TLU= =CJN/ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: org.apache.tomcat.jdbc.pool casting to original connection class
I'm storing large files. Postgres has a limit for blobs and uses a different api for larger stuff. Cut off is 1gb On Mon, Aug 27, 2018, 7:19 PM Christopher Schultz < ch...@christopherschultz.net> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Alex, > > On 8/24/18 16:08, Alex O'Ree wrote: > > I have a use case where i need to downcast a pooled database > > connection down to the native class that is in use for the driver. > > Unfortunately I don't see any APIs that I can use to do this. Is > > there any backdoors or mechanisms I can use? > > > > Background, I'm using postgres with tomcat 8.5 and need to access > > some postgres specific apis, (the large binary object api). I've > > tried with both the tomcat based pool and the dbp2 connection > > pooling too. > > What's wrong with the existing JDBC APIs for working with BLOBs? It's > been a really long time since anyone has really had to down-cast JDBC > interface types to their implementation types to get around > deficiencies in the APIs. > > - -chris > -BEGIN PGP SIGNATURE- > Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ > > iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAluEhucACgkQHPApP6U8 > pFh0WA//X5aXgSlXTvwzOnlJdLVwm1Mpu/6FzHycBgK0S4MGlLggNvqdYs/p+ksz > I6m1vRVPifozU6C7ljAzjOmquN5kG6r00fp4JwK9vehVLBbg991LyGPQe30mQytk > S6b8qtFcBoAobP0j6KE29adSGJ8mwSAXcPE22NqBPlkj5vA1LwyNxxzgFVIL35lJ > M5z6cuEfJDcD4pj4azLzdG63y1hWeSyVdRyNC4YaB7vD74+1p42EWoR37djtWzbg > uvbM/OtsgGZsLeTWNSsR/eiupa0tgnbl99YNIIoSYyYKscS7e00sMs/vV9QxgXYL > VfQSL3RJMQPmkl35mmyLx7tV0ztmNORpeSLKZM0SQBUTyoVTpm5hB5z7SyO9bxo3 > CUOUpKYQsf1z0BIxTgzwBa+Cs97Qpt/Bx8x/3goyIsAhlGWc+07KhzB0qvAz/vv6 > Pzc4GeLttvGHTeX3thSITEfffLNxydnrAZ0gpU/mZl0a64hIJZ9XcGCwU42ZPgaH > CPEK9XmPC409zSIW0qMW5fS3dbIag8H7xxrFweu3aXUx1/jsEav0jHcR2J9NZMj2 > SA6qEM0NO+n5MjYat5KgD1G/kT7uDN4efKjakdApJLRy5mlAoe2z9gfcPozLu2aG > T8SEAvTxd6//sF57l3O0qudXtLSHS4S14QHQsefC+AS8gL4h12Q= > =D95E > -END PGP SIGNATURE- > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Tomcat Valve
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Lance, On 8/24/18 11:52, Campbell, Lance wrote: > Tomcat 9 Use Case 1: I want to store the last N number of URLs > sent to Tomcat 9 application. Then if Tomcat shuts down I want to > write out these last N number of URLs to the log file. > > Strategy: I figured I would use a valve to keep track of the last N > number of URLs. However I don’t know how to tell when the valve is > shutting down. > > Does anyone have any suggestions? Sounds like an X-Y problem: http://xyproblem.info/ Maybe you can tell us what Y is in this case? - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAluEh18ACgkQHPApP6U8 pFhPARAAhNHyEiiZeyoGN9MJKqPLtg+xneyuylr2ogIppparE20u5QPfXHs8LIoY KdHcEldIsfgALeMoSf1yQ+mmmzRrwfXTWYk8sl+6bSzWmiPDh7Kzfkk+NbKCmuIw P0lYk/1OPhDYWXVrv0OtztjxLyy+q1IyzRUF6L9A/j6wWmpdDbmgvARUYr88vaij xsuPNFsEv59760g5Ax3STN8Pz9SJNAAScJGUURY4Y1gx62fzhLTjjuQJk59458hW ju2SeceMKZDOYTLQtANArGaoayaNxsQC0zp1exSsjRcahhZFP9f84h3O6W03VCFd aySRZEKw7RtH1W1TZVMJ+PdiwEEo2A8+g9eJOZqWx8J6Py0v0GUPyXczZCh8Uc24 OMdqJ778dhp6UjDeeEMIhDzmaws6BMrbqX/ghkCA2Wu9c6KXOuq3rW2tMi7r7nTa 3JEuYMNUXRTpSyCJl6ldFzhXK2Ly5a1hY1kGKR+5MPekDFNw+Y9uulgd2yK5beSv 9WOjwDSd3UTk3dIY5LiNumQlDIZ76jBnZDBwpuuvaZ/egKQZ5hgysdYGBroxBFXL mGl1eOu9exks6TuCqpe5UXyPsaWFq40qwe5mvi/ra8qFc4z43mkLyGzwOcbsTT71 jyB8Ezau3aUkrsuLlPq4MZtjYZ/OWoq39ceH5kgguDra+u99Lpg= =+9NE -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: org.apache.tomcat.jdbc.pool casting to original connection class
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Alex, On 8/24/18 16:08, Alex O'Ree wrote: > I have a use case where i need to downcast a pooled database > connection down to the native class that is in use for the driver. > Unfortunately I don't see any APIs that I can use to do this. Is > there any backdoors or mechanisms I can use? > > Background, I'm using postgres with tomcat 8.5 and need to access > some postgres specific apis, (the large binary object api). I've > tried with both the tomcat based pool and the dbp2 connection > pooling too. What's wrong with the existing JDBC APIs for working with BLOBs? It's been a really long time since anyone has really had to down-cast JDBC interface types to their implementation types to get around deficiencies in the APIs. - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAluEhucACgkQHPApP6U8 pFh0WA//X5aXgSlXTvwzOnlJdLVwm1Mpu/6FzHycBgK0S4MGlLggNvqdYs/p+ksz I6m1vRVPifozU6C7ljAzjOmquN5kG6r00fp4JwK9vehVLBbg991LyGPQe30mQytk S6b8qtFcBoAobP0j6KE29adSGJ8mwSAXcPE22NqBPlkj5vA1LwyNxxzgFVIL35lJ M5z6cuEfJDcD4pj4azLzdG63y1hWeSyVdRyNC4YaB7vD74+1p42EWoR37djtWzbg uvbM/OtsgGZsLeTWNSsR/eiupa0tgnbl99YNIIoSYyYKscS7e00sMs/vV9QxgXYL VfQSL3RJMQPmkl35mmyLx7tV0ztmNORpeSLKZM0SQBUTyoVTpm5hB5z7SyO9bxo3 CUOUpKYQsf1z0BIxTgzwBa+Cs97Qpt/Bx8x/3goyIsAhlGWc+07KhzB0qvAz/vv6 Pzc4GeLttvGHTeX3thSITEfffLNxydnrAZ0gpU/mZl0a64hIJZ9XcGCwU42ZPgaH CPEK9XmPC409zSIW0qMW5fS3dbIag8H7xxrFweu3aXUx1/jsEav0jHcR2J9NZMj2 SA6qEM0NO+n5MjYat5KgD1G/kT7uDN4efKjakdApJLRy5mlAoe2z9gfcPozLu2aG T8SEAvTxd6//sF57l3O0qudXtLSHS4S14QHQsefC+AS8gL4h12Q= =D95E -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Cluster more than 2 tomcat servers
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Tim, On 8/27/18 10:19, Tim K wrote: > I'm experimenting with Tomcat 9.0.8 enabling Cluster support. > I've uncommented the line for it within the server.xml. I have 4 > separate servers on different hosts, all with the same config, > except unique jvmRoute values. Upon startup, it appears that > server1 and server4 pair up and server2 and server3 pair up, every > time! I'm using the default udp multicast, again, just > uncommenting the single cluster line in server.xml. I'm expecting > that all 4 would see each other and I would have a single cluster > of 4, not 2 clusters of 2. I confirmed each server can see each > other over port 4000. Any help is appreciated. Can you post your configuration(s)? Presumably, all 4 are nearly identical. Please post one of them (minus any secrets) and describe or copy/paste the differences for the other notes. - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAluEhnEACgkQHPApP6U8 pFjuERAAyo7/4u+/ZXkQ1XAK0YYPey6bNI4m10A+D+7Db+UkPfuP7rNo4g8z6LsL qroo8ZHw3BCi2gmIA0HkWsoaWnsEnOXU2OdvbOtWZn4Eqpys4w8dpQqXJY9ZwwKK ivaOiL3i37mqb4o7CTM3fU6MDpHILOkmOiuxT/n/uzW4gWqzrijm23rnG7wxR9Nw KA7N6mRkUL4AqnTj1MNI3yfrCDk/rvVPMBtC7jvT4hkKrI+FNTEBdlUtFJAw5xSo lkYrNOKJz73G/0Bje2Bi9vk7UB05WF0oSJgYFsiersrl1/eDTRIkcPy+AokU5P4p 3yFxvurTDGD2Q9GDloKPPxGwMZV/vB3HvY/BwsWzKTjXDy24AksuRqLJAo/mM0Ul 8cXzuHPbkG48MNcBwQJBB3DJmJNVmi5W5/1o++M9z3r55ym8cEvwP359j7cuT6V0 ebGXqk7kCfthjUpn3PQYCMzTpUDISd8N+4+7YH+yyhe8P9whU+Rbe5mkL2AkkBLP Lt3Pdfvt7utpjxw2OdiVzDaRhmm9735iev9FPOaa5T7VSqW8FMDkx8e2GSDPfzfr L3hFNW13iZ71HJe3a3J3NA8apyTr615RaPZeKHOr0Gpmpx3rG22KDJxOUAIQGZND Aa9CGYUwAuNObCzpuI1rEDHRJN6uwUMX00J6T2hBs2NmAlfwzL4= =A6ss -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: org.apache.tomcat.jdbc.pool casting to original connection class
I figured it out. Classpath issue. I had the postgres driver in my web app and in tomcat's lib folder. Removing from the web app fixed it. On Mon, Aug 27, 2018 at 9:47 AM Alex O'Ree wrote: > Unfortunately, it's not working. I've tried unwrap for both > org.postgresql.jdbc.PgConnection (concrete class) and > org.psotgresql.PGConnection (interface) and both of them fail to unwrap. > Any other suggestions? > > On Sun, Aug 26, 2018 at 10:04 AM Alex O'Ree wrote: > >> Perfect, thanks >> >> On Fri, Aug 24, 2018, 5:05 PM Torsten Krah wrote: >> >>> The isWrapperFor(..) and unwrap(..) methods on the connection API should >>> work for this. >>> >>
Cluster more than 2 tomcat servers
I'm experimenting with Tomcat 9.0.8 enabling Cluster support. I've uncommented the line for it within the server.xml. I have 4 separate servers on different hosts, all with the same config, except unique jvmRoute values. Upon startup, it appears that server1 and server4 pair up and server2 and server3 pair up, every time! I'm using the default udp multicast, again, just uncommenting the single cluster line in server.xml. I'm expecting that all 4 would see each other and I would have a single cluster of 4, not 2 clusters of 2. I confirmed each server can see each other over port 4000. Any help is appreciated. Regards, Tim
Re: [OT] What can prevent sessions from timeouting apart from real requests
Hi, actually the issue got resolved. The system in question wasn't tomcat but jboss (hence the offtopic) and in particular undertow. Undertow seems to have completely different session expiration handling than tomcat, they actually prolong expiration timestamp every time an attribute is accessed... Thanks for the insights! Leon On Mon, Aug 27, 2018 at 9:07 AM Jäkel, Guido wrote: > Dear Leon, > > I suggest to use the Tomcat Manager Application to investigate the session > data: > > * Use the Session Display (/manager/html/sessions?path=/foo) to take a > look on the different Timers (Creation Time, Last Accessed Time, Used Time, > Inactive Timemm,TTL) or even the session data > > * Use the Connector Scoreborads on the Server Status Display > (/manager/status) to detect stuck requests. I'm not sure if a stuck request > may prevent a session cleanup (especially of "other" sessions) > > Another approach may be to snapshot a memory dump and investigate the > session objects, e.g. with the Eclipse Memory Analyze Tool (aka MAT). > > Greetings > > Guido > > >-Original Message- > >From: Leon Rosenberg [mailto:rosenberg.l...@gmail.com] > >Sent: Friday, August 24, 2018 11:25 AM > >To: Tomcat Users List > >Subject: [OT] What can prevent sessions from timeouting apart from real > requests > > > >Hi, > > > >one of the systems we are consulting has encountered a strange problem. > The > >sessions will build up indefinitely but never expire. Then, at one point > >(at 02am in the night, 19K sessions would drop at once). > >Of course the simplest explanation would be that someone is actively > >requests something every 15 minutes (session timeout) keeping track of the > >JSESSIONID. We are trying to track this through the access_log and such. > >However, my question, is it possible to prevent session from timeouting by > >doing something stupid code-wise? Like storing a session in a hashmap > >somewhere, and accessing some attributes from time to time? My > >understanding was that the session timeout is solely dependent on incoming > >requests and handled by the container, but I was not 100% sure ;-) > > > >Thanks in advance > >Leon >
Re: org.apache.tomcat.jdbc.pool casting to original connection class
Unfortunately, it's not working. I've tried unwrap for both org.postgresql.jdbc.PgConnection (concrete class) and org.psotgresql.PGConnection (interface) and both of them fail to unwrap. Any other suggestions? On Sun, Aug 26, 2018 at 10:04 AM Alex O'Ree wrote: > Perfect, thanks > > On Fri, Aug 24, 2018, 5:05 PM Torsten Krah wrote: > >> The isWrapperFor(..) and unwrap(..) methods on the connection API should >> work for this. >> >
Re: Apache 2.4 tomcat 8 setup problem
Hi. .. hmm, where to begin ? ... Maybe first : In your case, it looks like you may be more familiar with the configuration of Apache httpd, than with the configuration of mod_jk and of tomcat. So just as a possible tip : there is an alternative, at the Apache httpd level, to mod_jk. See here : http://httpd.apache.org/docs/2.4/mod/mod_proxy_ajp.html The advantage is a) that the configuration of the mod_proxy_ajp module is entirely in the httpd.conf configuration file, and requires no additional mod_jk specific files b) that it avoids the usage of all these "Jk*" commands, which are often a bit less easy to use, in terms of how they combine with the other Apache httpd configuration directives. c) that the mod_proxy_ajp configuration is much the same as for any other Apache httpd proxy module d) that the mod_proxy_ajp is a part of the standard Apache httpd package, so you do not need to install anything extra. (mod_jk can be more difficult to get under some Linux versions). Second, and only if you still prefer to use mod_jk : 1) from the configuration that you show below (and particularly the commented-out bits), it looks like you may have copied (or referred to) some pretty old documentation about how to do this, and that this documentation referred to very old (and probably outdated) versions of tomcat and/or mod_jk. The correct and up-to-date documentation about mod_jk should be consulted here : top : https://tomcat.apache.org/connectors-doc/ and in particular for you : https://tomcat.apache.org/connectors-doc/reference/apache.html 2) this is probably wrong : > JkMount /dimitros-apartments.gr/* ajp13_worker > JkMount /dimitros-apartments.gr ajp13_worker The "dimitros-apartments.gr" part is the hostname, and should not be a part of the URIs which you proxy to tomcat via JkMount. So if you really want, under Apache httpd, to proxy "everything" to the back-end tomcat, the following would be better and sufficient : > JkMount /* ajp13_worker (assuming that "ajp13_worker" is correctly defined and configured in a "workers.properties" file.) 3) it becomes a bit more complicated if you want to have some things delegated to tomcat, but you also want tome other things to be served directly by your front-end Apache httpd. But maybe let's start with the beginning, and make the appropriate choice for you between mod_jk and mod_proxy_ajp. In any case, when you post your configuration again, make it easier for the people here, and remove the commented-out configuration lines. It is a bit difficult to read now, with all the comments. (But thank you for posting the versions of Apache httpd and tomcat, and explaining the context and what you want to achieve; that really helps). On 27.08.2018 11:03, Χριστόφορος Κορυφίδης wrote: I have an apache 2.4 on Debian Jessie and I host several sites as virtual hosts. On of these sites is running on jsp so I hav installed tomcat 8 and I use mod_jk. My virtual host configuration file for apache is: AllowOverride None Require all denied ServerName dimitros-apartments.gr ServerAlias www.dimitros-apartments.gr # #JkUriSet worker ajp13:localhost:8009 # JkMount /dimitros-apartments.gr/* ajp13_worker JkMount /dimitros-apartments.gr ajp13_worker DocumentRoot /var/www/dimitros-apartments.gr/web #DocumentRoot /var/lib/tomcat8/webapps/dimitros-apartments.gr # ApJServMount /servlet /ROOT # # Options None # Deny from all # ServerAdmin ad...@dimitros-apartments.gr ErrorLog /var/log/ispconfig/httpd/dimitros-apartments.gr/error.log Alias /error/ "/var/www/dimitros-apartments.gr/web/error/" ErrorDocument 400 /error/400.html ErrorDocument 401 /error/401.html ErrorDocument 403 /error/403.html ErrorDocument 404 /error/404.html ErrorDocument 405 /error/405.html ErrorDocument 500 /error/500.html ErrorDocument 502 /error/502.html ErrorDocument 503 /error/503.html # Clear PHP settings of this website SetHandler None Options +FollowSymLinks +Indexes AllowOverride None Require all granted # Clear PHP settings of this website SetHandler None
Apache 2.4 tomcat 8 setup problem
I have an apache 2.4 on Debian Jessie and I host several sites as virtual hosts. On of these sites is running on jsp so I hav installed tomcat 8 and I use mod_jk. My virtual host configuration file for apache is: AllowOverride None Require all denied ServerName dimitros-apartments.gr ServerAlias www.dimitros-apartments.gr # #JkUriSet worker ajp13:localhost:8009 # JkMount /dimitros-apartments.gr/* ajp13_worker JkMount /dimitros-apartments.gr ajp13_worker DocumentRoot /var/www/dimitros-apartments.gr/web #DocumentRoot /var/lib/tomcat8/webapps/dimitros-apartments.gr # ApJServMount /servlet /ROOT # # Options None # Deny from all # ServerAdmin ad...@dimitros-apartments.gr ErrorLog /var/log/ispconfig/httpd/dimitros-apartments.gr/error.log Alias /error/ "/var/www/dimitros-apartments.gr/web/error/" ErrorDocument 400 /error/400.html ErrorDocument 401 /error/401.html ErrorDocument 403 /error/403.html ErrorDocument 404 /error/404.html ErrorDocument 405 /error/405.html ErrorDocument 500 /error/500.html ErrorDocument 502 /error/502.html ErrorDocument 503 /error/503.html # Clear PHP settings of this website SetHandler None Options +FollowSymLinks +Indexes AllowOverride None Require all granted # Clear PHP settings of this website SetHandler None Options +FollowSymLinks +Indexes AllowOverride None Require all granted # suexec enabled SuexecUserGroup web12 client1 # php as fast-cgi enabled # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html FcgidIdleTimeout 300 FcgidProcessLifeTime 3600 # FcgidMaxProcesses 1000 FcgidMaxRequestsPerProcess 5000 FcgidMinProcessesPerClass 0 FcgidMaxProcessesPerClass 10 FcgidConnectTimeout 3 FcgidIOTimeout 600 FcgidBusyTimeout 3600 FcgidMaxRequestLen 1073741824 # # # SetHandler fcgid-script # # FCGIWrapper /var/www/php-fcgi-scripts/web12/.php-fcgi-starter .php # FCGIWrapper /var/www/php-fcgi-scripts/web12/.php-fcgi-starter .php3 # FCGIWrapper /var/www/php-fcgi-scripts/web12/.php-fcgi-starter .php4 # FCGIWrapper /var/www/php-fcgi-scripts/web12/.php-fcgi-starter .php5 # Options +ExecCGI # AllowOverride All # Require all granted # # # # SetHandler fcgid-script # # FCGIWrapper /var/www/php-fcgi-scripts/web12/.php-fcgi-starter .php # FCGIWrapper /var/www/php-fcgi-scripts/web12/.php-fcgi-starter .php3 # FCGIWrapper /var/www/php-fcgi-scripts/web12/.php-fcgi-starter .php4 # FCGIWrapper /var/www/php-fcgi-scripts/web12/.php-fcgi-starter .php5 # Options +ExecCGI # AllowOverride All # Require all granted # # add support for apache mpm_itk AssignUserId web12 client1
RE: Tomcat Valve
Dear Lance I don't know the motivation for your usecase. But note that the access log is written after handling the complete request (therefore its able to log the number of bytes send) and, because it's typical buffered, with a delay, too. This means, that a request is listed there only in the case of a proper shutdown. If the Tomcat come down because of a JVM OOM or something like this, this might be inaccurate. In addition, if you tell the Tomcat to shut down, one of the first steps is to block the "Connectors", i.e. the receivers for HTTP (and/or AJP). Request will be rejected then, but not logged anymore. Then, further shutdown will happen, e.g. the shutdown of the Servlet Containere(s). This may take some notable time and during this, the JVM -- Maybe from another point of view called "the Tomcat Process" -- is still running. Greetings Guido >-Original Message- >From: Mark Thomas [mailto:ma...@apache.org] >Sent: Friday, August 24, 2018 6:44 PM >To: users@tomcat.apache.org >Subject: Re: Tomcat Valve > >On 24/08/18 17:36, Campbell, Lance wrote: >> I don't understand. How does that help a valve running know that it is >> shutting down? At that point it would be too late. > >The point is you don't need a valve to answer your question. Just look >at the last 9 entries in the access log. > >Mark > >> >> On 8/24/18, 11:06 AM, "Mark Thomas" wrote: >> >> On 24/08/18 16:52, Campbell, Lance wrote: >> > Tomcat 9 >> > Use Case 1: I want to store the last N number of URLs sent to Tomcat >> 9 application. Then if Tomcat shuts down I want >to write out these last N number of URLs to the log file. >> > >> > Strategy: >> > I figured I would use a valve to keep track of the last N number of >> URLs. However I don’t know how to tell when the >valve is shutting down. >> > >> > Does anyone have any suggestions? >> >> tail -n 9 ${CATALINA_BASE}/logs/localhost_access_log.-mm-dd.txt >> >> Mark >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> > > >- >To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [OT] What can prevent sessions from timeouting apart from real requests
Dear Leon, I suggest to use the Tomcat Manager Application to investigate the session data: * Use the Session Display (/manager/html/sessions?path=/foo) to take a look on the different Timers (Creation Time, Last Accessed Time, Used Time, Inactive Timemm,TTL) or even the session data * Use the Connector Scoreborads on the Server Status Display (/manager/status) to detect stuck requests. I'm not sure if a stuck request may prevent a session cleanup (especially of "other" sessions) Another approach may be to snapshot a memory dump and investigate the session objects, e.g. with the Eclipse Memory Analyze Tool (aka MAT). Greetings Guido >-Original Message- >From: Leon Rosenberg [mailto:rosenberg.l...@gmail.com] >Sent: Friday, August 24, 2018 11:25 AM >To: Tomcat Users List >Subject: [OT] What can prevent sessions from timeouting apart from real >requests > >Hi, > >one of the systems we are consulting has encountered a strange problem. The >sessions will build up indefinitely but never expire. Then, at one point >(at 02am in the night, 19K sessions would drop at once). >Of course the simplest explanation would be that someone is actively >requests something every 15 minutes (session timeout) keeping track of the >JSESSIONID. We are trying to track this through the access_log and such. >However, my question, is it possible to prevent session from timeouting by >doing something stupid code-wise? Like storing a session in a hashmap >somewhere, and accessing some attributes from time to time? My >understanding was that the session timeout is solely dependent on incoming >requests and handled by the container, but I was not 100% sure ;-) > >Thanks in advance >Leon