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