InstallTikiMapserverGentoo

Status/RoadMap
  • Where are we?

This is a development log for others to try and work on, its not a description of a production stable environment yet. Please feel free to further enhance this howto on installing MapServer on GentooLinux, configuring the setup especially for use wih TikiMaps feature, like the one in use here on tw.org's CommunityWorldMap.

  • Where do we want to be?

Use Mapserver with Tikiwiki.

Howto

We are supposing you got Tikiwiki already installed and running under Apache, Mysql and Php (using latest dev-lang/php layout).

Please also read as reference http://doc.tikiwiki.org/Maps+Install.

Gentoo bugzilla list one open entry for a search on mapserver, its http://bugs.gentoo.org/show_bug.cgi?id=69417(external link). There is an ebuild for Mapserver 4.6.1, lets use that with portage overlay feature.

Portage Overlay details can be found in the gentoo wiki:

$ echo "sci-libs/gdal geos" >> /etc/portage/package.use
$ emerge gdal
$ emerge '=dev-lang/php'

$ mkdir /usr/local/portage/net-www/mapserver -p
$ cd /usr/local/portage/net-www/mapserver
$ wget -O mapserver-4.6.1.ebuild http://bugs.gentoo.org/attachment.cgi?id=70931
$ echo "net-www/mapserver php proj gdal geos" >> /etc/portage/package.use
$ emerge mapserver
$ ebuild ./mapserver-4.6.1.ebuild digest
$ emerge mapserver

now there should be a php_mapscript.so php extension in /usr/lib/php(4,5)/lib/php/extensions/no-debug-non-zts-20041030

test using a special phpinfo php:

echo "<? \
  dl('php_mapscript.so'); \
  phpinfo(); \
?>" >> /var/www/phpinfo.php
you should have a MapScript? part up until now, lets configure for easy tikwiki setup

setup php.ini, add to the file

extension=php_mapscript.so

create maps dirs

$ mkdir /var/www/html/map
$ mkdir /var/www/html/map/data
$ mkdir /var/www/html/map/fonts
$ mkdir /var/www/html/map/graphics
$ mkdir /var/www/html/map/images

use map from doc.tikwiki.org tutorial to get started, maybe worldmap will be provided later on... go on to: http://doc.tikiwiki.org/Maps+Mapfile+Tutorial ...

or download the tikiwiki mapdata(external link) and extract it to /var/www/html/map (see README and Install)

$ cd /var/www/html/map
$ tar -xjf tikiwiki-mapdata-0.1.tar.bz2 
$ mv ./tikiwiki-mapdata-0.1/* ./
$ rm -fr ./tikiwiki-mapdata-0.1/

lets give apache all rights, be careful on prod so install vhosts.conf described later.

$ chown -R apache /var/www/html/map
Apache user must be able to modify mapfiles and able to save layers file, but httpd must not be allowed to download or run them directly or you have a security risk. Too easy to upload a .php file and then make it run....

link /map to tikiwiki root (to serve stuff from under tiki)

$ ln -s <yourtikiroot>/map /var/www/html/map

edit /etc/apache/vhosts.d/vhosts.conf (should be Included in httpd.conf), or you could add this to tikiroot/.htaccess

#protect mapserver against downloads
<Directory /var/www/html/map>
    AllowOverride All
    Options -Indexes FollowSymLinks MultiViews
    <IfModule mod_access.c>
         Order allow,deny
         Deny from all
    </IfModule>
</Directory>
<Directory /var/www/html/map/images>
    AllowOverride All
    Options -Indexes FollowSymLinks MultiViews
    <IfModule mod_access.c>
         Order allow,deny
         Allow from all
    </IfModule>
</Directory>
<Directory /var/www/html/map/graphics>
    AllowOverride All
    Options -Indexes FollowSymLinks MultiViews
    <IfModule mod_access.c>
         Order allow,deny
         Allow from all
    </IfModule>
</Directory>

restart apache

$ /etc/init.d/apache stop
$ /etc/init.d/apache start

now configure Tikiwiki to use /var/www/html/map as maps root: go to your tiki site's admin, and now setup the necessary stuff there:

open tiki-map.phtml see what happens ;)

see Navigating Maps Tutorial on docs for more


clean out the temporary images once in a while:

use something like tmpreaper or tmpwatch to clean /var/www/html/map/images add to /etc/cron.hourly/:

$ /usr/sbin/tmpwatch -f 2 /var/www/html/map/images/


for more see http://doc.tikiwiki.org/tiki-index.php?page=Maps%20Install

and http://mapserver.gis.umn.edu/doc/mapfile-reference.html(external link) for more specs

Competition and standards
  • google maps...

add more...

Discussion/participation

Where ideas can be exchanged, debated, etc. Interested people can subscribe to the wiki page and/or to these forums as they would a mailing list.

Other documentation, related stuff

Contributors to this page: Franck315 points  , Damian3543 points  and ang988 points  .
Page last modified on Friday 28 October 2005 00:58:44 CEST by Franck315 points .

Site Language: English