Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000319 [Resin] minor always 07-18-05 00:00 11-30-05 14:42
Reporter sam View Status public  
Assigned To
Priority high Resolution fixed  
Status closed   Product Version 3.0.14
Summary 0000319: multiple instances of FastCGIServlet connecting to php
Description RSN-363
(rep by A Achuthan)

With two FastCGIServlet instances, each in a separate virtual host, a request to host1 works but a request to host2 fails.

For testing purposes, I added two domain names test1.com and test2.com in
/etc/hosts of my local machine and added the it's IP so that both of
them resolves to my local server.
 
Then I added the following to my resin.conf :
    
----------------------------------------------------------------------
<host id='test1.com'>
      <root-directory>/usr/local/web/test1/</root-directory>
      <web-app id="/">
         <document-directory>webapps/ROOT</document-directory>
      </web-app>
</host>

<host id='test2.com'>
      <root-directory>/usr/local/web/test2/</root-directory>
      <web-app id="/">
         <document-directory>webapps/ROOT</document-directory>
      </web-app>
</host>
--------------------------------------------------------------------------


I added the following entries in web.xml for using fastCGI servlet.

--------------------------------------------------------------------
 <servlet servlet-name="php-fastcgi"
           servlet-class="com.caucho.servlets.FastCGIServlet">
    <init>
      <server-address>localhost:6666</server-address>
    </init>
  </servlet>
 <servlet-mapping url-pattern="*.php" servlet-name="php-fastcgi"/>
----------------------------------------------------------------------

After setting up everything, I accessed the url of the first domain
(test1.com) and it worked fine. But when I accessed the second domain,
the server didn't seem responding to the request. The browser just waits
 forever for the response. Initially I thought there was some
configuration problem with the second virtual host. But when I restarted
resin and started accessing the second domain first, it worked !

For confirming that the problem is not with the php script, I performed
the same tests with simple <?php phpinfo(); ?> script. But it yielded
the same results.

Additional Information RedHat 9
Attached Files

- Relationships

- Notes
(0000364)
sam
07-18-05 00:00

(rep by A Achuthan)

I think the problem is not with the virtual host set up. The FastCGI
servlet is not working with different apps of the same host also.
I set up two web apps in the default host and put test php scripts in
each. But the same problem exist.
 
Here is the mapping that I added in the web.xml of each app.
 
===========================================================
      <servlet servlet-name="php-fastcgi"
           servlet-class="com.caucho.servlets.FastCGIServlet">
    <init>
      <server-address>localhost:6666</server-address>
    </init>
  </servlet>
  <servlet-mapping url-pattern="*.php" servlet-name="php-fastcgi"/>

===========================================================

 
(0000365)
ferg
07-18-05 00:00

There are a few fixes to FastCGIServlet. However, the main issue looks like the default value of PHP_FCGI_CHILDREN can be 1. You need a much higher value to run PHP effectively, e.g.

unix> PHP_FCGI_CHILDREN=256 php -b localhost:6666
 

- Issue History
Date Modified Username Field Change
07-18-05 00:00 sam New Issue
11-30-05 00:00 administrator Fixed in Version  => 3.0.15
11-30-05 14:42 ferg Status resolved => closed


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
28 unique queries executed.
Powered by Mantis Bugtracker