http://wiki4.caucho.com/index.php?title=Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP&feed=atom&action=historyWeb Server: Using FastCGIProxy to Reverse Proxy to Native PHP - Revision history2024-03-29T05:53:01ZRevision history for this page on the wikiMediaWiki 1.18.0http://wiki4.caucho.com/index.php?title=Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP&diff=416&oldid=prevCowan at 00:00, 7 February 20122012-02-07T00:00:00Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 00:00, 7 February 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 15:</td>
<td colspan="2" class="diff-lineno">Line 15:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>php-fpm will startup by default listening on the local address on port 9000, which works fine for us.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>php-fpm will startup by default listening on the local address on port 9000, which works fine for us.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The example below provides a simple Resin configuration with /var/www as the root (htdocs) directory where PHP content is located.   </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The example below provides a simple Resin configuration with /var/www as the root (htdocs) directory where PHP content is located.   </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>(This is an "Apache" style configuration, where all documents located in /var/www are web content.  You can also configure FastCgi in a single Java web-application by adding <resin:FastCgiProxy>to WEB-INF/resin-web.xml.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>(This is an "Apache" style configuration, where all documents located in /var/www are web content.  You can also configure FastCgi in a single Java web-application by adding <resin:FastCgiProxy>to WEB-INF/resin-web.xml.<ins class="diffchange diffchange-inline">)</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>''conf/resin.xml:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>''conf/resin.xml:</div></td></tr>
</table>Cowanhttp://wiki4.caucho.com/index.php?title=Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP&diff=415&oldid=prevCowan at 00:00, 7 February 20122012-02-07T00:00:00Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 00:00, 7 February 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 4:</td>
<td colspan="2" class="diff-lineno">Line 4:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>For standard CGI, see [[Application Server: Native PHP With CGIServlet]].</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>For standard CGI, see [[Application Server: Native PHP With CGIServlet]].</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">''Keep in mind that Resin comes with [[http://quercus.caucho.com/ Quercus]], Caucho's 100% Java implementation of PHP5.  You may not need native PHP if Quercus works for your application.</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Executing PHP with FastCGI ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Executing PHP with FastCGI ==</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 14:</td>
<td colspan="2" class="diff-lineno">Line 16:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>php-fpm will startup by default listening on the local address on port 9000, which works fine for us.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>php-fpm will startup by default listening on the local address on port 9000, which works fine for us.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>The example below <del class="diffchange diffchange-inline">demonstrates how to configure </del>Resin <del class="diffchange diffchange-inline">to execute PHP via FastCGI.  Keep in mind that Resin comes </del>with <del class="diffchange diffchange-inline">[[http:</del>//<del class="diffchange diffchange-inline">quercus.caucho.com/ Quercus]], Caucho's 100% Java implementation of PHP5</del>.  <del class="diffchange diffchange-inline">You may not need native PHP if Quercus works for your application.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>The example below <ins class="diffchange diffchange-inline">provides a simple </ins>Resin <ins class="diffchange diffchange-inline">configuration </ins>with /<ins class="diffchange diffchange-inline">var</ins>/<ins class="diffchange diffchange-inline">www as the root (htdocs) directory where PHP content is located</ins>.   </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">''</del>web-<del class="diffchange diffchange-inline">inf</del>/resin-web.xml<del class="diffchange diffchange-inline">:</del>''</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">(This is an "Apache" style configuration, where all documents located in /var/www are </ins>web <ins class="diffchange diffchange-inline">content.  You can also configure FastCgi in a single Java web-application by adding <resin:FastCgiProxy>to WEB</ins>-<ins class="diffchange diffchange-inline">INF</ins>/resin-web.xml<ins class="diffchange diffchange-inline">.</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  <<del class="diffchange diffchange-inline">web-app </del>xmlns="http://caucho.com/ns/resin"</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">        </del>xmlns:<del class="diffchange diffchange-inline">ee</del>="urn:java:<del class="diffchange diffchange-inline">ee</del>"</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>''<ins class="diffchange diffchange-inline">conf/resin.xml:</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">        xmlns</del>:<del class="diffchange diffchange-inline">resin</del>="<del class="diffchange diffchange-inline">urn</del>:<del class="diffchange diffchange-inline">java</del>:<del class="diffchange diffchange-inline">com</del>.<del class="diffchange diffchange-inline">caucho</del>.<del class="diffchange diffchange-inline">resin</del>"></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  <<ins class="diffchange diffchange-inline">resin </ins>xmlns="http://caucho.com/ns/resin"</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">  </del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      </ins>xmlns:<ins class="diffchange diffchange-inline">resin</ins>="urn:java:<ins class="diffchange diffchange-inline">com.caucho.resin</ins>"<ins class="diffchange diffchange-inline">></ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>   <<del class="diffchange diffchange-inline">resin:FastCgiProxy regexp</del>="<del class="diffchange diffchange-inline">\.php</del>"></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">    </del><<del class="diffchange diffchange-inline">address</del>><del class="diffchange diffchange-inline">localhost:9000</del></<del class="diffchange diffchange-inline">address</del>></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  <log-handler name="" level="all" path="stdout</ins>:<ins class="diffchange diffchange-inline">"</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>   </<del class="diffchange diffchange-inline">resin:FastCgiProxy</del>></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">              timestamp</ins>="<ins class="diffchange diffchange-inline">[%y-%m-%d %H</ins>:<ins class="diffchange diffchange-inline">%M</ins>:<ins class="diffchange diffchange-inline">%S</ins>.<ins class="diffchange diffchange-inline">%s]"</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">              format=" {${thread}} ${log</ins>.<ins class="diffchange diffchange-inline">message}</ins>"<ins class="diffchange diffchange-inline">/</ins>></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">                </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>   <<ins class="diffchange diffchange-inline">logger name</ins>="" <ins class="diffchange diffchange-inline">level="info"/</ins>></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  </ins><<ins class="diffchange diffchange-inline">cluster-default</ins>></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    </ins><<ins class="diffchange diffchange-inline">resin:import path="classpath:META-INF/caucho/app-default.xml"</ins>/></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>   </<ins class="diffchange diffchange-inline">cluster-default</ins>></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline"> </del></web-app></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  </ins><<ins class="diffchange diffchange-inline">cluster id=""></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    <server id=""></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      <http port="8080"</ins>/<ins class="diffchange diffchange-inline">></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    </server></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    <host id="" root-directory="."></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      <</ins>web-app <ins class="diffchange diffchange-inline">id="/" root-directory="/var/www"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">        <resin:FastCgiProxy regexp="\.php"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">          <address>localhost:9000</address></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">        </resin:FastCgiProxy></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      </web-app></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    </host></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  </cluster></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </resin</ins>></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Create a simple test php file in <del class="diffchange diffchange-inline">your webapp's root directory</del>, as follows:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Create a simple test php file in <ins class="diffchange diffchange-inline">/var/www</ins>, as follows:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>''test.php</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>''test.php</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <?php phpinfo(); ?></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <?php phpinfo(); ?></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>And then access the URL http://127.0.0.1:8080<del class="diffchange diffchange-inline">/yourwebapp</del>/test.php and you will see something like this:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>And then access the URL http://127.0.0.1:8080/test.php and you will see something like this:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[File:Php-info-fpm.png]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[File:Php-info-fpm.png]]</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 38:</td>
<td colspan="2" class="diff-lineno">Line 60:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Notice "Server API" shows "FPM/FastCGI".     </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Notice "Server API" shows "FPM/FastCGI".     </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>As an interesting exercise, try commenting out <resin:FastCgiProxy> in resin<del class="diffchange diffchange-inline">-web</del>.xml, and access the page again.  It should still work, but the page now show the Quercus PHP info display instead.  All *.php is mapped to QuercusServlet by default in app-default.xml.  Your resin-web.xml overrides this mapping, but the webapp will fallback to QuercusServlet if not set.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>As an interesting exercise, try commenting out <resin:FastCgiProxy> in resin.xml, and access the page again.  It should still work, but the page now show the Quercus PHP info display instead.  All *.php is mapped to QuercusServlet by default in app-default.xml.  Your resin-web.xml overrides this mapping, but the webapp will fallback to QuercusServlet if not set.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[File:Php-info-quercus.png]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[File:Php-info-quercus.png]]</div></td></tr>
</table>Cowanhttp://wiki4.caucho.com/index.php?title=Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP&diff=414&oldid=prevCowan at 00:00, 6 February 20122012-02-06T00:00:00Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 00:00, 6 February 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 38:</td>
<td colspan="2" class="diff-lineno">Line 38:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Notice "Server API" shows "FPM/FastCGI".     </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Notice "Server API" shows "FPM/FastCGI".     </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">(</del>As an interesting exercise, try commenting out <del class="diffchange diffchange-inline">the </del><resin:FastCgiProxy> in resin-web.xml, and access the page again.  It should still work, but the page now show the Quercus PHP info display instead<del class="diffchange diffchange-inline">:)</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>As an interesting exercise, try commenting out <resin:FastCgiProxy> in resin-web.xml, and access the page again.  It should still work, but the page now show the Quercus PHP info display instead<ins class="diffchange diffchange-inline">.  All *.php is mapped to QuercusServlet by default in app-default.xml.  Your resin-web.xml overrides this mapping, but the webapp will fallback to QuercusServlet if not set.</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[File:Php-info-quercus.png]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[File:Php-info-quercus.png]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;">All *.php is mapped to QuercusServlet by default in app-default.xml.  Your resin-web.xml overrides this mapping, but the webapp will fallback to QuercusServlet if not set.</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== WordPress on Resin with FastCGI and php-fpm ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== WordPress on Resin with FastCGI and php-fpm ==</div></td></tr>
</table>Cowanhttp://wiki4.caucho.com/index.php?title=Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP&diff=413&oldid=prevCowan at 00:00, 6 February 20122012-02-06T00:00:00Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 00:00, 6 February 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 14:</td>
<td colspan="2" class="diff-lineno">Line 14:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>php-fpm will startup by default listening on the local address on port 9000, which works fine for us.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>php-fpm will startup by default listening on the local address on port 9000, which works fine for us.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>The example below demonstrates how to configure Resin to execute PHP via FastCGI.  Keep in <del class="diffchange diffchange-inline">bind </del>that Resin comes with [[http://quercus.caucho.com/ Quercus]], Caucho's 100% Java implementation of PHP5.  You may not need native PHP if Quercus works for your application.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>The example below demonstrates how to configure Resin to execute PHP via FastCGI.  Keep in <ins class="diffchange diffchange-inline">mind </ins>that Resin comes with [[http://quercus.caucho.com/ Quercus]], Caucho's 100% Java implementation of PHP5.  You may not need native PHP if Quercus works for your application.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>''web-inf/resin-web.xml:''</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>''web-inf/resin-web.xml:''</div></td></tr>
</table>Cowanhttp://wiki4.caucho.com/index.php?title=Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP&diff=410&oldid=prevFerg: moved Web Server: Using FastCGIProxy to Proxy to Native PHP to Web Server: Using FastCGIProxy to Reverse Proxy to Native PHP2012-02-06T00:00:00Z<p>moved <a href="/Web_Server:_Using_FastCGIProxy_to_Proxy_to_Native_PHP" class="mw-redirect" title="Web Server: Using FastCGIProxy to Proxy to Native PHP">Web Server: Using FastCGIProxy to Proxy to Native PHP</a> to <a href="/Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP" title="Web Server: Using FastCGIProxy to Reverse Proxy to Native PHP">Web Server: Using FastCGIProxy to Reverse Proxy to Native PHP</a></p>
<table class='diff diff-contentalign-left'>
<tr valign='top'>
<td colspan='1' style="background-color: white; color:black;">← Older revision</td>
<td colspan='1' style="background-color: white; color:black;">Revision as of 00:00, 6 February 2012</td>
</tr></table>Ferghttp://wiki4.caucho.com/index.php?title=Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP&diff=407&oldid=prevFerg at 00:00, 6 February 20122012-02-06T00:00:00Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 00:00, 6 February 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 22:</td>
<td colspan="2" class="diff-lineno">Line 22:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>    </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>    </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <resin:FastCgiProxy regexp="\.php"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <resin:FastCgiProxy regexp="\.php"></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">  </del><address>localhost:9000</address></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    </ins><address>localhost:9000</address></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </resin:FastCgiProxy></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </resin:FastCgiProxy></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </div></td></tr>
</table>Ferghttp://wiki4.caucho.com/index.php?title=Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP&diff=406&oldid=prevFerg at 00:00, 6 February 20122012-02-06T00:00:00Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 00:00, 6 February 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>{{<del class="diffchange diffchange-inline">Cookbook</del>}} <del class="diffchange diffchange-inline"> </del>{{Integration}}</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>{{<ins class="diffchange diffchange-inline">WebServer</ins>}} {{Integration<ins class="diffchange diffchange-inline">}} {{Cookbook</ins>}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This cookbook will show you how to execute local CGI scripts through Resin using [http://en.wikipedia.org/wiki/FastCGI FastCGI].  We'll use php-fpm as the FastCGI process manager and map *.php to Resin's included FastCGI servlet.  Finally, it will provide instruction on setting up WordPress to run in Resin using FastCGI.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>This cookbook will show you how to execute local CGI scripts through Resin using [http://en.wikipedia.org/wiki/FastCGI FastCGI].  We'll use php-fpm as the FastCGI process manager and map *.php to Resin's included FastCGI servlet.  Finally, it will provide instruction on setting up WordPress to run in Resin using FastCGI.</div></td></tr>
</table>Ferghttp://wiki4.caucho.com/index.php?title=Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP&diff=405&oldid=prevFerg at 00:00, 6 February 20122012-02-06T00:00:00Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 00:00, 6 February 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 21:</td>
<td colspan="2" class="diff-lineno">Line 21:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>         xmlns:resin="urn:java:com.caucho.resin"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>         xmlns:resin="urn:java:com.caucho.resin"></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>    </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>    </div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>   <resin:FastCgiProxy regexp=<del class="diffchange diffchange-inline">'/.*</del>.php<del class="diffchange diffchange-inline">'</del>></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>   <resin:FastCgiProxy regexp=<ins class="diffchange diffchange-inline">"\</ins>.php<ins class="diffchange diffchange-inline">"</ins>></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <address>localhost:9000</address></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <address>localhost:9000</address></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </resin:FastCgiProxy></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </resin:FastCgiProxy></div></td></tr>
</table>Ferghttp://wiki4.caucho.com/index.php?title=Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP&diff=402&oldid=prevFerg: moved Web Server: Using FastCGIServlet to Proxy to Native PHP to Web Server: Using FastCGIProxy to Proxy to Native PHP2012-02-06T00:00:00Z<p>moved <a href="/Web_Server:_Using_FastCGIServlet_to_Proxy_to_Native_PHP" class="mw-redirect" title="Web Server: Using FastCGIServlet to Proxy to Native PHP">Web Server: Using FastCGIServlet to Proxy to Native PHP</a> to <a href="/Web_Server:_Using_FastCGIProxy_to_Proxy_to_Native_PHP" class="mw-redirect" title="Web Server: Using FastCGIProxy to Proxy to Native PHP">Web Server: Using FastCGIProxy to Proxy to Native PHP</a></p>
<table class='diff diff-contentalign-left'>
<tr valign='top'>
<td colspan='1' style="background-color: white; color:black;">← Older revision</td>
<td colspan='1' style="background-color: white; color:black;">Revision as of 00:00, 6 February 2012</td>
</tr></table>Ferghttp://wiki4.caucho.com/index.php?title=Web_Server:_Using_FastCGIProxy_to_Reverse_Proxy_to_Native_PHP&diff=401&oldid=prevFerg at 00:00, 6 February 20122012-02-06T00:00:00Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 00:00, 6 February 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 20:</td>
<td colspan="2" class="diff-lineno">Line 20:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>         xmlns:ee="urn:java:ee"</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>         xmlns:ee="urn:java:ee"</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>         xmlns:resin="urn:java:com.caucho.resin"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>         xmlns:resin="urn:java:com.caucho.resin"></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline"> </del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  </ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>   <<del class="diffchange diffchange-inline">servlet servlet-name</del>='<del class="diffchange diffchange-inline">php-fcgi-servlet' servlet-class='com</del>.<del class="diffchange diffchange-inline">caucho</del>.<del class="diffchange diffchange-inline">servlets.FastCGIServlet</del>'></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>   <<ins class="diffchange diffchange-inline">resin:FastCgiProxy regexp</ins>='<ins class="diffchange diffchange-inline">/</ins>.<ins class="diffchange diffchange-inline">*</ins>.<ins class="diffchange diffchange-inline">php</ins>'></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>   <<del class="diffchange diffchange-inline">init server-</del>address<del class="diffchange diffchange-inline">="</del>localhost:9000<del class="diffchange diffchange-inline">"/></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>   <address<ins class="diffchange diffchange-inline">></ins>localhost:9000</<ins class="diffchange diffchange-inline">address</ins>></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">  </del></<del class="diffchange diffchange-inline">servlet</del>></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>   </<ins class="diffchange diffchange-inline">resin:FastCgiProxy</ins>></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline"> </del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>   <<del class="diffchange diffchange-inline">servlet-mapping url-pattern='/*.php' servlet-name='php-fcgi-servlet'</del>/></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </web-app></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </web-app></div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 40:</td>
<td colspan="2" class="diff-lineno">Line 38:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Notice "Server API" shows "FPM/FastCGI".     </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Notice "Server API" shows "FPM/FastCGI".     </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>(As an interesting exercise, try commenting out the <del class="diffchange diffchange-inline">servlet-mapping </del>in resin-web.xml, and access the page again.  It should still work, but the page now show the Quercus PHP info display instead:)</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>(As an interesting exercise, try commenting out the <ins class="diffchange diffchange-inline"><resin:FastCgiProxy> </ins>in resin-web.xml, and access the page again.  It should still work, but the page now show the Quercus PHP info display instead:)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[File:Php-info-quercus.png]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[File:Php-info-quercus.png]]</div></td></tr>
</table>Ferg