[Geoserver-users] Multiple WMS Services

Hi,

Is it possible to serve multiple WMS services with GeoServer? Like, with the
ArcIMS wmsconnector, I can add a "ServiceName=MyService" parameter to the
WMS request, and with UMN MapServer I can specify a different mapfile.

It seems to me that GeoServer serves all specified featuretypes, or maybe I
am missing something? It would definitely be nice if I could at least
specify a subset of layers.

Regards, Berend Veldkamp
--
View this message in context: http://www.nabble.com/Multiple-WMS-Services-tp16744137p16744137.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Berendv ha scritto:

Hi,

Is it possible to serve multiple WMS services with GeoServer? Like, with the
ArcIMS wmsconnector, I can add a "ServiceName=MyService" parameter to the
WMS request, and with UMN MapServer I can specify a different mapfile.

It seems to me that GeoServer serves all specified featuretypes, or maybe I
am missing something? It would definitely be nice if I could at least
specify a subset of layers.

No, GeoServer does not support that. We have talks about adding such a support, but it will require some significant changes in GeoServer, so
that's probably something delayed until GeoServer 2.0 (release date unknown).

For the moment, you have two options:
* if your layer set is stable, extract the capabilities once, save,
   manually alter them, save again under a different name, publish
   the capabilities file as a static file. Should be ok.
* otherwise, you can deploy multiple geoserver instances inside the
   same web container (Tomcat or similar).

Hope this helps
Cheers
Andrea

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: vrijdag 18 april 2008 14:53
To: Veldkamp, Berend
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Multiple WMS Services

Berendv ha scritto:
> Hi,
>
> Is it possible to serve multiple WMS services with GeoServer? Like,
> with the ArcIMS wmsconnector, I can add a "ServiceName=MyService"
> parameter to the WMS request, and with UMN MapServer I can
specify a different mapfile.
>
> It seems to me that GeoServer serves all specified featuretypes, or
> maybe I am missing something? It would definitely be nice
if I could
> at least specify a subset of layers.

No, GeoServer does not support that. We have talks about
adding such a support, but it will require some significant
changes in GeoServer, so that's probably something delayed
until GeoServer 2.0 (release date unknown).

For the moment, you have two options:
* if your layer set is stable, extract the capabilities once, save,
   manually alter them, save again under a different name, publish
   the capabilities file as a static file. Should be ok.
* otherwise, you can deploy multiple geoserver instances inside the
   same web container (Tomcat or similar).

Andrea,

Thanks for your reply.

I'm not sure it will work though: Most wms clients that I know of accept a service url, and append "service=WMS&request=getcapabilities" to it. So even if I have a static capabilities document elsewhere, it won't be found. Maybe Apache's mod_rewrite could come in handy here, though.

As for you other suggestion to run multiple instances of GeoServer, I think that could work, but right now I have set the GEOSERVER_DATA_DIR environment variable so that I can have my data located outside of my container directory (JBoss). AFAIK that env var would apply to both instances of GeoServer, so they would share their configuration. I'm not sure if I can have an environment var that applies to one war only, but I'll see what I can find out.

One very simple approach (maybe too simple :wink: would be to apply an xsl transformation to the capabilities document, so if the request contains for instance "service=myserv", then an xsl associated with that name would be applied.

Regards, Berend

<< Please read our E-mail Disclaimer at the Grontmij Corporate website >>

You might check Apache or other proxy tools for URL and parameter
rewriting abilities to insert and filter out layer parameters. Even if
you want to keep all layers in a single GeoServer, you might not have
GeoServer directly visible and instead require access through a proxy
which filters the available layers.

Is it possible to serve multiple WMS services with GeoServer?

Veldkamp, Berend ha scritto:

-----Original Message----- From: Andrea Aime
[mailto:aaime@anonymised.com] Sent: vrijdag 18 april 2008 14:53 To:
Veldkamp, Berend Cc: geoserver-users@lists.sourceforge.net Subject:
Re: [Geoserver-users] Multiple WMS Services

Berendv ha scritto:

Hi,

Is it possible to serve multiple WMS services with GeoServer?
Like, with the ArcIMS wmsconnector, I can add a
"ServiceName=MyService" parameter to the WMS request, and with
UMN MapServer I can

specify a different mapfile.

It seems to me that GeoServer serves all specified featuretypes,
or maybe I am missing something? It would definitely be nice

if I could

at least specify a subset of layers.

No, GeoServer does not support that. We have talks about adding
such a support, but it will require some significant changes in
GeoServer, so that's probably something delayed until GeoServer 2.0
(release date unknown).

For the moment, you have two options: * if your layer set is
stable, extract the capabilities once, save, manually alter them,
save again under a different name, publish the capabilities file as
a static file. Should be ok. * otherwise, you can deploy multiple
geoserver instances inside the same web container (Tomcat or
similar).

Andrea,

Thanks for your reply.

I'm not sure it will work though: Most wms clients that I know of
accept a service url, and append
"service=WMS&request=getcapabilities" to it. So even if I have a
static capabilities document elsewhere, it won't be found. Maybe
Apache's mod_rewrite could come in handy here, though.

I'm sure some users are already using this tactict, so it should
be working. Try modifying the files, store them in the www subfolder
of the geoserver data dir, calling them wmscaps1.xml, wmscap2.xml,
and then point the clients to
http://host:port/geoserver/www/wmscaps1.xml
http://host:port/geoserver/www/wmscaps2.xml

Even if the append extra stuff to the path, the file should be served
anyways. The issue is that the content type will be wrong, text/xml
istead of the wms suggested one. I don't think wms client do want
to be picky on this, but you never know.
If you find one let me know, if I have in mind a possible workaround.

As for you other suggestion to run multiple instances of GeoServer, I
think that could work, but right now I have set the
GEOSERVER_DATA_DIR environment variable so that I can have my data
located outside of my container directory (JBoss). AFAIK that env var
would apply to both instances of GeoServer, so they would share their
configuration. I'm not sure if I can have an environment var that
applies to one war only, but I'll see what I can find out.

There is another way to setup the data dir, which is to modify the
web.xml file and set it inside of it. This way you can have different
ones for different geoservers.

One very simple approach (maybe too simple :wink: would be to apply an
xsl transformation to the capabilities document, so if the request
contains for instance "service=myserv", then an xsl associated with
that name would be applied.

Ah yes, I guess that would work as well.
Cheers
Andrea