Saturday 11 June 2011

Introducing the MapGuide Instant Setup utility

As someone who is getting more invovled with core mapguide development, having to build and run the installer (which may not even work properly and may pollute my registry with junk settings) just to be able to test my freshly built trunk working copy is a time-consuming process.

What would be really nice is to have some kind of tool/utility that allows me to instantly configure the freshly built source (that is prepared before building the installer) and have a functional server/webtier setup, completely bypassing the installer step.

Enter the Instant Setup utility


This utility requires building the source and preparing it. For a recap, this is:
  1. MgDev\build.bat -a=build -w=all
  2. MgDev\build.bat -a=install -w=all -o=C:\Staging\
  3. Installer\build.bat -a=prepare -source=C:\Staging\
These 3 steps will set up the built binaries (and Apache/Tomcat/PHP with templated config files) under C:\Staging\. This is where the Instant Setup utility comes in.

For the Source Directory enter C:\Staging\ (or whatever directory you chose instead)

For the Batch File Output Directory enter the directory where this utility will generate batch files to start the server and web tier in interactive mode.

The MapGuide Service Name is the service name that will be used when the configured MapGuide Server is installed as a service (not used at the moment).

Then comes the detailed bits:
  • The port numbers where the the configured server will use
  • The virtual directory the configured web tier will exist under
  • The port number where the configured apache will use
  • The service name to use if apache is installed as a service (not used at the moment)
  • The default viewer to use for the mapviewerajax virtual directory
  • Whether to enable Java, and what port to use for Tomcat if this is the case.
Once you have specified all this information, hitting the Configure button will do the following.
  1. Write your specified values into the templated Apache/Tomcat/PHP configuration files
  2. Write 2 batch files (mgserver.bat and mgwebtier.bat) to start the MapGuide Server and Apache both in interactive mode.
Once configured, your C:\Staging\ directory is now a functional MapGuide Server/Web Tier installation, albeit only in interactive mode at the moment.

Some may have noticed that I haven't mentioned IIS. That's because this support is not implemented yet. Eventually support for that will be added. For now, this will give you a functional Apache/PHP/Tomcat/Java configuration.

The source for the instant setup utility can be found here. I hope this tool simplifies your MapGuide hacking experience, as it did for me.

2 comments:

UV said...

Very helpful post!
Thanks mate!

This post helped me a lot to finally understand the MGOS installation process.

Its good to have a tool that sets all relevant config files in one go.
The real win for me, however, was the good explanation of the install scripts and how to use them right!

Unknown said...

Hi Jackie.
Thanks for your usefull post. I am new in this tool (mapguide) and trying to set up the server I got stuck in the part where you say "This utility requires building the source and preparing it.". That link takes me to an 4 years old blog which shows me to do a manual process that supposes has been replaced by the Instant Setup Utility.
At the end I got lost in the part of set up the built binaries.
I would appreciate if you can clarify that part for me.
Thanks a lot.
Ric