Hello,<div><br></div><div>I&#39;m trying to run mapserver on nginx (fastcgi), but after 2 days booked little success.</div><div><br></div><div>1. I&#39;ve compiled mapserv with fastcgi support and validated this</div><div>
2. I created a spawn-fcgi startup script based on this : <a href="http://osgeo-org.1560.n6.nabble.com/Mapserver-on-nginx-td4226669.html">http://osgeo-org.1560.n6.nabble.com/Mapserver-on-nginx-td4226669.html</a></div><div>
<br></div><div>It now looks like this:</div><div><div>----</div><div>#!/bin/sh</div><div>MAPSERV_PORT=9001</div><div>USER=www-data</div><div>DAEMON=/usr/local/bin/mapserv</div><div>CHILDREN=5</div><div><br></div><div># the -F switch of spawn-fcg does not work when the -n swich</div>
<div># is set. using multiwatch instead</div><div># see <a href="http://manpages.ubuntu.com/manpages/lucid/man1/spawn-fcgi.1.html">http://manpages.ubuntu.com/manpages/lucid/man1/spawn-fcgi.1.html</a></div><div><br></div><div>
exec setuidgid $USER spawn-fcgi \</div><div>  -a 127.0.0.1 \</div><div>  -p $MAPSERV_PORT \</div><div>  -u $USER \</div><div>  /usr/bin/multiwatch -f $CHILDREN $DAEMON</div></div><div>----</div><div><br></div><div>In Nginx its called like this:</div>
<div><br></div><div><div>       location /mapserver/ {</div><div>                include /etc/nginx/fastcgi_params;</div><div>                fastcgi_pass <a href="http://127.0.0.1:9001">127.0.0.1:9001</a>;</div><div><br>
</div><div>                fastcgi_param SCRIPT_FILENAME /usr/local/run/spawnscript;</div><div>                fastcgi_param PATH_INFO /usr/local/run/
spawnscript;</div><div>        }</div></div><div><br></div><div>When i try to connect to /mapserver in my browser, i get an error stating 502 Bad gateway. </div><div><br></div><div>So i tried starting the spawn script manually: /usr/local/run/spawnscript . When i then try to connect using browser it works fine for a short while. On the console it logs this error:</div>
<div><div>Spawing child[0] failed, next try</div><div>Child[1] died, respawn</div><div>Child[2] died, respawn</div><div>Child[3] died, respawn</div><div>Child[4] died, respawn</div><div>Child[0] died, respawn</div><div>Spawing child[1] failed, next try</div>
<div>Spawing child[2] failed, next try</div><div>Spawing child[3] failed, next try</div><div>Spawing child[4] failed, next try</div><div>Spawing child[0] failed, next try</div><div>Spawing child[1] failed, next try</div><div>
Spawing child[2] failed, next try</div><div>Spawing child[3] failed, next try</div><div>Spawing child[4] failed, next try</div><div>Spawing child[0] failed, next try</div><div>Spawing child[1] failed, next try</div><div>Spawing child[2] failed, next try</div>
<div>Spawing child[3] failed, next try</div><div>Spawing child[4] failed, next try</div><div>Spawing child[0] failed, next try</div><div>Spawing child[1] failed, next try</div><div>Child[1] died to often, not forking again</div>
<div>Spawing child[2] failed, next try</div><div>Child[2] died to often, not forking again</div><div>Spawing child[3] failed, next try</div><div>Child[3] died to often, not forking again</div><div>Spawing child[4] failed, next try</div>
<div>Child[4] died to often, not forking again</div><div>Spawing child[0] failed, next try</div><div>Child[0] died to often, not forking again</div></div><div><br></div><div>After which the process exits and I revert to the 502 Bad gateway.</div>
<div><br></div><div>What am I missing here? :).</div><div><br></div><div>Thanks for any tips. I&#39;m not that experienced with spawn-fcgi.</div><div><br></div><div><br></div>