Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I was istalled Mapserver:

sudo apt-get install libgd2-xpm-dev
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install cgi-mapserver mapserver-bin

and istall nginx:

sudo apt-get install nginx
sudo apt-get install spawn-fcgi

But what i gonna do now to Mapserver work in nginx? Can you give me a some links to tutorials? OS: Ubuntu.

UPDATE

Okey. I found fastcgi config:

#!/bin/sh
MAPSERV_PORT=9001
USER=www-data
DAEMON=/usr/local/bin/mapserv
CHILDREN=5

# the -F switch of spawn-fcg does not work when the -n swich
# is set. using multiwatch instead
# see http://manpages.ubuntu.com/manpages/lucid/man1/spawn-fcgi.1.html

exec setuidgid $USER spawn-fcgi \
  -a 127.0.0.1 \
  -p $MAPSERV_PORT \
  -u $USER \
/usr/bin/multiwatch -f $CHILDREN $DAEMON

Now how to connect it to nginx?

UPDATE2

Now i add to the file /etc/nginx/sites-enabled/default follow lines:

   location /mapserver/ {
            include /etc/nginx/fastcgi_params;
            fastcgi_pass 127.0.0.1:9001;

            fastcgi_param SCRIPT_FILENAME /usr/local/run/spawnscript;
            fastcgi_param PATH_INFO /usr/local/run/ spawnscript;
   }

Where /usr/local/run/spawnscript path to my fastcgi config.

After i do:

/usr/lib/cgi-bin/mapserv -v

and get:

/usr/lib/cgi-bin/mapserv: /usr/local/lib/libgdal.so.1: no version information available (required by /usr/lib/libmapserver-6.2.1.so)
 MapServer version 6.2.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ
 SUPPORTS=GD SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS
 SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
 SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI
 SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

How i understand mapserver was installed correct.

Now i do:

sudo service nginx start

Go to localhos/mapserver/ but see only Welcome to nginx page. Whats wrong?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

I solve this problem. But i cant paste all configuration files here becouse too much text lines. I post in here: http://dotrem.blogspot.ru/2013/06/mapservernginxfastcgi-on-ubuntu.html.
Maybe its help to someone.

share|improve this answer
    
Instead of spawn-fcgi you can use supervisor. If you do so you won't need to create the init.d script. –  Antonis Christofides Jun 5 at 10:13
add comment
 apt-get install cgi-mapserver mapserver-bin

Then this worked for me: http://www.howtoforge.com/serving-cgi-scripts-with-nginx-on-debian-squeeze-ubuntu-11.04-p3 except i make:

root  /usr/lib;

http://domain.com/cgi-bin/mapserv

No query information to decode. QUERY_STRING is set, but empty.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.