Loading...
 

InstallMapserverTikiwikiGentoo

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 (external link).

Installing Mapserver using Gentoo is simple, as Mapserver has an ebuild in portage.

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


after the emerge, there should be a php_mapscript.so php extension in
/usr/lib/php(4,5)/lib/php/extensions/no-debug-non-zts-<somedate>

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 (external link) ...

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 /var/www/html/map <yourtikiroot>/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 (external link) 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 (external link)

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

Competition and standards
  • google maps...
add more...

Other documentation, related stuff