aheinecke@346: ------------ aheinecke@346: Installation from Source aheinecke@346: ------------ aheinecke@346: This Documentation describes how you can install MXD2Map from source on GNU/Linux Systems. aheinecke@346: aheinecke@346: Download the Source tarball of mxd2map and extract it into a directory. aheinecke@346: The Path used in this example is ~/mxd2map. aheinecke@346: aheinecke@346: Requirements aheinecke@346: ------------ aheinecke@346: To run the converter you need at least the following components: aheinecke@346: aheinecke@346: * Sun Java6 SDK / JRE and ant aheinecke@346: * ArcEngine10.x with a valid licence enabled aheinecke@346: * Some additional Java Tools and libraries as documented below aheinecke@346: aheinecke@346: Install ArcGIS SDK aheinecke@346: ------------------ aheinecke@346: # As root: aheinecke@346: # !!! Deactivate SELINUX !!! aheinecke@346: # ArcGIS fails in many mysterious ways otherwise. aheinecke@346: # write SELINUX=permissive into: /etc/sysconfig/selinux aheinecke@346: setenforce Permissive aheinecke@346: aheinecke@346: yum-install compat-libstdc++-33 compat-libstdc++-296 compat-libf2c compat-libgcc-296 \ aheinecke@346: compat-openldap-2.3 cairo compat-libf2c-34 mesa-libGLU compat-gcc-34 freeglut-2.4 gmp glibc gtk2 gtk2-devel \ aheinecke@346: libidn mesa-libGL mesa-libGLU openldap openmotif-devel openmotif openssl convmv aheinecke@346: yum-groupinstall "Legacy Software Support" aheinecke@346: yum-groupinstall "X Window System" aheinecke@346: yum-groupinstall "Legacy Software Development" aheinecke@346: yum-groupinstall "X Software Development" aheinecke@346: yum-groupinstall "Development Tools" aheinecke@346: useradd mxd2map aheinecke@346: groupadd arcgis-users aheinecke@346: usermod -a -G arcgis-users mxd2map aheinecke@346: mkdir -p /usr/local/share/macrovision/storage aheinecke@346: chmod g+w /usr/local/share/macrovision/storage aheinecke@346: chgrp arcgis-users /usr/local/share/macrovision/storage aheinecke@346: aheinecke@346: # Set passwd for user mxd2map and log in as that user aheinecke@346: aheinecke@346: /mnt/ArcGIS-SDK/linux/EngineRT/Setup aheinecke@346: # Click through the dialog leave everything as default aheinecke@346: /mnt/ArcGIS-SDK/linux/ArcObjectsSDKJava/Setup aheinecke@346: # Click through the dialog leave everything as default aheinecke@346: # Register "ArcGIS Engine Runtime and ArcGIS Engine Developer Kit (Single Use)" aheinecke@346: export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0 aheinecke@346: . ~/arcgis/developerkit10.0/init_devkit.sh aheinecke@346: . ~/arcgis/developerkit10.0/java/tools/setenv_ant.sh aheinecke@346: aheinecke@346: Install additional libraries aheinecke@346: ---------------------------- aheinecke@346: cd ~/mxd2map aheinecke@346: mkdir lib aheinecke@346: ## Jargs aheinecke@346: wget http://sourceforge.net/projects/jargs/files/jargs/1.0/jargs-1.0.tar.bz2/download -O - | \ aheinecke@346: tar -xj jargs.jar -O > jargs.jar aheinecke@346: aheinecke@346: ## log4j aheinecke@346: wget http://archive.apache.org/dist/logging/log4j/1.2.9/logging-log4j-1.2.9.tar.gz -O - | \ aheinecke@346: tar -xz log4j-1.2.9.jar -O > log4j.jar aheinecke@346: aheinecke@346: ## Commons codec aheinecke@346: wget http://apache.openmirror.de/commons/codec/binaries/commons-codec-1.7-bin.tar.gz -O - | \ aheinecke@346: tar -xz commons-codec-1.7.jar -O > commons-codec.jar aheinecke@346: aheinecke@346: Install Mapserver from Source aheinecke@346: ----------------------------- aheinecke@346: This documentation is a log of the steps neccessary to aheinecke@346: build mapserver 6.2.0-rc1 on CentOS 5. aheinecke@346: You might just want to install a binary package for your distribution aheinecke@346: For a real documentation please refer to: http://mapserver.org/installation/unix.html aheinecke@346: aheinecke@346: # Everything is installed into ~/dev aheinecke@346: # As root: aheinecke@346: yum groupinstall "Development Tools" aheinecke@346: yum install freetype-devel libpng-devel zlib-devel curl-devel libtiff-devel libjpeg-devel fontconfig-devel \ aheinecke@346: libXpm-devel libxml2-devel expat-devel sqlite-devel agg-devel giflib-devel libxslt-devel libexslt-devel httpd-devel aheinecke@346: aheinecke@346: # As user: aheinecke@346: # set up some convienance aheinecke@346: export DEVELDIR=~/devel aheinecke@346: export SRCDIR=$DEVELDIR/src aheinecke@346: alias configure="./configure --prefix=$DEVELDIR" aheinecke@346: function cs { aheinecke@346: mkdir -p "$SRCDIR" aheinecke@346: if test -n "$1"; then aheinecke@346: cd "$SRCDIR/$1" aheinecke@346: else aheinecke@346: cd "$SRCDIR" aheinecke@346: fi aheinecke@346: } aheinecke@346: aheinecke@346: cs aheinecke@346: wget http://download.osgeo.org/proj/proj-4.8.0.tar.gz aheinecke@346: tar -xf proj-4.8.0.tar.gz aheinecke@346: cs proj-4.8.0 aheinecke@346: configure && make && make install aheinecke@346: aheinecke@346: cs aheinecke@346: wget https://bitbucket.org/pierrejoye/gd-libgd/get/GD_2_0_33.tar.bz2 aheinecke@346: tar -xf GD_2_0_33.tar.bz2 aheinecke@346: cs pierrejoye-gd-libgd-5551f61978e3/src aheinecke@346: configure && make && make install aheinecke@346: aheinecke@346: cs aheinecke@346: wget http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.0.tar.gz aheinecke@346: tar -xf libgeotiff-1.4.0.tar.gz aheinecke@346: cd libgeotiff-1.4.0 aheinecke@346: configure --with-proj=$DEVELDIR && make && make install aheinecke@346: aheinecke@346: cs aheinecke@346: wget http://downloads.esri.com/Support/downloads/ao_/FileGDB_API_1_2-32.tar.gz aheinecke@346: tar -xf FileGDB_API_1_2-32.tar.gz aheinecke@346: cs -ri FileGDB_API/include FileGDB_API/lib $DEVELDIR aheinecke@346: export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0 aheinecke@346: . ~/arcgis/engine10.0/init_engine.sh aheinecke@346: . ~/arcgis/engine10.0/java/tools/init_java.sh aheinecke@346: . ~/arcgis/developerkit10.0/java/tools/setenv_ant.sh aheinecke@346: . ~/arcgis/developerkit10.0/init_devkit.sh aheinecke@346: aheinecke@346: cs aheinecke@346: wget http://download.osgeo.org/gdal/gdal-1.9.2.tar.gz aheinecke@346: tar -xf gdal-1.9.2.tar.gz aheinecke@346: cs gdal-1.9.2 aheinecke@346: configure --enable-shared=no --enable-static=yes --with-fgdb=$DEVELDIR && make && make install aheinecke@346: aheinecke@346: cs aheinecke@346: wget http://download.osgeo.org/mapserver/mapserver-6.2.0-rc1.tar.gz aheinecke@346: tar -xf mapserver-6.2.0-rc1.tar.gz aheinecke@346: cs mapserver-6.2.0-rc1 aheinecke@346: configure -with-proj=$DEVELDIR --with-gd=$DEVELDIR \ aheinecke@346: --with-ogr=$DEVELDIR/bin/gdal-config \ aheinecke@346: --with-gdal=$DEVELDIR/bin/gdal-config \ aheinecke@346: --with-wfs --with-wcs --with-wmsclient --with-wfsclient --with-sos \ aheinecke@346: --with-xml2-config=/usr/bin/xml2-config --with-apache-module \ aheinecke@346: --with-apxs=/usr/sbin/apxs --with-exslt=yes --with-xslt=yes aheinecke@346: # in this specific version you also need to apply https://github.com/unicolet/mapserver/commit/8ac6841c4c4857acddd87bdb4dfafb729aea91c3 aheinecke@346: # when building on x86 systems aheinecke@346: make && make install aheinecke@346: cd mapscript/java aheinecke@346: make && make install aheinecke@346: cp mapscript.jar ~/mxd2map/lib aheinecke@346: aheinecke@346: Build MXD2map aheinecke@346: ------------- aheinecke@346: aheinecke@346: cd ~/mxd2map aheinecke@346: ant jar-norevision aheinecke@346: aheinecke@346: Run MXD2map aheinecke@346: ----------- aheinecke@346: ArcGIS needs some weird environment settings. Additionally it provides it's own versions aheinecke@346: of basic libraries like libstdc++. Here is what you have to do (or at least what worked for me): aheinecke@346: aheinecke@346: export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0 aheinecke@346: . ~/arcgis/engine10.0/init_engine.sh aheinecke@346: . ~/arcgis/engine10.0/java/tools/init_java.sh aheinecke@346: . ~/arcgis/developerkit10.0/java/tools/setenv_ant.sh aheinecke@346: . ~/arcgis/developerkit10.0/init_devkit.sh aheinecke@346: export LD_LIBRARY_PATH=$DEVELDIR/lib:$LD_LIBRARY_PATH aheinecke@346: export LD_PRELOAD=$LD_PRELOAD:/usr/lib/libstdc++.so.6 aheinecke@346: export AWT_TOOLKIT=XToolkit aheinecke@346: aheinecke@346: # Set the locale to some utf-8 value like aheinecke@346: export LC_ALL=en_US.UTF-8 aheinecke@346: aheinecke@346: # Run it with: aheinecke@346: LD_PRELOAD=$LD_PRELOAD:/usr/lib/libstdc++.so.6 java -Xss2m -jar mxd2map.jar aheinecke@346: aheinecke@346: # Now edit the converter.properties sample so that it points to a valid mxd file aheinecke@346: # together with a valid mapfile template. aheinecke@346: aheinecke@346: # If your files contain special characters in windows encoding aheinecke@346: # convert them with convmv: aheinecke@346: convmv --notest -r -fcp1252 -t utf8 Bereisungen/ aheinecke@346: aheinecke@346: Setup Mapserver with Apache aheinecke@346: --------------------------- aheinecke@346: vim /etc/httpd/conf/httpd.con aheinecke@346: # Change setting Directory "/var/www/cgi-bin" aheinecke@346: aheinecke@346: aheinecke@346: AllowOverride None aheinecke@346: Options ExecCGI aheinecke@346: Order allow,deny aheinecke@346: Allow from all aheinecke@346: aheinecke@346: aheinecke@346: /etc/sysconfig/httpd aheinecke@346: aheinecke@346: # Notes: aheinecke@346: # Generate parameters to include all layers aheinecke@346: export MAPNAME=ausbaustrecken_west && grep wms_title ${MAPNAME}.map | grep -v \"Layer\" | awk '{printf "&layers=" $2}' | sed s/\"//g | xargs -Ifoo echo "http://giid.polyhedra.intevation.de/cgi-bin/$MAPNAME.cgi?mode=browse&template=openlayers&foo" aheinecke@346: aheinecke@346: # Modify the fonts.txt with fonts according to your installation. aheinecke@346: sed -i 's/C:\/Windows\/Fonts/\/home\/aheinecke\/arcgis\/engine10.0\/fonts/' ttf-fonts/fonts.txt