On 8/21/2013 12: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 ? I have tomcat set up the same on
both servers and am fronting it with Apache if that adds options for
me.
Thanks for any ideas, CaptainVic
You really don't want to run PHP from inside of Tomcat. It can be done,
and probably the cleanest way to do it is to add the executable
init-param to the cgi servlet and point it to php.
1. copy the cgi servlet definition out of web.xml and add it to your
web.xml
2. add the init-param for PHP
3. make sure to mark your context as privileged
This will make your application Tomcat-specific. You could edit the
distributed web.xml in $CATALINA_BASE/conf, but then that Tomcat could
only run PHP (and not the default perl).
. . . . just my two cents.
/mde/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org