[mapserver-users] MapServer as fast-cgi

Guillaume Sueur no-reply at neogeo-online.net
Sun May 30 14:47:27 EDT 2010


Hi,

I'm not sure your apache config is correct. Setting a specific alias for 
the default cgi-bin dir and using the alias as a specific Location can 
maybe give troubles. Maybe the default cgi-bin is applying first and 
your Location is not used at all.

My sunday 2 cents

Guillaume

Le 30/05/2010 17:44, Kai-Behncke at gmx.de a écrit :
> Hi Lars, also working on a sunday :-)
>
> Thank you very much for your reply.
>
> The fcgid-module is enabled/installed.
>
>
> I changed the pathes in the pathes you use,
> in the access.log of apache is written:
>
>
>
> 131.173.59.53 - - [30/May/2010:17:31:55 +0200] "GET
> /blabla/blabla/Testkarte12752335142537.jpg HTTP/1.1" 200 26397
> "http://www.mydomain.de/fcgi-bin/mapserv?map=/my_path/mapdatei.map" "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3)
> Gecko/20100401 Firefox/3.6.3 GTB7.0 ( .NET CLR 3.5.30729)"
>
> ...what looks quite good I think.
>
> If I restart apache I get:
>
>
> [Sun May 30 17:35:25 2010] [notice] mod_fcgid: process /blabla/cgi-bin/mapserv(2537) exit(shutting down), terminated by calling exit(), return code: 0
> [Sun May 30 17:35:26 2010] [notice] Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch configured -- resuming normal operations
>
> ....but I don`t get something like:
>
> [Sun May 30 16:38:27 2010] [info] mod_fcgid: server
> /var/www/clients/client1/web1/fcgi-bin/mapserv(21099) started
>
>
> ----
>> With fcgi your MapServer processes will stay in memory. You should see
>> them within "top" even when the map is already delivered. And with
>> CLOSE_CONNECTION=DEFER you can then reuse database connections which in
>> turn will make your application faster.
>
> I`m not sure if I understand. What do you mean with:
> "You should see them within "top" even when the map is already delivered."
>
> And  can`t I check it with the "Debug 5" in the log-file?
>
> Thank you very much, Kai
> -------- Original-Nachricht --------
>> Datum: Sun, 30 May 2010 16:47:24 +0200
>> Von: Lars Lingner<ml at lingner.eu>
>> An: mapserver-users at lists.osgeo.org
>> Betreff: Re: [mapserver-users] MapServer as fast-cgi
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 30.05.2010 16:10, Kai Behncke wrote:
>>> Dear users,
>>>
>>>
>>> I try to set up Mapserver with fast-cgi, but so far it doesn`t work as
>> it should do
>>> (well I think it doesn`t, I`m also not so sure how to test ist).
>>>
>>> * I have succesfully compiled MapServer 5.6.3 with fast-cgi (on Debian
>> 5.0)
>>>
>>> * Apache runs with mod_fcgid
>>>
>>> * In the mapfile I have implemented in the layers  "PROCESSING
>> "CLOSE_CONNECTION=DEFER"
>>>
>>> But some steps I don`t understand:
>>>
>>> In the apache-conf I set:
>>>
>>>
>>>
>>> ScriptAlias /fcgi-bin/ "/etc/apache2/cgi-bin/mapserv"
>>> <Location "/fcgi-bin">
>>> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>>> SetHandler fcgid-script
>>> Order allow,deny
>>> Allow from all
>>> #FastCgiConfig -initial-env PROJ_LIB=/usr/share/proj -initial-env
>> #LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/local/pgsql/lib #-appConnTimeout 60
>> -idle-timeout 60 -init-start-delay 1  -minProcesses 2 #-maxClassProcesses
>> 30 -startDelay 5
>>>
>>> </Location>
>>>
>>>
>>> a) If I comment in FastCGIConfig ...... I always get from the Apache:
>>> "Invalid command 'FastCgiConfig', perhaps misspelled or defined by a
>> module not included...." ??
>>>
>>> What might be the reason for that?
>>
>> Does Apache load the fcgid module?
>> You can check in /etc/apache2/mods-enabled if its enabled
>>
>> and in /etc/apache2/mods-available if its installed
>>
>> Or check the error.log of apache:
>> [Sun May 30 16:38:27 2010] [info] mod_fcgid: server
>> /var/www/clients/client1/web1/fcgi-bin/mapserv(21099) started
>>
>>
>> I have the following config:
>>
>> ScriptAlias /fcgi-bin/ "/path/to/fcgi-bin/"
>>
>> <Location "/fcgi-bin">
>>      SetHandler fcgid-script
>>      Options None
>>      Order allow,deny
>>      Allow from all
>> </Location>
>>
>> my /etc/apache2/mods-enabled/fcgid.conf looks like this:
>>
>> <IfModule mod_fcgid.c>
>>    AddHandler    fcgid-script .fcgi
>>    IPCConnectTimeout 20
>> </IfModule>
>>
>>
>>
>>>
>>> b) I start the Apache without the "FastCGIConfig" in the
>> apache-conf-file
>>>   and I run the MapServer as:
>>>
>>> http://www.xyz.de/fcgi-bin/?map=/path_to_my/mapfile.map
>>>
>>> ...this should be the way to run MapServer as fast-cgi, shouldn`t it?
>>
>> Hmm. I defined the scriptalias as path to the fcgi directory and not to
>> the binary. So the request URL is something like this:
>>
>> http://example.org/fcgi-bin/mapserv?map...&...
>>
>> But I don't know if your way might also be ok.
>>
>>
>>>
>>> c) I thought, if I run MS with "Debug 5" the layers should be produced
>> much faster, right?
>>> But the log-file doesn`t show any difference betwenn MS as cgi or fcgi,
>> this might be because of
>>> the missing FastCgiConfig in Apache, right?
>>>
>>
>> With fcgi your MapServer processes will stay in memory. You should see
>> them within "top" even when the map is already delivered. And with
>> CLOSE_CONNECTION=DEFER you can then reuse database connections which in
>> turn will make your application faster.
>>
>>
>> Lars
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.10 (GNU/Linux)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iEYEARECAAYFAkwCenEACgkQ0GRF77ebR/lSTACeO/vSeKLqQ1WphIb95/WqgZ3m
>> qOkAnjvmSo5NA1+6uE5b34RWOp7nZXPy
>> =lEMY
>> -----END PGP SIGNATURE-----
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>


More information about the mapserver-users mailing list