ok i finally got it working T_T thanks God.. everybody say yay ^^<br><br>requirement: <div>nginx or other web server with fcgi support<br><div>v8<br>v8cgi <br>spawn-fcgi <br>a js script that handle the requests, in this example /home/kyz/Projects/site/index.esp<div>
<br>======<br>init script:</div><div><br><div>#!/bin/sh</div><div>ESP_SCRIPT='/home/kyz/Projects/site/index.esp'</div><div>V8C_SCRIPT="/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data `which v8cgi` $ESP_SCRIPT"</div>
<div>KIL_SCRIPT="killall -v -9 `which v8cgi`"</div><div>RETVAL=0</div><div>case "$1" in</div><div> start)</div><div> $V8C_SCRIPT</div><div> RETVAL=$?</div><div> ;;</div><div> stop)</div>
<div> $KIL_SCRIPT</div><div> RETVAL=$?</div><div> ;;</div><div> restart)</div><div> $KIL_SCRIPT</div><div> $V8C_SCRIPT</div><div> RETVAL=$?</div><div> ;;</div><div> *)</div>
<div> echo "Usage: v8fcgi {start|stop|restart}"</div><div> exit 1</div><div> ;;</div><div> esac</div><div>ps aux | grep $ESP_SCRIPT | grep `which v8cgi`</div><div>exit $RETVAL</div><div><br>
</div></div><div>======</div><div>index.esp</div><div><br></div><div><div>#!/usr/local/bin/v8cgi</div><div>system.stdout(JSON.stringify(system.env));</div><div>response.write( '<html><body>' );</div><div>
response.write( HTML.dump(global) ); // scary but needed for debug</div><div>response.write( '</body></html>' );</div></div><div><br></div><div>======</div><div>nginx sites-available/default, add:</div>
<div><div> location ~ \.(sjs|ssjs|esp)$ {</div><div> fastcgi_pass <a href="http://127.0.0.1:9000">127.0.0.1:9000</a>;</div><div> #fastcgi_index index.esp; # i don't think this useful?</div>
<div> #fastcgi_param SCRIPT_FILENAME /usr/local/www/nginx$fastcgi_script_name; # what this one for?</div><div> include fastcgi_params; </div><div>
} </div></div><div><br></div><div><br></div><div><br>On Thu, Oct 15, 2009 at 7:35 AM, Kiswono Prayogo <<a href="mailto:kiswono@gmail.com">kiswono@gmail.com</a>> wrote:<br>> ngxv8 not good (yet), i've tried it, and remove it immediately.. ^^<br>
> yes, currently i'm trying nginx_http_js_module.. thanks for your suggestions ^^<br>><br>>> 3.<br>>> nginx_http_js_module or<br>>> nginx_http_js_module or --> typo?<br>>> ngxv8 ?<br>><br>
> node.js --> not using nginx<br>> jaxer --> not using nginx<br>> ngxv8 --> not for production<br>> v8cgi --> not using nginx, i will try this again..<br>><br>> Regards,<br>> GB<br>><br>
<br></div></div></div>