[mapguide-users] Newbie problem with Webserverextensions configuration

azpublic azpublic at bluewin.ch
Tue May 29 02:51:56 EDT 2007


Hi all ! 

 

I’ve been experimenting a little on my custom installation (pre-installed
version of Tomcat)  on Windows 2000 and here are my conclusions. I hope they
will help someone, someday
. It has been a real pain in the ***  :-). 

 

I did not yet managed to deploy MGOS on a preinstalled Apache http server
but I managed to have the one that is distributed with the installer to work
with my own Tomcat Install.

 

Here’s what you should do

 

 

First I did a full installation of the executable package for Windows but I
didn’t choose the bundled/preconfigured installation. I chose the last
option available which installs EVERYTHING

 

 

 

Next I edited my http.conf as follow : 

 

#---------------------------------------------------------------------------
-----------

 

FastCgiConfig -idle-timeout 120 -minProcesses 1 -maxClassProcesses 4
-multiThreshold 100 -singleThreshold 100 -killInterval 600

FastCgiServer "E:/MAPGUIDE/WEB/php/php-cgi.exe" -processes 4 -idle-timeout
120 -initial-env PHP_FCGI_MAX_REQUESTS=500 -initial-env PHP_FCGI_CHILDREN=1

 

#Start PHP FastCGI config

ScriptAlias /php/ "E:/MAPGUIDE/WEB/php/"

<Directory "E:/MAPGUIDE/WEB/php">

    Options ExecCGI

    AddHandler fastcgi-script exe

</Directory>

Action application/x-httpd-php5 "/php/php-cgi.exe"

AddType application/x-httpd-php5 .php

#End PHP FastCGI Config

 

#Start PHP Config

#ScriptAlias /php/ "E:/MAPGUIDE/WEB/php/"

#Action application/x-httpd-php "/php/php-cgi.exe"

#AddType application/x-httpd-php .php

#End PHP Config

 

 

# MapViewer to MapViewerPhp aliases. Comment out Alias and AliasMatch for
Java API.

ScriptAlias /mapguide/mapagent/mapagent.fcgi
"E:/MAPGUIDE/WEB/www/mapagent/mapagent.exe"

AliasMatch ^/mapguide/mapviewerajax/([^\?])(.*)$
"E:/MAPGUIDE/WEB/www/mapviewerphp/$1$2"

Alias /mapguide/mapviewerajax
"E:/MAPGUIDE/WEB/www/mapviewerphp/ajaxviewer.php"

AliasMatch ^/mapguide/mapviewerdwf/([^\?])(.*)$
"E:/MAPGUIDE/WEB/www/mapviewerphp/$1$2"

Alias /mapguide/mapviewerdwf
"E:/MAPGUIDE/WEB/www/mapviewerphp/dwfviewer.php"

 

# MapViewer to MapViewerJava Redirect. Uncomment Redirect for Java API.

Redirect /mapguide/mapviewerajax/
http://localhost:8008/mapguide/mapviewerjava/ajaxviewer.jsp

Redirect /mapguide/mapviewerdwf/
http://localhost:8008/mapguide/mapviewerjava/dwfviewer.jsp

 

Alias /mapguide "E:/MAPGUIDE/WEB/www/"

<Directory "E:/MAPGUIDE/WEB/www/">

  AllowOverride All

  Options All

  Order allow,deny

  Allow from all

 

# Restrict access via HTTP to webconfig.ini

<Files webconfig.ini>

  Order allow,deny

  Deny from all

</Files>

 

# FastCGI MapAgent config  

  AddHandler fastcgi-script exe

 

# Regular CGI MapAgent

#  AddHandler cgi-script exe

 

  RewriteEngine on

  RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]

</Directory>

 

 

# Load mod_jk module

# Update this path to match your modules location

LoadModule    jk_module  modules/mod_jk.so

# Declare the module for <IfModule directive> (remove this line on Apache
2.x)

# AddModule     mod_jk.c

# Where to find workers.properties

# Update this path to match your conf directory location (put
workers.properties next to httpd.conf)

JkWorkersFile "E:/MAPGUIDE/WEB/Apache2/conf/workers.properties"

# Where to put jk logs

# Update this path to match your logs directory location (put mod_jk.log
next to access_log)

