This HowTo describes the installation and configuration process using Gentoo GNU Linux.
Prerequisites
a Gentoo Linux system (used for this HowTo)
- some basic knowledge about Gentoo.
- Internet connection
Software versions used for this HowTo
- apache-2.2.4-r7
- php-5.2.2-r1
- postgresql-8.2.4-r1
- mapserver-4.10.2
CartoWeb CVS from 19.06.2007 (needed to work with PHP 5.2.2)
Install required Software
For mapserver and other GIS software you need theGentoo-GIS overlay.
Install the layman overlay manager:
$ emerge layman
Download the Gentoo-GIS overlay:
$ layman -f -o http://gentoo-gis.sourceforge.net/layman.xml -a gentoo-gis
Following useflags for the packages are set on this system (Some might not be needed at all for CartWeb, some are not listed, but enabled: those are the ones enabled by default from Gentoo profile)
dev-lang/php dbase postgres tokenizer simplexml gd mysql -kerberos ctype pcre session bcmath sqlite pdo-external sci-geosciences/mapserver apache2 pdf perl proj python threads tiff xml java php postgis gdal geos net-www/apache mpm-worker
Now install all packages + dependencies:
$ emerge -av mapserver
If not already installed, this should also pull in apache and php.
Configure PHP
PHP will need some special settings in order cartoweb can be installed later on.
Edit /etc/php/cli-php5/php.ini and change following variables to look like here:
;;;;;;;;;;;;;;;;;; ; Fopen wrappers ; ;;;;;;;;;;;;;;;;;; ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. allow_url_fopen = On ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. allow_url_include = On
Also the apache2 PHP module needs some special configuration.
Edit /etc/php/apache2-php5/php.ini and add following:
;;;;;;;;;;;;;;;;;;;;;; ; Dynamic Extensions ; ;;;;;;;;;;;;;;;;;;;;;; extension=php_mapscript.so
Note: for raw image downlaods, e.g. like in demoGeostat you will also have to enable allow_url_fopen like shown above.
Download and install Cartoweb from CVS
$ cd /usr/local $ cvs -d :pserver:anonymous@dev.camptocamp.com:/var/lib/cvs/public co cartoweb3 $ cd cartoweb3 $ php ./cw3setup.php --base-url http://www.example.com/maps --install --no-symlinks
Note: for more info in installing cw3 see the original install information. Of course replace www.example.com with your server address.
Also note that symlinking is horribly broken in the install script, and causes dead links en masse.
You can check the cartoweb3 tree for broken symlinks with:
find . -type l ! -exec test -r {} \; -printIf this spits out a long list, delete the (broken) symlinks with
find . -type l|xargs rm -f
and use --no-symlinks as shown above!
Configure apache
In this example we only do a VERY BASIC Alias config, without vhosts etc. Please refer to the Gentoo Apache documentation if you want more complex setups.
Edit /etc/apache2/httpd.conf and add at the end:
<Directory "/usr/local/cartoweb3/htdocs"> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>
Edit /etc/apache2/vhosts.d/default_vhost.include
<IfModule alias_module> ... # cartoweb Alias /maps /usr/local/cartoweb3/htdocs ... </IfModule>
Then reload apache again:
/etc/init.d/apache2 reload
Now point you browser to http://www.example.com/maps and start playing