MapGuide 2.0 quick start

Phân loại:

Version 2.0 Quick Start for Linux

This document is intended to give step-by-step build and install instructions for a default PHP installation of MapGuide Open Source on Linux. For more detailed instructions, other configurations, or resolutions to build problems please see

* BuildConfigureMgOpenSourceOnLinux for MapGuide Open Source, Apache, Php and Tomcat
* OpenSourceBuild__README.txt (found in the fdo-3.3.x.tar.gz file) for FDO.

All of the operations below are done in the root account.
Prerequisite Software
GNU Compiler Collection

For RedHat Enterprise Linux 4 you need GCC 3.4.6 and for Fedora Core 6 you need GCC 4.1.1. To check what version you have type gcc --version at the command line. You can get GCC at http://gcc.gnu.org.
Libjpeg

Libjpeg will need to be installed if it is not already. To see if it is installed, check to see if the /usr/include or /usr/local/include directories contain jconfig.h, jerror.h, jmorecfg.h and jpeglib.h. To install libjpeg, download jpegsrc.v6b.tar.gz from http://www.ijg.org/files/. Then in a shell window execute the following commands in the directory where you downloaded the file:

* tar zxf jpegsrc.v6b.tar.gz
* cd jpeg-6b
* ./configure --enable-shared
* make
* make install

If libjpeg is not installed properly, you will get a build error in the DWF Toolkit during the ./build_oem.sh step below.
Libpng

Libpng will need to be installed if it is not already. To see if it is installed, check to see if the /usr/include or /usr/local/include directories contain pngconf.h and png.h. To install libpng, download libpng-1.2.23.tar.gz (or later version) from http://www.libpng.org/pub/png/libpng.html . Then in a shell window execute the following commands in the directory where you downloaded the file:
· tar zxf libpng-1.2.23.tar.gz
· cd libpng-1.2.23
· ./configure
· make
· make install
If libpng is not installed properly, you will get a build error in the DWF Toolkit during the ./build_oem.sh step below.
Java

MapGuide requires the J2SE Development Kit. Download and install the J2SE Development Kit from http://java.sun.com/javase/downloads/index.jsp.
Build and Install Apache and Php

Download mapguideaptinstaller-2.0.x.tar.gz from http://mapguide.osgeo.org/downloads.html.

In a shell window execute the following commands in the directory where you downloaded the mapguideaptinstaller-1.2.0.tar.gz file:

* tar zxf mapguideaptinstaller-2.0.x.tar.gz
* cd LinuxApt
* ./build_apt.sh

NOTE: If you want to have MySQL support in PHP, you will need to add the --with-mysql=/usr/local/mysql (or wherever your MySQL dev tools are installed) flag to the ./configure step in the Php build procedure section of build_apt.sh
Build and Install FDO

Note that if you are running RHEL4 you can download and install the precompiled binaries available from http://fdo.osgeo.org/content/downloads.

Download the following files from http://fdo.osgeo.org/content/downloads:

* fdo-3.3.x.tar.gz
* fdogdal-3.3.x.tar.gz
* fdosdf-3.3.x.tar.gz
* fdoshp-3.3.x.tar.gz
* fdowfs-3.3.x.tar.gz
* fdowms-3.3.x.tar.gz

If you have an ArcSDE client, you can also download:

* fdoarcsde-3.3.x.tar.gz

If you need MySQL and ODBC, you will need to also download:

* fdordbms-3.3.x.tar.gz

Install required software for MySQL and ODBC

If you are going to build the MySQL and ODBC providers (fdordbms-3.3.x.tar.gz) then see OpenSourceBuild__README.txt found in the OpenSource_FDO directory for additional required components.
Unpack tar files

* find . -maxdepth 1 -name "fdo*.tar.gz" -exec tar zxf {} ";"
* cd OpenSource_FDO

The below should be replaced with the path up to and including the OpenSource_FDO directory that is created by the above command. For example, it would be /root/OpenSource_FDO if the above command was executed in root's home directory.
Build and install

Define variables needed for the build:

* export FDO=/Fdo
* export FDOUTILITIES=/Utilities
* export FDOTHIRDPARTY=/Thirdparty

If you have an ArcSDE client:

* export SDEHOME=

Build and install the third party components, FDO and the providers:

* ./build_thirdpary.sh
* ./build_linux.sh

Note: If you have not installed the ArcSDE, MySQL or ODBC providers, they should be removed from the providers.xml file found in /usr/local/fdo3.2.0/lib.
Build MapGuide Open Source
Unpack tar file

In a shell window execute the following commands in the directory where you downloaded the mapguide-1.2.0.tar.gz file:

* tar zxf mapguide-2.0.x.tar.gz
* cd mapguide-2.0.x

Set up Java

* export JAVA_HOME=

Build OEM

* ./build_oem.sh

Build and install

* aclocal
* libtoolize --force
* automake --add-missing --copy
* autoconf
* ./configure --enable-optimized
* make
* make install

Run MapGuide Open Source

In a shell window execute the following commands to run MapGuide Open Source:

* cd /usr/local/mapguideopensource/webtierextensions/apache2/bin
* ./httpd
* cd /usr/local/mapguideopensource/server/bin
* ./mgserver.sh