[mapserver-users] Production mapserver

2011-03-21 Thread Jeff Dege
What do we need to do to get Mapserver running in a production configuration?

There are packages out there to help new users get mapserver up and running in 
a development/playing-around-in mode, ms4w, etc. But these are designed for 
ease of installation, not performance on a production server.

I have a set of shapefiles, and some mapfiles I've built to display them.  I 
have them running on a dev machine, just fine.

So what do I need to do to go into production.

I have a dedicated Ubuntu 10.04 box, that will be doing nothing but serving 
maps through WMS requests, using Mapserver.  It currently has both Apache and 
MapServer installed, using the current apt-get packages.

Should I be using Apache?  Or should I use Lighttpd?

Standard CGI?  FastCGI?  Some other alternative?  (WSGI?)

Does Mapserver install on Ubuntu by default to use FastCGI?  How can I tell 
whether MapServer is running under FastCGI?  How do I configure it to do so, if 
it's not already?


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Production mapserver

2011-03-21 Thread Jeff Dege
Useful to know, but I don't want to let your comment distract from my original 
question.  I listed MS4W only as an example of an easy-to-install MapServer 
configuration.  What I'm actually trying to get working is MapServer on Linux.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jeff McKenna
Sent: Monday, March 21, 2011 11:34 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Production mapserver

On 11-03-21 1:27 PM, Jeff Dege wrote:

 There are packages out there to help new users get mapserver up and 
 running in a development/playing-around-in mode, ms4w, etc. But these 
 are designed for ease of installation, not performance on a production 
 server.

Quick comment:

