Building MapGuide on Ubuntu 8.04

From OSGeo
Revision as of 15:50, 4 September 2008 by Wiki-Mwtoews (talk | contribs) (→‎BUILD MAPGUIDE: missing tee/Heron)
Jump to navigation Jump to search

Below are instructions that will aid a user with installing FDO 3.3.1 and MapGuide Open Source 2.0.1 from SVN on Ubuntu 8.04 (Hardy Heron). It is based on previous instructions, lots of credit to their authors!

NOTES

The default directory used in these instructions is called /home/administrator. This assumes that you create your primary user account with the name "administrator". If you do not, mentally adjust where necessary.

You may want to consider using a client like PuTTY to access your server's terminal via openssh-server from a different computer. This really helps with copying and pasting. If so, either ensure that you install the OpenSSH server during your basic install, or add "openssh-server" to the list of packages below.

Any time that you run a task and pipe its output to a logfile, make sure that you look at the end of the logfile when you're done to make sure that it completed successfully. If it didn't then you have the logfile to post an error report from... Here's an example of how to do this:

tail -n 30 mylogfile.log

Compiled successfully on 32 bit machine. When compiled on my 64 bit machine, got error 'CPU you selected does not support x86-64 instruction set'

BASIC SETUP

Install a basic Ubuntu 8.04 (Hardy Heron). Once this is complete, you will have to add some extra packages to compile MapGuide. Make sure that you get all of these packages; the line is really long:

sudo apt-get install build-essential bison flex automake1.7 automake1.9 libtool doxygen subversion libjpeg62-dev libpng12-dev libfreetype6-dev libexpat1-dev libxalan110-dev libxslt1-dev expat libcurl4-openssl-dev libasound2-Dev python2.5-dev sun-java6-jdk gcc-4.1 g++-4.1

If Java fails to install, you may need to edit /etc/apt/sources.list to uncomment the multiverse repository lines and then try installing it again.

To avoid "bad fd number" errors, type the following in the terminal:

sudo dpkg-reconfigure dash

and choose No at the prompt. Be aware that this changes your default /bin/sh from dash back to bash.

Set the SUN Java to be the default Java installation:

sudo update-java-alternatives -s java-1.6.0-sun

Edit /etc/jvm, moving "/usr/lib/jvm/java-1.6.0-sun" to the top of the list

sudo nano /etc/jvm

Edit /etc/environment so that services will know where to look for Java

sudo nano /etc/environment

(Add the following line)

JAVA_HOME="/usr/lib/jvm/java-1.6.0-sun"

Note: I have problem compile with gcc-4.2 and g++-4.2. What I do is replace link /usr/bin/gcc and /usr/bin/g++ to version 4.1.

Log off and then log back on so that these settings take effect. Alternatively, export JAVA_HOME in your current session.

FDO INSTALL

In terminal type the following:

(be prepared to wait a long time for this command to complete, the test data takes a while to download)

svn checkout http://svn.osgeo.org/fdo/tags/3.3.1/ fdo-3.3.1

(type in your password after the following command if prompted. Note that this fdo-3.3.0, not fdo-3.3.1)

sudo mkdir /usr/local/fdo-3.3.0

(if you are not logged in as administrator, you change the userid below!)

sudo chown administrator /usr/local/fdo-3.3.0

(when compile, I got error "occi.h: No such file or directory". This is for provider KingOracle. Since I don't need it anyway, I just remove folder /home/administrator/fdo-3.3.1/Providers/KingOracle)

cd fdo-3.3.1
source ./setenvironment.sh

In terminal, type the following to run the builds. Note, there will be no output from either command until completion as it is all being spooled to nohup.out. You can log into another terminal session and tail this file if you start getting antsy :-)

nohup ./build_thirdparty.sh 2>&1 | tee build_thirdparty.log
nohup ./build_linux.sh 2>&1 | tee build_linux.log

APACHE / PHP INSTALL

In Terminal type the following:

cd ~

(you should now be in /home/administrator, or whatever your $HOME is)

svn checkout http://svn.osgeo.org/mapguide/tags/MAPGUIDE2.0.1/ mapguide-2.0.1
sudo mkdir /usr/local/mapguideopensource

(replace administrator with your userid if necessary)

sudo chown administrator /usr/local/mapguideopensource
cd mapguide-2.0.1/Oem/LinuxApt

(careful when copying and pasting this line, the - got changed into . for me)

find . -name "*.gz" -exec tar xzf {} \;
nohup ./build_apt.sh 2>&1 | tee ../../build_apt.log

BUILD OEM

Perform the following:

cd ~/mapguide-2.0.1/
nohup ./build_oem.sh 2>&1 | tee build_oem.log

BUILD MAPGUIDE

Go for the Heron:

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

(If you get error "missing liblib_json.so", then apply patch from http://trac.osgeo.org/mapguide/ticket/347)

nohup make 2>&1 | tee make_mapguide.log
nohup make install 2>&1 | tee install_mapguide.log

If you want to use webstudio, copy the files to the webserverextension folder:

cp -fpR /home/administrator/mapguide-2.0.1/Web/src/webstudio /usr/local/mapguideopensource/webserverextensions/www/webstudio

STARTUP OPTIONS

While you're testing, it can be convenient to run services interactively, but eventually you'll want them to shut down / restart when you the computer is rebooted. This section gives you both options.

START SERVICES MANUALLY

Start Apache

sudo /usr/local/mapguideopensource/webserverextensions/apache2/bin/apachectl restart

Stop Apache

sudo /usr/local/mapguideopensource/webserverextensions/apache2/bin/apachectl stop

Start MapGuide

sudo /usr/local/mapguideopensource/server/bin/mgserverd.sh

Stop MapGuide

sudo pkill -f -u root "mgserver daemon"