On Aug 21, 2013, at 3:59 PM, vi...@thepenguin.org wrote:

> I am trying to figure out if I can run my sessionpersistence script that I 
> run with Apache to see if sessions persist between two tomcat sites on two 
> separate servers. The load balancer has session persistence enabled but Iam 
> unsure how to test it. My thought was that I would just add the following php 
> script to check, but apparently I am doing something wrong. The script is 
> this:
> 
> 
> <?php
> // DONT FORGET TO CHECK FOR VARNISH RUINING EVERYTHING
> ini_set( 'display_errors', 1);
> session_start();
> 
> echo 'HOSTNAME: ' . gethostname() . '<br />';
> echo 'SESSION: ' . session_id() . '<br />';
> 
> if (isset($_SESSION['counter'])) {
> $_SESSION['counter']++;
> } else {
> $_SESSION['counter'] = 1;
> }
> 
> echo '<br />DUMP SESSION:<br />';
> echo '<pre>';
> print_r($_SESSION);
> echo '</pre>';
> 
> phpinfo();
> ?>
> 
> but it seems not to like it if I add it from the webapps directory or from 
> inside a directory under that. Is there some special trick to running php 
> from inside tomcat ?

Tomcat is meant to run Servlet based Java apps, not PHP.  Use Apache HTTPD to 
run PHP.

> I have tomcat set up the same on both servers and am fronting it with Apache 
> if that adds options for me.

Just use the manager application that is bundled with Tomcat to check sessions.

   https://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html

Dan

> 
> Thanks for any ideas,
> CaptainVic
> 
> 
> ---------------------------------------------------------------------
> 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

Reply via email to