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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Neil Pritchard
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@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
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Simple fix but I'm new: I’ve installed MapServer but can’t see the layers on the ‘demo’

Andy Colson
On 09/04/2017 05:15 AM, Neil Pritchard wrote:
> 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:-
>
> Created the following apache configuration to the file in
> /etc/apache2/sites-available/001-mapserver.conf :-
>
> <VirtualHost *:80>
>      ErrorLog ${APACHE_LOG_DIR}/mapserver-error.log

That error log might contain some useful info, you should check it.

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

I've never gone through the example, so I might not understand.


>
> 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



But on openlayers sample page:
http://openlayers.org/en/latest/examples/epsg-4326.html?q=

it makes single layer requests like:
https://ahocevar.com/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=ne%3ANE1_HR_LC_SR_W_DR&TILED=true&WIDTH=256&HEIGHT=256&CRS=EPSG%3A4326&STYLES=&BBOX=0%2C-90%2C90%2C0

(Yes, its geoserver not mapserver, but the same params are sent to both.  And it contains SERVICE=WMS and REQUEST=GetMap)

Also, I should note, I've not used mapcache.  I think you should first get mapserver working and forget mapcache for the moment.  Put mapcache on top of a working mapserver.


-Andy
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users