Also, nginx isnt calling my spawn script. Is that normal? Otherwise the process would restart. But once it dies (the one i executed on the shell) it doesnt startup the script anymore.<br><br><div class="gmail_quote">2012/5/11 Peter Maes <span dir="ltr"><<a href="mailto:thxftw@gmail.com" target="_blank">thxftw@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>Thanks again for your answer Thomas.<br><div><br></div><div>I have seen that issue report and I am using mapserver latest version (6.0.2 (which is what you meant? or is there an actual 6.2 somewhere)</div>
<div><br></div><div>It does indeed keep working if i reference a good map and hammer F5. </div><div><br></div><div>Although: when i for instance call a wrong mapfile and hammer that it will also kill the processes. Is there a workaround for this? Otherwise people can just execute denial of service attacks on my mapserver.</div>
<div><br></div><div>We're already using nginx for static file hosting. It would be great if i could get a production ready mapserver environment there as well.</div><div><div class="h5"><div><br></div><div><br><div class="gmail_quote">
2012/5/11 thomas bonfort <span dir="ltr"><<a href="mailto:thomas.bonfort@gmail.com" target="_blank">thomas.bonfort@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You might want to have a look at<br>
<a href="https://github.com/mapserver/mapserver/issues/3099" target="_blank">https://github.com/mapserver/mapserver/issues/3099</a><br>
<br>
tl;dr<br>
- mapserver fastcgi calls exit() when running in an error condition,<br>
which causes some fastcgi spawning managers to have issues<br>
- mapserver 6.2 (current git master) has been refactored to greatly<br>
minimize the exit() occurences (basically only on memory allocation<br>
errors)<br>
<br>
--<br>
thomas<br>
<div><div><br>
On Fri, May 11, 2012 at 10:42 AM, Peter Maes <<a href="mailto:thxftw@gmail.com" target="_blank">thxftw@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> I'm trying to run mapserver on nginx (fastcgi), but after 2 days booked<br>
> little success.<br>
><br>
> 1. I've compiled mapserv with fastcgi support and validated this<br>
> 2. I created a spawn-fcgi startup script based on this<br>
> : <a href="http://osgeo-org.1560.n6.nabble.com/Mapserver-on-nginx-td4226669.html" target="_blank">http://osgeo-org.1560.n6.nabble.com/Mapserver-on-nginx-td4226669.html</a><br>
><br>
> It now looks like this:<br>
> ----<br>
> #!/bin/sh<br>
> MAPSERV_PORT=9001<br>
> USER=www-data<br>
> DAEMON=/usr/local/bin/mapserv<br>
> CHILDREN=5<br>
><br>
> # the -F switch of spawn-fcg does not work when the -n swich<br>
> # is set. using multiwatch instead<br>
> # see <a href="http://manpages.ubuntu.com/manpages/lucid/man1/spawn-fcgi.1.html" target="_blank">http://manpages.ubuntu.com/manpages/lucid/man1/spawn-fcgi.1.html</a><br>
><br>
> exec setuidgid $USER spawn-fcgi \<br>
> -a 127.0.0.1 \<br>
> -p $MAPSERV_PORT \<br>
> -u $USER \<br>
> /usr/bin/multiwatch -f $CHILDREN $DAEMON<br>
> ----<br>
><br>
> In Nginx its called like this:<br>
><br>
> location /mapserver/ {<br>
> include /etc/nginx/fastcgi_params;<br>
> fastcgi_pass <a href="http://127.0.0.1:9001" target="_blank">127.0.0.1:9001</a>;<br>
><br>
> fastcgi_param SCRIPT_FILENAME /usr/local/run/spawnscript;<br>
> fastcgi_param PATH_INFO /usr/local/run/ spawnscript;<br>
> }<br>
><br>
> When i try to connect to /mapserver in my browser, i get an error stating<br>
> 502 Bad gateway.<br>
><br>
> So i tried starting the spawn script manually: /usr/local/run/spawnscript .<br>
> When i then try to connect using browser it works fine for a short while. On<br>
> the console it logs this error:<br>
> Spawing child[0] failed, next try<br>
> Child[1] died, respawn<br>
> Child[2] died, respawn<br>
> Child[3] died, respawn<br>
> Child[4] died, respawn<br>
> Child[0] died, respawn<br>
> Spawing child[1] failed, next try<br>
> Spawing child[2] failed, next try<br>
> Spawing child[3] failed, next try<br>
> Spawing child[4] failed, next try<br>
> Spawing child[0] failed, next try<br>
> Spawing child[1] failed, next try<br>
> Spawing child[2] failed, next try<br>
> Spawing child[3] failed, next try<br>
> Spawing child[4] failed, next try<br>
> Spawing child[0] failed, next try<br>
> Spawing child[1] failed, next try<br>
> Spawing child[2] failed, next try<br>
> Spawing child[3] failed, next try<br>
> Spawing child[4] failed, next try<br>
> Spawing child[0] failed, next try<br>
> Spawing child[1] failed, next try<br>
> Child[1] died to often, not forking again<br>
> Spawing child[2] failed, next try<br>
> Child[2] died to often, not forking again<br>
> Spawing child[3] failed, next try<br>
> Child[3] died to often, not forking again<br>
> Spawing child[4] failed, next try<br>
> Child[4] died to often, not forking again<br>
> Spawing child[0] failed, next try<br>
> Child[0] died to often, not forking again<br>
><br>
> After which the process exits and I revert to the 502 Bad gateway.<br>
><br>
> What am I missing here? :).<br>
><br>
> Thanks for any tips. I'm not that experienced with spawn-fcgi.<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> mapserver-users mailing list<br>
> <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
><br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br>