<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Dear All,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Im a System Admin from Indonesia.</FONT></DIV>
<DIV><FONT face=Arial size=2>I have a little trouble with Engine-X
(nginx).</FONT></DIV>
<DIV><FONT face=Arial size=2>My server can recognize PHP & FCGI well, but a
trouble appear when I use a FuseBox frame work in my server.</FONT></DIV>
<DIV><FONT face=Arial size=2>I assume that the troubles are here:</FONT></DIV>
<DIV><FONT face=Arial size=2>~ when server access a page like this:</FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="">http://jkt6.detiksport.com/raket/index.php/home.read/tahun/2007/bulan/12/tgl/17/time/235133/idnews/868421/idkanal/79</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Engine-X will parse that as folder (identified by
slash (/)), but that doesn't really a folder. Those are a fuseBox parsing
methode.</FONT></DIV>
<DIV><FONT face=Arial size=2>I run this application in Apache, and everything
going well.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>What should I do ?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This is my nginx.conf and spawn-php.sh
config:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>---------------------------------------------nginx.conf--------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>user detik users;<BR>worker_processes
10;<BR>pid /var/run/nginx.pid;<BR>events {<BR> worker_connections
1024;<BR>}<BR>http {<BR> include
/usr/local/nginx/conf/mime.types;<BR> default_type
application/octet-stream;<BR> log_format main '$remote_addr - $remote_user
[$time_local]
'<BR>
'"$request" $status $body_bytes_sent "$http_referer"
'<BR>
'"$http_user_agent" "$http_x_forwarded_for"';<BR> sendfile on;<BR>
tcp_nopush on;<BR>
tcp_nodelay off;<BR>
gzip
on;<BR> gzip_http_version 1.0;<BR> gzip_comp_level 2;<BR>
gzip_proxied any;<BR> gzip_types text/plain
text/html text/css application/x-javascript text/xml application/xml
application/xml+rss text/javascript;<BR> server {<BR>
listen 202.158.66.30:80;<BR> client_max_body_size
50M;<BR> #server_name <A
href="">www.rubyonrailsworkshops.com</A>
rubyonrailsworkshops.com;<BR> # doc root<BR>
root /data/labdetiksport/site/sport;<BR> #access_log
/var/log/nginx.vhost.access.log main;<BR>
access_log /var/log/httpd/jkt6.detiksport-access.log
main;<BR> error_log /var/log/httpd/jkt6.detiksport-error.log
debug;<BR> if (-f $document_root/system/maintenance.html)
{<BR> rewrite ^(.*)$
/system/maintenance.html last;<BR>
break;<BR> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> location /
{<BR> proxy_set_header X-Real-IP
$remote_addr;<BR> # If the file exists as a static
file serve it directly without<BR> # running all
the other rewite tests on it<BR> if (-f
$request_filename) {<BR>
break;<BR> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> # check for
index.html for directory index<BR> # if its there
on the filesystem then rewite<BR> # the url to add
/index.html to the end of it<BR> # and then break
to send it to the next config rules.<BR> if (-f
$request_filename/index.html) {<BR>
rewrite (.*) $1/index.html break;<BR>
}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> # Look for existence
of PHP index file.<BR> # Don't break here...just
rewrite it.<BR> if (-f
$request_filename/index.php) {<BR>
rewrite (.*) $1/index.php;<BR> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> # this is the meat
of the rails page caching config<BR> # it adds
.html to the end of the url and then checks<BR> #
the filesystem for that file. If it exists, then
we<BR> # rewite the url to have explicit .html on
the end<BR> # and then send it on its way to the
next config rule.<BR> # if there is no file on the
fs then it sets all the<BR> # necessary headers
and proxies to our upstream mongrels<BR> if (-f
$request_filename.html) {<BR> rewrite
(.*) $1.html break;<BR> }<BR>
}<BR> location /content_images/
{<BR> alias
/data/images/;<BR> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> error_page 500 502
503 504 /500.html;<BR> location = /500.html
{<BR> root
/data/labdetiksport/site/sport;<BR> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> # Pass the PHP scripts to
FastCGI server listening on ip:port.<BR>
#<BR> # Requires you to start one instance of <A
href="">http://topfunky.net/svn/shovel/nginx/php-fastcgi.sh</A><BR>
location ~ \.php$ {<BR>
fastcgi_pass
127.0.0.1:9000;<BR>
fastcgi_index index.php;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
fastcgi_param SCRIPT_FILENAME
/data/labdetiksport/site/sport$fastcgi_script_name;<BR>
include
/usr/local/nginx/conf/fastcgi.conf;<BR>
#fastcgi_param QUERY_STRING
$query_string;<BR>
#fastcgi_param REQUEST_METHOD
$request_method;<BR>
#fastcgi_param CONTENT_TYPE
$content_type;<BR>
#fastcgi_param CONTENT_LENGTH
$content_length;<BR> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>}<BR>----------------------------------------------------------end of
nginx.conf-----------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT face=Arial
size=2><BR>----------------------------------------------------------spawn-php.sh-----------------------------------------------</FONT></DIV></FONT>
<DIV><FONT face=Arial size=2>#!/bin/bash</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2># Description: PHP-FastCgi start script from <A
href="">http://blog.kovyrin.net/2006/05/30/nginx-php-fastcgi-howto/</A><BR>#<BR>#
Author: Alexey Kovyrin <A href="">http://blog.kovyrin.net</A><BR># Comments by:
Geoffrey Grosenbach <A href="">http://topfunky.com</A><BR>#<BR># This script is
started once and receives PHP requests from Nginx for<BR># all apps. The Nginx
config passes the full path to the script being requested, so<BR># only one
fastcgi runner is needed for all apps, virtual hosts, etc.<BR>#<BR># See also
the init.d script for starting this on boot.<BR>#<BR># To install PHP, I had to
also compile the following:<BR>#<BR># * <A
href="">http://www.gnu.org/software/m4/</A><BR># * <A
href="">http://flex.sourceforge.net/</A><BR># * <A
href="">http://php.net/</A> with './configure --prefix=/usr/local
--enable-fastcgi'</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>## ABSOLUTE path to the PHP
binary<BR>PHPFCGI="/usr/local/bin/php"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>## tcp-port to bind
on<BR>FCGIPORT="9000"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>## IP to bind
on<BR>FCGIADDR="127.0.0.1"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>## number of PHP children to
spawn<BR>PHP_FCGI_CHILDREN=5</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>## number of request before php-process will be
restarted<BR>PHP_FCGI_MAX_REQUESTS=1000</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2># allowed environment variables sperated by
spaces<BR>ALLOWED_ENV="PATH USER"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>## if this script is run as root switch to the
following user<BR>USERID=detik<BR>GROUPID=users</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>################## no config below this
line</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>if test x$PHP_FCGI_CHILDREN = x; then<BR>
PHP_FCGI_CHILDREN=5<BR>fi</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>ALLOWED_ENV="$ALLOWED_ENV
PHP_FCGI_CHILDREN"<BR>ALLOWED_ENV="$ALLOWED_ENV
PHP_FCGI_MAX_REQUESTS"<BR>ALLOWED_ENV="$ALLOWED_ENV
FCGI_WEB_SERVER_ADDRS"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>if test x$UID = x0; then<BR># EX="/bin/su -m
-c \"$PHPFCGI -q -b $FCGIADDR:$FCGIPORT\" $USERID"<BR>
EX="/usr/local/bin/php -q -b 127.0.0.1:9000 detik"<BR>else<BR>
EX="$PHPFCGI -b $FCGIADDR:$FCGIPORT"<BR>fi</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>echo $EX</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2># copy the allowed environment
variables<BR>E=</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>for i in $ALLOWED_ENV; do<BR> E="$E
$i=${!i}"<BR>done</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2># clean environment and set up a new one<BR>nohup
env - $E sh -c "$EX" &> /dev/null &<BR></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT face=Arial size=2><FONT face=Arial size=2>
<DIV><BR>----------------------------------------------------------end of
spawn-php.sh-----------------------------------------------</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thank you very much for your kind attentions.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>best regards,</DIV>
<DIV><STRONG>Dika</STRONG></DIV>
<DIV>.indonesian</FONT></DIV></FONT></DIV></FONT></FONT></DIV></BODY></HTML>