Re: [mapserver-users] Restricted WMS access
Hi, For simple needs you can configure Apache to use http basic authentication and make it to require https. http://httpd.apache.org/docs/2.0/howto/auth.html Setting basic authentication is simple but it does not give any real security without configuring Apache to use https instead of http. But anyway, Mapserver project does not give you tools for access control. Consider if https + basic authentication is enough for you. It may be if you do not need user roles and all it should do is either to give or deny access to Mapserver. Most simple way to do this is to put the cgi-bin directory behind passwords somehow like Location /cgi-bin Options None Order allow,deny Allow from all AuthType Basic AuthName Please log in # (Following line optional) AuthBasicProvider file AuthUserFile c:/ms4w/apache/passwd/passwords Require user user1 user2 user3 /Location As a result only user1, user2 and user3 can reach cgi-bin if they give correct password. -Jukka Rahkonen- Richard Suematsu I don't think MapServer does this itself. We've done this by proxying MapServer behind tomcat and using a servlet filter to validate the user. Rich -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Alberto Najera Sent: Monday, May 28, 2012 2:35 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] Restricted WMS access Hello, Is it possible to have a restricted (user id and password required) WMS service through Mapserver? If so, how can this be done? I have searched the documentation but had not been able to find if this is possible. Thank you Alberto Najera ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Unauthorized review, use, disclosure or distribution is prohibited. If you are not the addressee indicated in this message kindly notify the sender by reply e-mail and destroy all copies of the original message. ___ 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] MapCache - A way to reduce BerkeleyDB Cache size ?
Salut Thomas, I've changed the default page size (pagesize=1k) as you mention and the size of my Berkeley test DB is now exactly the same as SQLite DB (48 Mo in my test) :) Yes it would be great to make it configurable in mapcache.xml as an advanced configuration option. But do you think that the use of pagesize=1ko will have a lot of effects on read/write process? I'm afraid of loosing performance. Thanks your help. Ludovic -- View this message in context: http://osgeo-org.1560.n6.nabble.com/MapCache-A-way-to-reduce-BerkeleyDB-Cache-size-tp4976403p4977971.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] MapCache - A way to reduce BerkeleyDB Cache size ?
I did not do any extensive testing of the performance overhead induced by the change in cache size. A very unscientific quick test showed that with 1k pages the bdb cache was marginally slower than the disk cache, but the difference wasn't significant enough to be able to come up with any conclusions. To summarize, I would be interested in any results you obtain if you want to run some benchmarks against different pagesizes ;) -- thomas On Wed, May 30, 2012 at 10:37 AM, Ludovic Gnemmi lgne...@rgd73-74.fr wrote: Salut Thomas, I've changed the default page size (pagesize=1k) as you mention and the size of my Berkeley test DB is now exactly the same as SQLite DB (48 Mo in my test) :) Yes it would be great to make it configurable in mapcache.xml as an advanced configuration option. But do you think that the use of pagesize=1ko will have a lot of effects on read/write process? I'm afraid of loosing performance. Thanks your help. Ludovic -- View this message in context: http://osgeo-org.1560.n6.nabble.com/MapCache-A-way-to-reduce-BerkeleyDB-Cache-size-tp4976403p4977971.html Sent from the Mapserver - User mailing list archive at Nabble.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] OGRVRT Data Sources and SQL server
Hi Robert and Jeff I tried those steps (think FID is optional) and no further - more blank outputs using shp2img (ms bebugging at 5 - no errors at all, happily finds layer and draws it - apparently! - should rename my layer to snowflakes or white cats). Have run shp2img debugging - nothing obvious, but couldn't print out output (can send screenshot if anyone interested). Not sure how to retrieve the sql query sent (Jeff?). I have grabbed the output from ogrinfo (see below - no extents...does that mean something) - seems to be working ok to the untrained eye! Mapfile below too (NB. have tried with and without projections at map and layer level), I am baffled, will start to use a later version of ms4w and check on another server too. Cheers Chris ogrinfo output: INFO: Open of `d:/xxx/xxx/omreg2.ovf' using driver `VRT' successful. Layer name: omreg1 Geometry: Point Feature Count: 5 Layer SRS WKT: GEOGCS[WGS 84, DATUM[WGS_1984, SPHEROID[WGS 84,6378137,298.257223563, AUTHORITY[EPSG,7030]], AUTHORITY[EPSG,6326]], PRIMEM[Greenwich,0, AUTHORITY[EPSG,8901]], UNIT[degree,0.01745329251994328, AUTHORITY[EPSG,9122]], AUTHORITY[EPSG,4326]] SiteKeyID: Integer (10.0) SiteID: Integer (10.0) SiteType: String (255.0) SiteName: String (255.0) SiteLat: Real (0.0) SiteLong: Real (0.0) OGRFeature(omreg1):1 SiteKeyID (Integer) = 2269 SiteID (Integer) = 1 SiteType (String) = Regulated tidal exchange SiteName (String) = Abbotts Hall (Stage 1) SiteLat (Real) = 0.84556009184722 SiteLong (Real) = 51.7846475991705 POINT (51.784647599170498 0.84556009184722) My mapfile now is this: MAP UNITS meters EXTENT -15 30 40 70 SIZE 600 500 SHAPEPATH d:\xxx\xxx\ SYMBOLSET ../common/symbols/symbols-pmapper.sym FONTSET ../common/fonts/msfontset.txt RESOLUTION 96 IMAGETYPE png INTERLACE OFF CONFIG PROJ_LIB D:\xxx\proj\nad\ CONFIG GDAL_DATA D:\xxx\gdaldata\ CONFIG MS_ERRORFILE D:\x\tmp\ms_error.txt DEBUG 5 PROJECTION #init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs no_defs END # # Image formates for GD # OUTPUTFORMAT NAME png DRIVER GD/PNG MIMETYPE image/png IMAGEMODE RGB FORMATOPTION INTERLACE=OFF TRANSPARENT OFF EXTENSION png END OUTPUTFORMAT NAME png8 DRIVER GD/PNG MIMETYPE image/png IMAGEMODE PC256 FORMATOPTION INTERLACE=OFF TRANSPARENT OFF EXTENSION png END OUTPUTFORMAT NAME jpeg DRIVER GD/JPEG MIMETYPE image/jpeg IMAGEMODE RGB FORMATOPTION QUALITY=70 EXTENSION jpg END OUTPUTFORMAT NAME GTiff DRIVER GDAL/GTiff MIMETYPE image/tiff IMAGEMODE RGB FORMATOPTION TFW=YES #FORMATOPTION COMPRESS=PACKBITS EXTENSION tif END OUTPUTFORMAT NAME imagemap MIMETYPE text/html FORMATOPTION SKIPENDTAG=OFF DRIVER imagemap END LAYER NAME test TYPE POINT CONNECTIONTYPE OGR CONNECTION omreg2.ovf # have also tried ./omreg2.ovf - both files in same folder - no luck with either DATA omreg1 PROJECTION #init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs no_defs END STATUS ON CLASS SYMBOL 1 SIZE 6 COLOR 255 0 0 LABEL SIZE MEDIUM TYPE BITMAP COLOR 0 0 0 END END END END #Map On 29 May 2012 21:54, Robert Sanson robert.san...@asurequality.com wrote: Hi Chris You need to define the primary key in your .ovf file: FIDfarmgate_id/FID I put the .ovf file in the same directory as my .map file, then Mapserver can find it: CONNECTION ./farmgates.ovf All thebest, Robert ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Mapserver Legend using html template
Dear All, I'm currently trying to make mapserver show in a legend different classes in the same layer. Right now the classes are rendered using the same shape (point) and different colors correctly based on expressions in each class of the layer. The legend works correctly when I turn on another line layer without classes. Below I've included snippets (Legend tag, layer tag) from my mapfile, and one from my html template. Maybe you can tell me what I'm doing wrong because I cannot find any discrepancies between what the documentation says to do and what I have. Here is the Legend tag in my mapfile: LEGEND STATUS ON POSITION LR IMAGECOLOR 237 248 177 END Here is a sample from the layer I'm trying to put into the legend LAYER NAME jobstatus STATUS ON #GROUP default TYPE POINT CONNECTIONTYPE postgis CONNECTION host=localhost dbname=jobstatus2012 user=*password=** port=5432 #MAXSCALEDENOM 1 DATA geom from statusb5_19_2012 using unique proposal_n using srid=3754 PROJECTION init=epsg:3754 END CLASSITEM 'proposal_n' LABELITEM 'proposal_n' CLASSGROUP status CLASS NAME status1 GROUP status1 EXPRESSION ( '[current_st]' eq 'Remediation') STYLE SYMBOL circle COLOR 96 225 9 OUTLINECOLOR 96 225 9 SIZE 3 END LABEL COLOR 0 0 0 OUTLINECOLOR 0 0 0 POSITION AUTO END END CLASS NAME status2 GROUP status2 EXPRESSION ( '[current_st]' eq 'New Proposal') STYLE SYMBOL circle COLOR 251 240 28 OUTLINECOLOR 251 240 28 SIZE 3 END LABEL COLOR 0 0 0 OUTLINECOLOR 0 0 0 POSITION AUTO END END CLASS NAME status3 GROUP status3 EXPRESSION ( '[current_st]' eq 'Data Collection') STYLE SYMBOL circle COLOR 39 29 250 OUTLINECOLOR 39 29 250 SIZE 3 END LABEL COLOR 0 0 0 OUTLINECOLOR 0 0 0 POSITION AUTO END END Finally here is a sample from my html template HRIMG SRC=[legend]HR Thanks to anyone who can help! Paul A. Maddock Mapping Technician IJUS LLC 560 Officenter Place Gahanna, OH 43230 Cell: (513) 404-6476 [cid:image001.gif@01CD3E74.0915E250]http://www.ijus.net/index.html inline: image001.gif___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Restricted WMS access
Thanks for the information, I am getting the idea. I would not like to restrict the cgi-bin as we have some maps that are not restricted. Would it be possible to restrict only the folder where the restricted Mapfiles are located? Alberto Najera -Mensaje original- De: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] En nombre de Rahkonen Jukka Enviado el: miércoles, 30 de mayo de 2012 03:29 a.m. Para: 'mapserver-users@lists.osgeo.org' Asunto: Re: [mapserver-users] Restricted WMS access Hi, For simple needs you can configure Apache to use http basic authentication and make it to require https. http://httpd.apache.org/docs/2.0/howto/auth.html Setting basic authentication is simple but it does not give any real security without configuring Apache to use https instead of http. But anyway, Mapserver project does not give you tools for access control. Consider if https + basic authentication is enough for you. It may be if you do not need user roles and all it should do is either to give or deny access to Mapserver. Most simple way to do this is to put the cgi-bin directory behind passwords somehow like Location /cgi-bin Options None Order allow,deny Allow from all AuthType Basic AuthName Please log in # (Following line optional) AuthBasicProvider file AuthUserFile c:/ms4w/apache/passwd/passwords Require user user1 user2 user3 /Location As a result only user1, user2 and user3 can reach cgi-bin if they give correct password. -Jukka Rahkonen- Richard Suematsu ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver Legend using html template
On 12-05-30 6:30 PM, Paul Maddock wrote: Dear All, I’m currently trying to make mapserver show in a legend different classes in the same layer. Right now the classes are rendered using the same shape (point) and different colors correctly based on expressions in each class of the layer. The legend works correctly when I turn on another line layer without classes. Below I’ve included snippets (Legend tag, layer tag) from my mapfile, and one from my html template. Maybe you can tell me what I’m doing wrong because I cannot find any discrepancies between what the documentation says to do and what I have. Hi Paul, Are you referring to an HTML Legend Template? http://www.mapserver.org/output/html_legend.html Or maybe I am misunderstanding your question. -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
Re: [mapserver-users] MapCache - A way to reduce BerkeleyDB Cache size ?
Hi Thomas So size looks really good. Recreated one of our caches which has minimal 'blank tiles', and av. tile size is reasonably heavy ~ 24K File Based: 65G Previous BDB (empty-tiles branch) 142G BDB (empty-tiles branch) with PAGESIZE 1*1024 62G However I have run into an issue with apache. Getting seg fault messages in apache error log, e.g. [notice] child pid exit signal Segmentation fault (11) Which requires restart of apache to make things work again. Was trying to work out the steps required to reproduce, restarting apache each time and I ran into a different error, I think the one you have mentioned before, relating to multiple restarts of apache unable to allocate memory for mutex; resize mutex region [Thu May 31 17:13:32 2012] [error] [client IP] failed to aquire connection to bdb backend: bdb cache failure 1 for db-open: Cannot allocate memory, referer: http:/server/bdb_test.html Running a db_recover on it fixes this, as you mentioned. I need to head home now, but happy to debug tomorrow, if you run me through the steps. Cheers Andrew -Original Message- From: thomas bonfort [mailto:thomas.bonf...@gmail.com] Sent: Tuesday, 29 May 2012 11:07 p.m. To: Ludovic Gnemmi; Andrew Cowie Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] MapCache - A way to reduce BerkeleyDB Cache size ? Salut Ludovic, hi Andrew, I've investigated a bit more on the disk space issue with berkeley db backends, and here are some of my findings. To summarize, the space occupancy/efficiency is closely tied to the size of the images stored in the cache, and the configured pagesize of the bdb backend. For a cache that contains many empty tiles, i.e. that are just a few hundred to a couple thousand bytes, here are the space occupancies (the disk cache uses 4k blocks). This is for reference only, usual caches will not resemble this one. Also note that the disk cache was not configured to symlink blank tiles, and that the bdb cache backend has some code in it to reduce the tile data stored on empty tiles. disk: 197M bdb pagesize=64k: 106M bdb pagesize=4k: 96M bdb pagesize=1k: 73M sqlite: 103M mbtiles (sqlite with blank tile detection): 62M So these numbers actually aren't so bad for bdb in all configurations, but in this case the 4k filesytem blocksize is really inefficient. These are the occupancies for another tileset, where the tiles are much heavier (tiles around 40-45k). There are also quite a few empty tiles. disk:153M bdb pagesize=64k: 209M bdb pagesize=4k: 148M bdb pagesize=1k: 144M sqlite: 140M mbtiles (sqlite with blank tile detection): 137M I had initally stayed away from using small pagesizes in the bdb backend because of some stability issues, but in the current tests I have not run into any issues. From these tests, I think the natural way forward is to change the default pagesize, and maybe make it configurable in mapcache.xml as an advanced configuration option. If you are able to confirm my findings on your instances, that would be great. To set the pagesize you'll have to recompile/reinstall, after having changed lib/cache_bdb.c by replacing #define PAGESIZE 64*1024 by #define PAGESIZE 1*1024 near line 50. regards, thomas On Wed, May 23, 2012 at 3:55 PM, Ludovic Gnemmi lgne...@rgd73-74.fr wrote: Hi list, I would like to experiment Berkeley DB cache type but i'm surprised of the resulting db size compared to sqlite cache type. Here is my results for about 13000 tiles: Total tiles size = 44 Mb Sqlite = 48 Mb Berkeley DB = 61 Mb Disk = 66 Mb (with 4kb filesystem block size) I thought i could reduce storage capacity with Berkeley DB cache type as with Sqlite but it seems there is not much difference with disk cache type. Is there a way to reduce Berkeley DB cache size ? Thanks for your help Ludovic -- View this message in context: http://osgeo-org.1560.n6.nabble.com/MapCache-A-way-to-reduce-BerkeleyD B-Cache-size-tp4976403.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users Please consider the environment before printing this email Warning: This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not read, use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails. The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users