MS4W is in fact ready to use in a production environment, and it is definitely 
used for production purposes by thousands of organizations: 
take the time to review the steps to enable FastCGI, for example 
(http://www.maptools.org/ms4w/index.phtml?page=README_INSTALL.html#f-fastcgi).

Long-time MS4W users might remember that the MS4W opening page used to state 
that it was not for production purposes; but that is no longer the case.

Thanks.

-jeff

--
Jeff McKenna
MapServer Consulting and Training Services http://www.gatewaygeomatics.com/




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Production mapserver

2011-03-21 Thread Jeff Dege
So, from what I'm hearing Apache vs. Lighttpd isn't going to make a significant 
difference.

Cgi vs. FastCGI very definitely will.

Great.  So how do I get FastCGI working?

There are docs at: http://mapserver.org/optimization/fastcgi.html

They are only getting me part of the way there.

1. I'm seeing two packages, that are available for Apache, mod_fastcgi and 
mod_fcgi.  Are these both needed?  Only one needed?  Are they replacements, 
alternatives, or entirely unrelated to each other?

2. In the Configuration section of the above doc, it says to modify http.conf 
to load the module, and to add a handler.  The Ubuntu packages placed 
fastcgi.conf and fastcgi.load in /etc/apache2/mods-available.  I expect that I 
simply need to create a link to these in /etcs/apache2/mods-enabled, the way 
the others are.

3. The Configuration section also says to add a FastCgiConfig command.  Where 
should this be? 

I see nothing in that configuration that indicates that it's the mapserv 
executable I want to run via fastcgi.  


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Problems getting started with POSTGIS

2011-03-18 Thread Jeff Dege
I've been using MapServer with shapefiles for some time.  I'm trying to convert 
a site to PostGIS, and I'm having problems.

I've successfully installed PostGIS on my Ubunto 10.04 box, and copied a number 
of shapefiles into it, using shp2pgsql.  I can view the new tables using qGIS, 
so I'm sure the data is right.

So now I've copies a mapfile that was working against the original shapefiles, 
and I'm trying to convert it to use PostGIS.  I'm working on just one layer, 
and I'm trying to test that layer with shp2img.

I've added to the LAYER definition:

LAYER
NAME countyboundaries
CONNECTIONTYPE postgis
CONNECTION host=localhost dbname=test_db 
user=gis password=x
DATA the_geom from gis_schema.county
[...]
END

As I said, I know the data is in the database, because I can load it as a 
PostGIS layer from qGIS.  Column and table names are right, because when I run 
select the_geom from gis_schema.county in the query tool I get the data.

But when I run shp2img from the commandline, I get an error:

$ shp2img -m test.map -o test.gif -i GIF -l countyboundaries
msDrawMap(): Image handling error. Failed to draw layer named 
'countyboundaries'.
msPostGISParseData(): Query error. Error parsing PostGIS DATA variable. Must 
contain 'geometry
from table' or 'geometry from (subselect) as foo'. County

shp2img is MapServer version 5.6.6, and the output from -v does contain 
INPUT=POSTGIS.

Any ideas?  I'm trying to keep things simple, and it's frustrating when simple 
doesn't work.


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Problems getting started with POSTGIS

2011-03-18 Thread Jeff Dege
I'm not seeing the query - I don't think I'm getting that far.

msPostGISWhichShapes called.
msPostGISParseData called.
msPostGISParseData(): Query error. Error parsing PostGIS DATA variable. Must 
contain 'geometry from table' or geometry from (subselect) as Foo'. County

But playing around, I saw that I was getting the same error regardless of what 
I put in the DATA variable.  Which made no sense.  I tried stuff that should 
not have worked at all, and saw no difference.

So I looked beyond my problematic DATA variable - and found another DATA 
variable, later in the LAYER definition.

If you remember, I started this by copying a mapfile that had been working with 
shapefiles.  I'd changed the CONNECTIONTYPE, added a CONNECTION, and a new DATA 
- but I hadn't deleted the old DATA.

Oops.




-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Stephen Woodbridge
Sent: Friday, March 18, 2011 4:44 PM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problems getting started with POSTGIS

On 3/18/2011 3:41 PM, Andy Colson wrote:
 On 3/18/2011 11:52 AM, Jeff Dege wrote:
 I've been using MapServer with shapefiles for some time. I'm trying 
 to convert a site to PostGIS, and I'm having problems.

 I've successfully installed PostGIS on my Ubunto 10.04 box, and 
 copied a number of shapefiles into it, using shp2pgsql. I can view 
 the new tables using qGIS, so I'm sure the data is right.

 So now I've copies a mapfile that was working against the original 
 shapefiles, and I'm trying to convert it to use PostGIS. I'm working 
 on just one layer, and I'm trying to test that layer with shp2img.

 I've added to the LAYER definition:

 LAYER

 NAME countyboundaries

 CONNECTIONTYPE postgis

 CONNECTION host=localhost dbname=test_db user=gis password=x

 DATA the_geom from gis_schema.county

 [...]

 END

 As I said, I know the data is in the database, because I can load it 
 as a PostGIS layer from qGIS. Column and table names are right, 
 because when I run select the_geom from gis_schema.county in the 
 query tool I get the data.

 But when I run shp2img from the commandline, I get an error:

 $ shp2img -m test.map -o test.gif -i GIF -l countyboundaries

 msDrawMap(): Image handling error. Failed to draw layer named 
 'countyboundaries'.

 msPostGISParseData(): Query error. Error parsing PostGIS DATA variable.
 Must contain 'geometry

 from table' or 'geometry from (subselect) as foo'. County

 shp2img is MapServer version 5.6.6, and the output from -v does 
 contain INPUT=POSTGIS.

 Any ideas? I'm trying to keep things simple, and it's frustrating 
 when simple doesn't work.

 I cant see anything really wrong. I'm doing mostly the same thing.

 however:

   CONNECTION dbname=test_db user=gis password=x

 because mapserver and PG run on the same box, I left off the 
 host=localhost... not sure if its important.

Yes, it might be, it depends on how postgresql is configured. You can test it 
with:

psql -U gis test_db
vs:
psql -U gis -h localhost test_db

   DATA the_geom from gis_schema.county using unique gid using srid=-1

 I also have the unique and srid things, again not sure if there'd be a 
 difference.

This also might be a problem. In general you should not use srid=-1 in the 
database of in the mapfile. When you load your data you should specify the 
correct srid and reference in the mapfile.

in your mapfile add:

MAP
   CONFIG MS_ERRORFILE stderr
   DEBUG 10

then run your shp2img again and you might get more debug info. You can also add 
the DEBUG 10 to you LAYER and I think it will spit out the SQL it is trying to 
execute so you can try it in psql and maybe get helpful messages there.

-Steve W


 And as a last hint, you can try bumping up the debug:

 MAP
 CONFIG MS_ERRORFILE /tmp/mapserver.log
 ...
 LAYER
 DEBUG 4
 ...
 END

 -Andy
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Is there a problem with layers when serving WMS?

2010-06-25 Thread Jeff Dege
I loaded the map into an openlayers mapping website, zoomed until I saw the 
spurious labels.  I then saved one of the 200x200 pixel tiles.  I examined the 
saved tile, to confirm that the extra labels were present.

Then I used the openlayers lat/lon tool to identify the corners of the saved 
tile.  I ran shp2img to create an image with a matching size and extent, using 
version MapServer Version 4.8.4 on Windows, and then again using MapServer 
version 5.6.1 on Ubuntu.

In both cases, the road geometry matched that of the tile I had saved.  The 
labels, though, were very different.  Using shp2img 4.8.4, the labels were 
closely aligned with the roads.  Using shp2img 5.6.1, one of the labels was 
placed well away from the road feature that was associated with it, and one 
label appeared for a featured that didn't appear in the image at all.

The label specification I'm using:

LABEL
COLOR 175 140 29
OUTLINECOLOR 239 233 242
TYPE TRUETYPE
FONT vera-bold
SIZE 6
ANTIALIAS TRUE
ANGLE AUTO
POSITION AUTO
PARTIALS FALSE
MINDISTANCE 300
BUFFER 4
END

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jeff McKenna
Sent: Friday, June 25, 2010 6:08 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Is there a problem with layers when serving WMS?

Jeff,

If I were you I would be degugging my mapfile with the shp2img 
commandline utility.  You can read the usual debugging steps at: 
http://www.mapserver.org/optimization/debugging.html#step-5-test-your-mapfile

Also, if you are having problems with scales, you might want to create a 
small mapfile with only that one problem scale (in other words remove 
all scale parameters from mapfile) and then test with shp2img to make 
sure your labels and features are drawn correctly.

Then once you have shp2img working good (you can also pass different 
extents to the shp2img utility so that you can test your mapfile at 
different extents/scales) you should then start testing your WMS service.

For testing a WMS service, the best way is to manually generate a 
GetCapabilities URL in a browser, verify its response is valid, then 
manually generate a GetMap URL in a browser for one layer.  (this avoids 
any issues with WMS clients like QGIS).

Once your manual URLs are working, then you can test in a WMS client, 
such as QGIS.

(those debugging steps may be slow, but I do that for every WMS instance 
I set up)

Have a great weekend.

-jeff

-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/




Jeff Dege wrote:
 I'm putting together a map via Mapserver and WMS (MapServer version 
 5.6.1 on Ubuntu 10.04), serving a set of shapefiles.
 
  
 
 The basic approach is to have a pair of layers for each class of 
 highways - interstate, US highways, state highways, local roads, etc.  
 One layer in each pair draws the geometry, the other draws the labels.  
 In this way, the user can turn the labels on and off, as needed.
 
  
 
 I'm having a problem with highway labels showing up nowhere near where 
 the highways are.  At my outermost zoom, all I'm displaying is the major 
 highway geometry and the interstate names.  That works OK.
 
  
 
 When I zoom in a bit, to where I start displaying the US highway names, 
 I see names all over the place, drawn where there are no geometries.  I 
 zoom in a bit more, and they go away.  (I'm viewing this with Quantum 
 GIS, loading the maps as WMS layers).
 
  
 
 To help track down what is going on, I took one of the names, did an 
 ogrinfo -where to identify that there was, in fact, a featured with 
 that name in the US highways shapefile.  I then extracted just those 
 features into a new shapefile, using ogr2ogr, and then loaded that as a 
 vector layer in Quantum GIS.  The aim was to find out where the feature 
 that matched that name actually was.
 
  
 
 It was nowhere near the label.  I set the new vector layer to draw in 
 red, and it was easy to see.  With a label from the WMS properly drawn 
 alongside.  But 75+ miles away, 600+ pixels across the map, was another 
 label for that feature, nowhere near the feature it was supposed to be 
 describing.
 
  
 
 I've never seen anything quite like this.  But then, I'm just figuring 
 out how to use mapserver to serve WMS.
 
  
 
 Are there any known gotchas, when drawing label layers in WMS?

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Is there a problem with layers when serving WMS?

