[MapServer-users] Redirecting to s3 via apache2 redirect/alias/proxy

Marcin Niemyjski mniemyjski at cloudferro.com
Mon Oct 24 03:32:50 PDT 2022


Jukka, Lars

thanks for quick response.

Sorry for making a mistake and replying to you directly.

Lars
Yes, my apache has all required modules active and the bucket I'm using is a public bucket. To be honest I'm not fully understand the mechanism of Apache, I'll go back and try using structure from docs. I do not understand the reasoning behind using Environment variable in this case. From my experience environmental variable for example, can be used to point file in which erros would be written. Could you please tell me more precisely how to use it in my case?

Using env. variable for me wouldn't work because I'm using more than one mapfile (I'm displaying everyday S-2 scenes for Poland and Ukraine). The goal is to use mapserver hosted from docker, to which would be connected (apache redirect?) s3 bucket with mapfiles, so serving wms would be fully independent process without need to mount bucket.

I think I'll try this way:
https://stackoverflow.com/questions/9929487/using-apache-mod-alias-in-vhost-to-link-assets-from-external-server

Thank you both,
Marcin
________________________________
From: MapServer-users <mapserver-users-bounces at lists.osgeo.org> on behalf of Lars Fricke <lars.fricke at skendata.de>
Sent: Monday, October 24, 2022 11:37 AM
To: mapserver-users at lists.osgeo.org <mapserver-users at lists.osgeo.org>
Subject: Re: [MapServer-users] Redirecting to s3 via apache2 redirect/alias/proxy

Three things come to my mind:
1) Did you check if your Apache or NGINX respectively has the module installed and active?
2) You do not have credentials in your second S3 URL example. This may be an issue.
3) The structure in the doc's is different:
```
RewriteEngine on
RewriteRule wmsmap?(.*) /cgi-bin/mapserv?map=/home/www/mapserverstuff/mymapfile.map&$1
```
I don't use this method myself but you may want to try using exactly the same replacement structure?
As said before, you could als use an Environment variable.
Cheers Lars

Am 24.10.22 um 11:12 schrieb Marcin Niemyjski via MapServer-users:
Hello,

coming back to you with one more question about s3, namely:

As I wrote before - I want to keep my mapfiles on buckets but I also want to access them without need to mount buckets to VMs, so I've came up with this:

https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_p
https://mapserver.org/ogc/wms_server.html#changing-the-online-resource-url

generaly I want to do this:

ProxyPass        /martest/ https://s3.amazon.com/Bucket/Key
ProxyPassReverse /martest/ https://s3.amazon.com/Bucket/Key

or

RewriteEngine on
RewriteRule /martest/ https://s3.amazon.com/Bucket/

so, while using WMS online resource url https://www.lpis.pl/cgi-bin/mapserv?map=/martest/jrc.map i would connect to mapfile on s3.



But it doesn't seem to be working. Is this even possible to connect mapserver and s3 this way?

As always thank you for your help and time,
Marcin





_______________________________________________
MapServer-users mailing list
MapServer-users at lists.osgeo.org<mailto:MapServer-users at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/mapserver-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20221024/15e8dc3a/attachment-0001.htm>


More information about the MapServer-users mailing list