JkLogFile     "E:/MAPGUIDE/WEB/Apache2/logs/mod_jk.log"

# Set the jk log level [debug/error/info]

JkLogLevel    info

# Select the log format

JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# JkOptions indicate to send SSL KEY SIZE, 

JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat set the request format 

JkRequestLogFormat     "%w %V %T"

# Send everything for context /examples to worker named worker1 (ajp13)

 

 

JkMount  /mapguide/mapviewerjava/* worker1

 

JkMount /mapguide/javaviewersample/* worker1

 

 

#---------------------------------------------------------------------------
-----------

 

 

 

As you will note I changed the install directory to a custom dir so be
careful to point to correct paths everywhere in the httpd.conf file

 

 

I also edited php.ini file and chaged  the extensions path (extension_dir =
"E:\MAPGUIDE\WEB\php\ext")  in there so that it would point to the correct
location.

 

Next I registered the bundled Apache Http as a service with the following
command in the console

 

"E:\MAPGUIDE\WEB\Apache2\bin\apache" -k install -n "Apache2"

 

Now if you’re correct you should already be able to test php and apache by
going to the following page : HYPERLINK
"http://localhost:8008/mapguide/mapadmin/login.php"http://localhost:8008/map
guide/mapadmin/login.php

 

If you manage to login, you’re on good tracks ^^

 

Install the GDAL patch MapGuide1.1.0_GDAL_Patch.zip

 

 

 

Here comes the tricky part :  THE Tomcat configuration 

 

 

Just do a simple test to see that jk_mod forwards correctly to tomcat : 

Add the following at the end of httpd.conf of Apache :

 

JkMount  /tomcat-docs/* worker1

 

Start tomcat and Apache 

 

Test the following url HYPERLINK
"http://localhost:8008/tomcat-docs/"http://localhost:8008/tomcat-docs/

 

You should see a tomcat page  ---> Jk_mod is working properly 

 

 

 

Create the mapguide.xml configuration file in
<tomcat-home>/conf/catalina/localhost as suggested in the documentation and
make it point to your www directory

 

Next go to the original  mapguide tomcat BIN dir ( in my example
E:\MAPGUIDE\WEB\Tomcat\bin )

 

 

Copy all the files that are in there inside the BIN directory of the Tomcat
install you want to run mapguide (I have chosen E:\TOMCAT\bin) 

NOTE THAT THIS WAS FOR MY TOMCAT 5.5 Install so BE CAREFUL with other
versions of Tomcat. 

 

Now start mapguide, tomcat and then apache 

 

Test HYPERLINK
"http://localhost:8008/mapguide/mapviewerjava/ajaxviewer.jsp?WEBLAYOUT=Libra
ry://ATest.WebLayout"http://localhost:8008/mapguide/mapviewerjava/ajaxviewer
.jsp?WEBLAYOUT=Library://ATest.WebLayout

 

You should get the following message :

 

Resource was not found: Library://ATest.WebLayout

 

 

This means that you succeded  :-) 

 

 

 

What took me so much time was to notice that there were some extra file in
that tomcat BIN directory !! 

 

 

Also, I didn’t manage to have my own Apache HTTP install. 

I’m having some FastCGI problems.  I tried with Apache 2.2 but fastCGI has
to be patched to work properly and I didn’t manage to get it working
properly. 

 

I also tried on Apache 2.0. I almost managed to get it working but also had
some Fast CGI problems mainly communication problems with timeouts. 

 

So if anyone has a clue on how to get MGOS to work with a custom Apache 2.0
or 2.2 install just let me know. 

 

I’ll probably write a guide for this kind of installations because it can
most certainly be useful in production environments. 

 

 

I hope this helps .

 

 

CHEERS ^^ 

 

Alex

 

 

 

 

 

   _____  

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Andy Morsell
Sent: lundi, 14. mai 2007 17:49
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] Newbie problem
withWebserverextensionsconfiguration

 

It sounds like you are using a pre-installed version of Apache and Tomcat.
The easiest way to configure this is to do a full, bundled
MGOS/Apache/Tomcat install and then copy the configuration from httpd.conf
to yours.  Here is mine and I hope it helps (change your paths as
appropriate).  If I remember correctly, there was a bug in the original ajax
redirect statement.

 

#-----------------Start MapGuide Enterprise Java web extensions config

 

# MapViewer to MapViewerPhp aliases
ScriptAlias /mapguide/mapagent/mapagent.fcgi "C:/Program
Files/Autodesk/MapGuideEnterprise2007/WebServerExtensions/www/mapagent/MapAg
ent.exe"
AliasMatch ^/mapguide/mapviewerajax/([^\?])(.*)$ "C:/Program
Files/Autodesk/MapGuideEnterprise2007/WebServerExtensions/www/mapviewerphp/$
1$2"
Alias /mapguide/mapviewerajax "C:/Program
Files/Autodesk/MapGuideEnterprise2007/WebServerExtensions/www/mapviewerphp/a
jaxviewer.jsp"
AliasMatch ^/mapguide/mapviewerdwf/([^\?])(.*)$ "C:/Program
Files/Autodesk/MapGuideEnterprise2007/WebServerExtensions/www/mapviewerphp/$
1$2"
Alias /mapguide/mapviewerdwf "C:/Program
Files/Autodesk/MapGuideEnterprise2007/WebServerExtensions/www/mapviewerphp/d
wfviewer.jsp"

 

Alias /mapguide "C:/Program
Files/Autodesk/MapGuideEnterprise2007/WebServerExtensions/www/"
<Directory "C:/Program
Files/Autodesk/MapGuideEnterprise2007/WebServerExtensions/www/">
 AllowOverride All
 Options All
 Order allow,deny
 Allow from all
 AddHandler cgi-script .exe
 RewriteEngine on
 RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
</Directory>

 

Alias /PhpViewerSample "C:/Program
Files/Autodesk/MapGuideEnterprise2007/WebServerExtensions/www/PhpViewerSampl
e/"

 

#-----------------End MapGuide Enterprise Java web extensions config

 

#-----------------Start Tomcat connector support

 

LoadModule jk_module modules/mod_jk.so
JkWorkersFile "C:/Program Files/Apache
Group/Apache2/conf/workers.properties"
# Where to put jk logs
JkLogFile "C:/Program Files/Apache Group/Apache2/logs/mod_jk.log"
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Send everything for context /examples to worker named
# worker1 (ajp13)
JkMount /mapguide/mapviewerjava/* worker1
Redirect /mapguide/mapviewerajax/ HYPERLINK
"http://127.0.0.1/mapguide/mapviewerjava/ajaxviewer.jsp"http://127.0.0.1/map
guide/mapviewerjava/ajaxviewer.jsp
Redirect /mapguide/mapviewerdwf/ HYPERLINK
"http://127.0.0.1/mapguide/mapviewerjava/dwfviewer.jsp"http://127.0.0.1/mapg
uide/mapviewerjava/dwfviewer.jsp

 


#-----------------End Tomcat connector support

 

#-----------------Start MapGuide Java sample support

 

JkMount /mapguide/javaviewersample/* worker1

 

#-----------------End MapGuide Java sample support

 

Andy Morsell, P.E. 
Spatial Integrators, Inc. 
HYPERLINK "http://www.SpatialGIS.com"http://www.SpatialGIS.com 

   _____  

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of azpublic
Sent: Sunday, May 13, 2007 12:47 PM
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] Newbie problem with
Webserverextensionsconfiguration

Ok I’ve been installing a reinstalling MapGuide these past two days but I
still cant have any chance in getting the Apache to render the JSP’s
correctly 
 

 

I’ve been trying to copy MapGuideApi.jar in CATALINA_HOME\common\lib, in
CATALINA_HOME\server\lib, in CATALINA_HOME\shared\lib,. Nothing to do
 

 

I’ve also tried to copy  the library in JAVA_HOME\\lib\ext\ 
 no result 
 

I tried adding "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WEB-INF\lib"; to my
classpath .. no result 
 

 

I always get this stupid error from tomcat when requesting 

HYPERLINK
"http://localhost:8008/mapguide/mapviewerjava/ajaxviewer.jsp?WEBLAYOUT=Libra
ry://ATest.WebLayout"http://localhost:8008/mapguide/mapviewerjava/ajaxviewer
.jsp?WEBLAYOUT=Library://ATest.WebLayout

as suggested in the InstallConfigureMgOpenSourceOnWindows.pdf documentation.


 


Here is the complete error returned by my Tomcat 5.5.17  the first time I
hit the url above : 


exception 

org.apache.jasper.JasperException: no MapGuideJavaApi in java.library.path
 
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra
pper.java:510)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
75)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

cause mère 

javax.servlet.ServletException: no MapGuideJavaApi in java.library.path
 
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
mpl.java:858)
 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:791)
 
org.apache.jsp.mapviewerjava.ajaxviewer_jsp._jspService(ajaxviewer_jsp.java:
885)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
32)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

cause mère 

java.lang.UnsatisfiedLinkError: no MapGuideJavaApi in java.library.path
        java.lang.ClassLoader.loadLibrary(Unknown Source)
        java.lang.Runtime.loadLibrary0(Unknown Source)
        java.lang.System.loadLibrary(Unknown Source)
 
org.osgeo.mapguide.MapGuideJavaApiJNI.<clinit>(MapGuideJavaApiJNI.java:2095)
 
org.osgeo.mapguide.MapGuideJavaApi.MgInitializeWebTier(MapGuideJavaApi.java:
14)
 
org.apache.jsp.mapviewerjava.ajaxviewer_jsp.InitializeWebTier(ajaxviewer_jsp
.java:36)
 
org.apache.jsp.mapviewerjava.ajaxviewer_jsp.GenerateMainPage(ajaxviewer_jsp.
java:173)
 
org.apache.jsp.mapviewerjava.ajaxviewer_jsp._jspService(ajaxviewer_jsp.java:
876)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
32)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note La trace complète de la cause mère de cette erreur est disponible dans
les fichiers journaux de Apache Tomcat/5.5.17.


 


And Here is the error returned by tomcat if I try to refresh the page :


exception 

org.apache.jasper.JasperException
 
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra
pper.java:510)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
75)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

cause mère 

javax.servlet.ServletException
 
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
mpl.java:858)
 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:791)
 
org.apache.jsp.mapviewerjava.ajaxviewer_jsp._jspService(ajaxviewer_jsp.java:
885)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
32)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

cause mère 

java.lang.NoClassDefFoundError
 
org.osgeo.mapguide.MapGuideJavaApi.MgInitializeWebTier(MapGuideJavaApi.java:
14)
 
org.apache.jsp.mapviewerjava.ajaxviewer_jsp.InitializeWebTier(ajaxviewer_jsp
.java:36)
 
org.apache.jsp.mapviewerjava.ajaxviewer_jsp.GenerateMainPage(ajaxviewer_jsp.
java:173)
 
org.apache.jsp.mapviewerjava.ajaxviewer_jsp._jspService(ajaxviewer_jsp.java:
876)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
32)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note La trace complète de la cause mère de cette erreur est disponible dans
les fichiers journaux de Apache Tomcat/5.5.17.


 


If someone reads this message please help !  you’re my only hope :-) 


 


 


 


 


 


 


 


 

 

   _____  

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of azpublic
Sent: samedi, 12. mai 2007 10:20
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] Newbie problem with Web
serverextensionsconfiguration

 

Ok  I managed to get something after struggling with httpd.conf. I am now
pretty sure that I managed to communicate with my Tomcat install however I
still have some error  :

 

I encountered a http 500 error when trying to access
http://localhost:8008/mapguide/mapviewerjava/ajaxviewer.jsp?WEBLAYOUT=Librar
y://ATest.WebLayout :

 

org.apache.jasper.JasperException: no MapGuideJavaApi in java.library.path
 
It seems that Tomcat is not able to find the three jars located in
www/WEB-INF/lib/ of the MapGuide Installation ? 
Any idea how I can fix this ? 
 
Thanks in advance :-) 
 
Cheers

 

 

 

 

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.6.8/797 - Release Date: 10.05.2007
17:10

 

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.6.8/797 - Release Date: 10.05.2007
17:10

 

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.6.8/800 - Release Date: 11.05.2007
19:34

 

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.6.8/800 - Release Date: 11.05.2007
19:34

 

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.7.0/801 - Release Date: 12.05.2007
18:40


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.7.0/803 - Release Date: 13.05.2007
12:17



No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.472 / Virus Database: 269.8.1/822 - Release Date: 28.05.2007
11:40
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20070529/c98e9a57/attachment.html


More information about the mapguide-users mailing list