2010-06-24 Thread Jeff Dege
I'm putting together a map via Mapserver and WMS (MapServer version 5.6.1 on 
Ubuntu 10.04), serving a set of shapefiles.

The basic approach is to have a pair of layers for each class of highways - 
interstate, US highways, state highways, local roads, etc.  One layer in each 
pair draws the geometry, the other draws the labels.  In this way, the user can 
turn the labels on and off, as needed.

I'm having a problem with highway labels showing up nowhere near where the 
highways are.  At my outermost zoom, all I'm displaying is the major highway 
geometry and the interstate names.  That works OK.

When I zoom in a bit, to where I start displaying the US highway names, I see 
names all over the place, drawn where there are no geometries.  I zoom in a bit 
more, and they go away.  (I'm viewing this with Quantum GIS, loading the maps 
as WMS layers).

To help track down what is going on, I took one of the names, did an ogrinfo 
-where to identify that there was, in fact, a featured with that name in the 
US highways shapefile.  I then extracted just those features into a new 
shapefile, using ogr2ogr, and then loaded that as a vector layer in Quantum 
GIS.  The aim was to find out where the feature that matched that name actually 
was.

It was nowhere near the label.  I set the new vector layer to draw in red, and 
it was easy to see.  With a label from the WMS properly drawn alongside.  But 
75+ miles away, 600+ pixels across the map, was another label for that feature, 
nowhere near the feature it was supposed to be describing.

I've never seen anything quite like this.  But then, I'm just figuring out how 
to use mapserver to serve WMS.

Are there any known gotchas, when drawing label layers in WMS?

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Layer ordering in WMS

2010-06-10 Thread Jeff Dege
I'm trying to figure out how to configure layer ordering when using Mapserver 
using WMS.  I'm not at all certain I've figured it out, yet, but one thing is 
clear - it's very complicated, depending upon the ordering of the layers in the 
mapfile, which groups the layers are a part of, whether the layers are 
configured with a status of ON or DEFAULT, and the ordering of the layers in 
the WMS request.

Is there some place in the documentation that explains all of this, or have I 
just missed it?
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users