[mapserver-users] Simple fix but I'm new: I’ve installed MapServer but can’t see the layers on the ‘demo’

Neil Pritchard neil at neilpritchard.net
Mon Sep 4 03:15:47 PDT 2017


I’ve installed MapServer but can’t see the layers on the ‘demo’.
I followed the instructions on the MapServer website, to install
MapServer on Ubuntu LTS 16.04.3 Server:-

sudo apt-get update
sudo apt-get install apache2
sudo apt-get install libpng-dev
sudo apt-get install libjpeg-dev
sudo apt-get install curl
sudo apt-get install libpcre3-dev
sudo apt-get install libpixman-1-dev
sudo apt-get install libgdal1-dev
sudo apt-get install libgeos-dev
sudo apt-get install libsqlite3-dev
sudo apt-get install libtiff5-dev
sudo apt-get install software-properties-common python-software-properties
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get install cgi-mapserver
sudo apt-get install mapcache-cgi
sudo apt-get install libapache2-mod-mapcache
sudo apt-get install mapserver-bin
sudo apt-get install libapache2-mod-fastcgi
sudo service apache2 restart
sudo ldconfig

Created the following apache configuration to the file in
/etc/apache2/sites-available/001-mapserver.conf :-

<VirtualHost *:80>
ServerName 192.168.116.135

    <IfModule mapcache_module>
       <Directory /var/www/mapserver>
          Require all granted
       </Directory>
       MapCacheAlias /mapcache "/var/www/mapserver/mapcache.xml"
    </IfModule>

    ServerAdmin webmaster at localhost
    DocumentRoot /var/www/mapserver

    LogLevel warn
    ErrorLog ${APACHE_LOG_DIR}/mapserver-error.log
    CustomLog ${APACHE_LOG_DIR}/mapserver-access.log combined

sudo ln -s /etc/apache2/sites-available/001-mapserver.conf
/etc/apache2/sites-enabled/001-mapserver.conf

sudo mkdir /var/www/mapserver

sudo cp /usr/share/doc/libapache2-mod-mapcache/examples/mapcache.xml
/var/www/mapserver/

sudo apachectl restart

After installing I can see the following list when I call the URI
http://192.168.116.135/mapcache/demo/ :-
tms
wmts
gmaps
kml
ve
mapguide
wms

But when I browse to any of the links, I get empty pink tiles on a
white background. In Chrome's developer console, I see an error for
each tile:-
1.png:1 GET http://192.168.116.135/mapcache/tms/1.0.0/test@WGS84/1/1/1.png
net::ERR_EMPTY_RESPONSE
Image (async)
setImgSrc @ OpenLayers.js:494
initImage @ OpenLayers.js:493
renderTile @ OpenLayers.js:489
draw @ OpenLayers.js:489
drawTilesFromQueue @ OpenLayers.js:1352
(anonymous) @ OpenLayers.js:1350
(anonymous) @ OpenLayers.js:63

When working through this example:-
http://mapserver.org/uk/tutorial/example1-1.html#example1-1

I tried calling the URI to see a single layer:-
http://localhost/cgi-bin/mapserv?map=/ms4w/apps/tutorial/htdocs/example1-1.map&layer=states&mode=map

In my case I’m working on a headless Linux virtual machine so used the
following URI:-
http://192.168.116.135/mapcache?map=/ms4w/apps/tutorial/htdocs/example1-1.map&layer=states&mode=map

The HTML response only contained the following text:-
received wms with no service and request

In the developer console, Chrome shows the following error:-
mapcache Failed to load resource: the server responded with a status
of 400 (Bad Request)

Any help will be gratefully appreciated,

thanks.

Neil


More information about the mapserver-users mailing list