[mapserver-users] MapCache 1.2.0 and NGNIX 1.5 problem

Pascual Ayats, Victor victor.pascual at icc.cat
Wed Oct 9 03:44:08 PDT 2013


OK, I upgrade nginx.conf to

 location @fcgi_mapcache {	

   fastcgi_param  QUERY_STRING     $query_string;
   fastcgi_param  REQUEST_METHOD   $request_method;
   fastcgi_param  CONTENT_TYPE     $content_type;
   fastcgi_param  CONTENT_LENGTH   $content_length;
   fastcgi_param  PATH_INFO        $path_info;
   fastcgi_param  SERVER_NAME      $server_name;
   fastcgi_param  SERVER_PORT      $server_port;
   fastcgi_param  SCRIPT_NAME      "/mapcache";	
   fastcgi_pass unix:/var/run/fcgiwrap.socket;
      }


I restart nginx, and the error is exactly the same

********************************************************************
fstat(1, {st_dev=makedev(0, 8), st_ino=30335, st_mode=S_IFIFO|0600, st_nlink=1, st_uid=502, st_gid=502, st_blksize=4096, st_blocks=0, st_size=0, st_atime=2013/10/09-11:26:39, st_mtime=2013/10/09-11:26:39, st_ctime=2013/10/09-11:26:39}) = 0
2932  mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc9c4488000
2932  write(1, "Status: 403 Forbidden\r\nContent-Type: text/plain\r\n\r\n403 Forbidden\r\n", 66 <unfinished ...>
2930  <... select resumed> )            = 1 (in [6])
2930  read(6, "Status: 403 Forbidden\r\nContent-Type: text/plain\r\n\r\n403 Forbidden\r\n", 4096) = 66
2930  select(9, [6 8], NULL, NULL, NULL <unfinished ...>
2932  <... write resumed> )             = 66
2932  write(2, "Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?", 112 <unfinished ...>
2930  <... select resumed> )            = 1 (in [8])
2930  read(8, "Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?", 4096) = 112
2930  write(2, "Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?", 112) = 112
2930  select(9, [6 8], NULL, NULL, NULL <unfinished ...>
**************************************************************************************************************

Continue searching.......

Regards

Victor
________________________________________
De: thomas bonfort [thomas.bonfort at gmail.com]
Enviat el: dimecres, 9 / octubre / 2013 10:41
Per a: Pascual Ayats, Victor
A/c: mapserver-users at lists.osgeo.org
Tema: Re: [mapserver-users] MapCache 1.2.0 and NGNIX 1.5 problem

well, try setting script_name:

fastcgi_param  SCRIPT_NAME      "/mapcache";

also make sure PATH_INFO is set as it is needed by mapcache. iirc
fastcgi_params did not include it by default at one point.

fastcgi_param  PATH_INFO        $path_info;

--
thomas

On 9 October 2013 10:31, Pascual Ayats, Victor <victor.pascual at icc.cat> wrote:
> Thanks for the point,
>
> Indeed, using  strace command, I created a debug LOG to spawn-FGC and saw this:
>
> 22419 rt_sigaction(SIGPIPE, {SIG_DFL, [PIPE], SA_RESTORER|SA_RESTART, 0x3259032920}, {0x35d0006290, [], SA_RESTORER, 0x3259032920}, 8) = 0
> 22419 fstat(1, {st_dev=makedev(0, 8), st_ino=160933, st_mode=S_IFIFO|0600, st_nlink=1, st_uid=502, st_gid=502, st_blksize=4096, st_blocks=0, st_size=0, st_atime=2013/10/09-07:51:04, st_mtime=2013/10/09-07:51:04, st_ctime=2013/10/09-07:51:04}) = 0
> 22419 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb6d96f6000
> 22419 write(1, "Status: 403 Forbidden\r\nContent-Type: text/plain\r\n\r\n403 Forbidden\r\n", 66 <unfinished ...>
> 22415 <... select resumed> )            = 1 (in [6])
> 22415 read(6, "Status: 403 Forbidden\r\nContent-Type: text/plain\r\n\r\n403 Forbidden\r\n", 4096) = 66
> 22415 select(9, [6 8], NULL, NULL, NULL <unfinished ...>
> 22419 <... write resumed> )             = 66
> 22419 write(2, "Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?", 112 <unfinished ...>
> 22415 <... select resumed> )            = 1 (in [8])
> 22415 read(8, "Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?", 4096) = 112
> 22415 write(2, "Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?", 112) = 112
> 22415 select(9, [6 8], NULL, NULL, NULL <unfinished ...>
> 22419 <... write resumed> )             = 112
> 22419 write(2, "\n", 1 <unfinished ...>
> 22415 <... select resumed> )            = 1 (in [8])
> 22415 read(8, "\n", 4096)               = 1
> 22415 write(2, "\n", 1)                 = 1
> 22415 select(9, [6 8], NULL, NULL, NULL <unfinished ...>
> 22419 <... write resumed> )             = 1
> 22419 exit_group(99)                    = ?
> 22415 <... select resumed> )            = 1 (in [6])
> 22415 read(6, "", 4096)                 = 0
> 22415 close(6)                          = 0
> 22415 select(9, [8], NULL, NULL, NULL)  = 1 (in [8])
> 22415 read(8, "", 4096)                 = 0
> 22415 close(8)                          = 0
> 22415 write(3, "\1\6\0\1\0B\6\0Status: 403 Forbidden\r\nContent-Type: text/plain\r\n\r\n403 Forbidden\r\n\0\0\0\0\0\0\1\6\0\1\0\0\0\0\1\3\0\1\0\10\0\0\0\0\0\0\0\0\0\0", 104) = 104
> 22415 shutdown(3, 1 /* send */)         = 0
> 22415 select(4, [3], NULL, NULL, {2, 0}) = 1 (in [3], left {1, 999997})
> 22415 read(3, "", 1024)                 = 0
> 22415 close(3)                          = 0
> 22415 accept(0,
>
>
> I Google the error "Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?"  and there's not a clean response or solution.
>
>
> So if you have any clue or idea to continue move forward I'll be very grateful.
>
> Thanks in advance
>
>
>
> Victor
>
>
> ________________________________________
> De: thomas bonfort [thomas.bonfort at gmail.com]
> Enviat el: divendres, 4 / octubre / 2013 10:00
> Per a: Pascual Ayats, Victor
> A/c: mapserver-users at lists.osgeo.org
> Tema: Re: [mapserver-users] MapCache 1.2.0 and NGNIX 1.5 problem
>
> You might want to check the spawn-fcgi logs. Note that there is no
> place in the mapcache code that emits a 403 error, i.e. that 403 is
> coming from something else than mapcache.
>
> --
> thomas
>
> On 4 October 2013 09:38, Pascual Ayats, Victor <victor.pascual at icc.cat> wrote:
>> Hi users,
>>
>>
>>
>> I compiled and installed MapServer 6.4 and MapCache 1.2 as fastcgi in a
>> Linux Red Hat 6 (64 bits)
>>
>>
>>
>> I compiled NGNIX 1.5 (adding MapCache as a module) and installed fcgiwarp
>> and spanw-fcgi in order to run fastcgi in NGNIX.
>>
>>
>>
>> MapServer works very well and fast but I have a problem dealing with
>> MapCache. MapCahce works well in GetCapbilities requests or when already
>> existing tiles in the file system pre generated by mapcacahe_seed , but when
>> I send a request and the tile not exist  then I received a “403 Forbbiden”
>> error.
>>
>>
>>
>> So MapCache “fails” when try to generate a tile on the fly.
>>
>>
>>
>> The 403 Forbbiden error not comes from NGINX (not appear in error log), so
>> it seems that the error comesfrom the spanw-cgi process or Mapcahe .fcgi??
>>
>> I have no idea what might happen and who to solve it
>>
>>
>>
>> Here’s the spanw-fcgi config
>>
>>
>>
>> FCGI_SOCKET=/var/run/fcgiwrap.socket
>>
>> FCGI_PROGRAM=/usr/local/sbin/fcgiwrap
>>
>> FCGI_USER=nginx
>>
>> FCGI_GROUP=nginx
>>
>> FCGI_EXTRA_OPTIONS="-M 0777"
>>
>> OPTIONS="-u $FCGI_USER -g $FCGI_GROUP -s $FCGI_SOCKET -S $FCGI_EXTRA_OPTIONS
>> -F 1 -P /var/run/spawn-fcgi.pid -- $FCGI_PROGRAM"
>>
>>
>>
>> Here’s the nginx .conf
>>
>>
>>
>> #Mapserver
>>
>>   location /maps/ {
>>
>> fastcgi_pass unix:/var/run/fcgiwrap.socket;
>>
>> include fastcgi_params;
>>
>> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
>>
>> }
>>
>>
>>
>> #Mapcache
>>
>>    location ~ ^/mapcache(?<path_info>/.*|$) {
>>
>>          set $url_prefix "/mapcache";
>>
>>          mapcache /opt/geo/data/mapcache/mapcache.xml;
>>
>>          error_page 404 = @fcgi_mapcache;
>>
>>
>>
>>       }
>>
>>
>>
>>   #MapCache 404
>>
>>    location @fcgi_mapcache {
>>
>>       fastcgi_pass unix:/var/run/fcgiwrap.socket;
>>
>>       include fastcgi_params;
>>
>>       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
>>
>>     }
>>
>>
>>
>> Any help will be greatly appreciated
>>
>>
>>
>> Best regards
>>
>>
>>
>> Victor Pascual Ayats
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list