[MapServer-users] "msLoadMap(): Unable to access file..." for Mapserver 8.4.0

Guldberg, Erik Erik.Guldberg at ra.no
Fri Feb 28 02:21:42 PST 2025


Chmod 755 on the "home" and "erik" folders did the trick. 

Thanks!

Erik

-----Opprinnelig melding-----
Fra: MapServer-users <mapserver-users-bounces at lists.osgeo.org> På vegne av Jörg Thomsen (WhereGroup) via MapServer-users
Sendt: fredag 28. februar 2025 09:08
Til: mapserver-users at lists.osgeo.org
Emne: Re: [MapServer-users] "msLoadMap(): Unable to access file..." for Mapserver 8.4.0

Hi Eric,

you can trust the message 'unable to access....' Have you set the permissions for the whole path starting with 'home' and triple checked the path- and filename spellings?
The users home might be a non optimal place, try another directory like /mapfiles.

Not your problem, but I won't use rewrite rules with mapserver 8, you easily can stet mapfile aliases in the mapserver.conf without any dependencies on the apache version or restarting the webserver.

Jörg


Am 27.02.25 um 13:11 schrieb Guldberg, Erik via MapServer-users:
> I'm trying to set up a testing environment for Mapserver 8.4.0 in 
> WSL/Ubuntu, but I keep getting the error: msLoadMap(): Unable to 
> access file. (/home/erik/maps/kulturminner/kulturminner.map)
> 
> As far as I know, my setup is mostly the same as for my "real" server 
> where I run 7.6.4.
> 
> I have a mapserver.conf-file with a MS_MAP_PATTERN, and that works fine.
> 
> *Files and folders permissions:*
> 
> Folders: drwxr-xr-x (chmod 755)
> 
> Files:  -rw-r--r-- (chmod 644)
> 
> The owner is www-data, but I've also tried a regular user, which is 
> what I use for the server where I run 7.6.4.
> 
> *My Apache-setup looks like this:*
> 
> <VirtualHost *:80>
> 
>      SetEnv MAPSERVER_CONFIG_FILE /usr/local/etc/mapserver.conf
> 
>      ServerAdmin webmaster at localhost
> 
>      ErrorLog ${APACHE_LOG_DIR}/error.log
> 
>      CustomLog ${APACHE_LOG_DIR}/access.log combined
> 
>      ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
> 
>      RewriteEngine On
> 
>      RewriteRule ^/wms/(.*)
> /cgi-bin/mapserv.fcgi?map=/home/erik/maps/$1/$1.map [PT,QSA]
> 
>      <Directory "/usr/lib/cgi-bin/">
> 
>          AllowOverride None
> 
>          Options +ExecCGI -MultiViews +FollowSymLinks
> 
>          AddHandler fcgid-script .fcgi
> 
>          Require all granted
> 
>      </Directory>
> 
>      Header set Access-Control-Allow-Origin "*"
> 
> </VirtualHost>
> 
> *URLs*
> 
> Both URLs gives the same error
> 
> http://localhost/cgi-bin/mapserv?map=/home/erik/maps/kulturminner/kult
> urminner.map 
> <http://localhost/cgi-bin/mapserv?map=/home/erik/maps/kulturminner/kul
> turminner.map>
> 
> http://localhost/wms/kulturminner <http://localhost/wms/kulturminner>
> 
> Appreciate any help
> 
> Erik
> 
> 
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users

--
Viele Grüße,
Jörg Thomsen

---------------------------------------------
WhereGroup Shorts 2025 - am 15. Mai
Im Fokus: PostgreSQL & PostGIS
Online als ZOOM-Meeting

https://wheregroup.com/shorts/
---------------------------------------------



Jörg Thomsen
WhereGroup GmbH
Bundesallee 23
10717 Berlin
Germany

Tel: +49 (0)30 / 5130 278 74
Fax: +49 (0)30 / 5130 278 11	

joerg.thomsen at wheregroup.com
www.wheregroup.com

Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885


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


More information about the MapServer-users mailing list