[mapserver-users] MapServer Apache module (was: Re: Hiding overviews)

Daniel Morissette dmorissette at mapgears.com
Mon Mar 31 12:02:14 EDT 2008


Hi Andreas,

Eichner, Andreas - SID-NLK wrote:
> 
> Well, looked at the mail archive back till Jan 07 but could not find
> something about it in a first quick look. Maybe you can point me to the
> thread?

The thread was titled "ModMapServer?" and started on March 13:

http://lists.osgeo.org/pipermail/mapserver-dev/2008-March/006869.html

> 
> Sounds easy, doesn't it? Well, there's a last step which makes it IMHO
> being a real hack: the MapServer functions output the content type
> directly to the output stream via things like
> 'msIO_printf("Content-type: text/xml%c%c",10,10);' which have to be
> modified to set it in the Apache's request_rec.

I don't know what Apache expects exactly, but I think it would be 
reasonable to create a new msReturnHTTPHeaders() function that would 
replace all those printf's for the headers, and could pass the 
information to Apache when running as a module.

> There are still some things to improve I believe but that would require
> a deeper look into the source. Mainly this would involve a modification
> of the cleanup code to prevent the destruction of label, font and symbol
> caches. Also, in that environment it doesn't make much sense to close
> database connections so we could keep them open from Apache startup to
> shutdown and so would be nice to prepare the queries in the startup
> sequence for faster handling at runtime...
> 

The FastCGI code should already handle that kind of stuff, so if you try 
to follow the same execution path when running as an Apache module then 
you may not have any change to make.

With respect to keeping database connections opened, the PROCESSING 
"CLOSE_CONNECTION=DEFER" directive already does that, and keeps the 
connections between requests in FastCGI mode, see the PROCESSING docs in
http://ms.gis.umn.edu/docs/reference/mapfile/layer

> Daniel, I would prefer to send a commented patch directly to you first
> and let you decide what to do with it. Remember that I already missed
> some things with the metadata thing... May be tried to improve the world
> but really created the hell on earth ;-)
> 

Well, your patch doesn't have to be final before you share it publicly. 
I'm already swamped with stuff and don't have much time to review the 
patch in the next little while, plus there are a few people who 
expressed interest in this feature on the list and that would work out 
the issues with you much quicker than myself, so I think you should 
share your work and try to gather feedback from other interested parties 
as early as possible. That's taking full advantage of the open source 
way of doing things: throw an idea out there and use the feedback from 
the community to help you refine it.

Thanks for your interest in pursing those ideas BTW!

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/


More information about the mapserver-users mailing list