[mapguide-commits] r9298 - in sandbox/jng/cmake_v2: . Oem/LinuxApt Web/src/ApacheAgent Web/src/PhpApi cmake/configs
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Jan 9 03:44:55 PST 2018
Author: jng
Date: 2018-01-09 03:44:55 -0800 (Tue, 09 Jan 2018)
New Revision: 9298
Added:
sandbox/jng/cmake_v2/cmake/configs/mapguide.conf.in
sandbox/jng/cmake_v2/cmake/configs/mapguide.xml.in
sandbox/jng/cmake_v2/cmake/configs/tomcat.conf.in
sandbox/jng/cmake_v2/cmake/configs/workers.properties.in
Modified:
sandbox/jng/cmake_v2/Oem/LinuxApt/CMakeLists.txt
sandbox/jng/cmake_v2/Web/src/ApacheAgent/CMakeLists.txt
sandbox/jng/cmake_v2/Web/src/PhpApi/CMakeLists.txt
sandbox/jng/cmake_v2/cmake_bootstrap.sh
Log:
Fix tomcat connector build. Add missing configuration files. Rework httpd configuration to always load every config file under /apache2/conf/mapguide and modify install steps to put all our custom httpd configuration files in there. Also ensure that constants.php is properly installed for mapadmin and mapviewerphp
Modified: sandbox/jng/cmake_v2/Oem/LinuxApt/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Oem/LinuxApt/CMakeLists.txt 2018-01-09 10:01:47 UTC (rev 9297)
+++ sandbox/jng/cmake_v2/Oem/LinuxApt/CMakeLists.txt 2018-01-09 11:44:55 UTC (rev 9298)
@@ -1,2 +1,13 @@
configure_file(${CMAKE_MODULE_PATH}/../configs/php.ini.in ${CMAKE_CURRENT_BINARY_DIR}/php.ini)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/php.ini DESTINATION ${MG_INSTALL_WEB_PREFIX}/php/lib COMPONENT ${MG_COMPONENT})
\ No newline at end of file
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/php.ini DESTINATION ${MG_INSTALL_WEB_PREFIX}/php/lib COMPONENT ${MG_COMPONENT})
+
+configure_file(${CMAKE_MODULE_PATH}/../configs/mapguide.conf.in ${CMAKE_CURRENT_BINARY_DIR}/mapguide.conf)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mapguide.conf DESTINATION ${MG_INSTALL_WEB_PREFIX}/apache2/conf/mapguide COMPONENT ${MG_COMPONENT})
+
+if (WITH_JAVA)
+ configure_file(${CMAKE_MODULE_PATH}/../configs/tomcat.conf.in ${CMAKE_CURRENT_BINARY_DIR}/tomcat.conf)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tomcat.conf DESTINATION ${MG_INSTALL_WEB_PREFIX}/apache2/conf/mapguide COMPONENT ${MG_COMPONENT})
+
+ configure_file(${CMAKE_MODULE_PATH}/../configs/workers.properties.in ${CMAKE_CURRENT_BINARY_DIR}/workers.properties)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/workers.properties DESTINATION ${MG_INSTALL_WEB_PREFIX}/apache2/conf/mapguide COMPONENT ${MG_COMPONENT})
+endif (WITH_JAVA)
\ No newline at end of file
Modified: sandbox/jng/cmake_v2/Web/src/ApacheAgent/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Web/src/ApacheAgent/CMakeLists.txt 2018-01-09 10:01:47 UTC (rev 9297)
+++ sandbox/jng/cmake_v2/Web/src/ApacheAgent/CMakeLists.txt 2018-01-09 11:44:55 UTC (rev 9298)
@@ -34,7 +34,10 @@
add_sanitizers(mod_mgmapagent${MG_VERSION_SUFFIX})
add_dependencies(mod_mgmapagent${MG_VERSION_SUFFIX} httpd)
install(TARGETS mod_mgmapagent${MG_VERSION_SUFFIX} DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${MG_COMPONENT})
-install_symlink(${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/mod_mgmapagent${MG_VERSION_SUFFIX}.so mod_mgmapagent.so ${MG_COMPONENT})
+# Not using install_symlink macro here as install requirements are unique
+# The link target doesn't have to exist at this point in time, the symlink will be valid at install time
+execute_process(COMMAND ln -sf ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/mod_mgmapagent${MG_VERSION_SUFFIX}.so ${CMAKE_CURRENT_BINARY_DIR}/mod_mgmapagent.so)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mod_mgmapagent.so DESTINATION ${MG_INSTALL_WEB_PREFIX}/apache2/modules COMPONENT ${MG_COMPONENT})
target_link_libraries(mod_mgmapagent${MG_VERSION_SUFFIX}
MgFoundation${MG_VERSION_SUFFIX}
Modified: sandbox/jng/cmake_v2/Web/src/PhpApi/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Web/src/PhpApi/CMakeLists.txt 2018-01-09 10:01:47 UTC (rev 9297)
+++ sandbox/jng/cmake_v2/Web/src/PhpApi/CMakeLists.txt 2018-01-09 11:44:55 UTC (rev 9298)
@@ -59,6 +59,8 @@
add_dependencies(php_MapGuideApi${MG_VERSION_SUFFIX} swig IMake php)
install(TARGETS php_MapGuideApi${MG_VERSION_SUFFIX} DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${MG_COMPONENT})
install_symlink(${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/libphp_MapGuideApi${MG_VERSION_SUFFIX}.so libphp_MapGuideApi.so ${MG_COMPONENT})
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/constants.php DESTINATION ${MG_WWWROOT}/mapadmin COMPONENT ${MG_COMPONENT})
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/constants.php DESTINATION ${MG_WWWROOT}/mapviewerphp COMPONENT ${MG_COMPONENT})
target_link_libraries(php_MapGuideApi${MG_VERSION_SUFFIX}
${ACE_LIBRARY}
Added: sandbox/jng/cmake_v2/cmake/configs/mapguide.conf.in
===================================================================
--- sandbox/jng/cmake_v2/cmake/configs/mapguide.conf.in (rev 0)
+++ sandbox/jng/cmake_v2/cmake/configs/mapguide.conf.in 2018-01-09 11:44:55 UTC (rev 9298)
@@ -0,0 +1,44 @@
+# Environment variables for MapGuide
+SetEnv LD_LIBRARY_PATH "@MG_INSTALL_WEB_PREFIX@/lib:@MG_INSTALL_WEB_PREFIX@/php/lib:@MG_INSTALL_PREFIX@/lib"
+SetEnv MENTOR_DICTIONARY_PATH "@MG_INSTALL_COORDSYS_PREFIX@"
+
+LoadModule mgmapagent_module modules/mod_mgmapagent.so
+
+RewriteEngine On
+
+#START NormalCGI PHP configuration
+#ScriptAlias /php/ "@@MG_INSTALL_WEB_PREFIX@@/php/bin/"
+#Action application/x-httpd-php "/php/php"
+#AddType application/x-httpd-php .php
+#END NormalCGI PHP configuration
+
+# CGI agent alias
+#ScriptAlias /mapguide/mapagent/mapagent.fcgi "@MG_WWWROOT@/mapagent/mapagent"
+
+# mapviewerajax to mapviewerphp rewrite rules
+# comment out for java api/viewer
+RewriteRule ^/mapguide/mapviewerajax/([^\?])(.*)$ /mapguide/mapviewerphp/$1$2 [PT]
+RewriteRule ^/mapguide/mapviewerajax/(.*)$ /mapguide/mapviewerphp/ajaxviewer.php$1 [PT]
+RewriteRule ^/mapguide/mapviewerdwf/([^\?])(.*)$ /mapguide/mapviewerphp/$1$2 [PT]
+RewriteRule ^/mapguide/mapviewerdwf/(.*)$ /mapguide/mapviewerphp/dwfviewer.php$1 [PT]
+
+# mapviewerajax to mapviewerjava aliases
+# uncomment for java api/viewer
+#RewriteRule ^/mapguide/mapviewerajax/([^\?])(.*)$ /mapguide/mapviewerjava/$1$2 [PT]
+#RewriteRule ^/mapguide/mapviewerajax/(.*)$ /mapguide/mapviewerjava/ajaxviewer.jsp$1 [PT]
+#RewriteRule ^/mapguide/mapviewerdwf/([^\?])(.*)$ /mapguide/mapviewerjava/$1$2 [PT]
+#RewriteRule ^/mapguide/mapviewerdwf/(.*)$ /mapguide/mapviewerjava/dwfviewer.jsp$1 [PT]
+
+Alias /mapguide "@MG_WWWROOT@"
+
+<Directory "@MG_WWWROOT@">
+ AllowOverride All
+ Options All
+ Require all granted
+
+ AddHandler php5-script .php
+ AddHandler mgmapagent_handler fcgi
+
+ RewriteEngine on
+ RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
+</Directory>
\ No newline at end of file
Added: sandbox/jng/cmake_v2/cmake/configs/mapguide.xml.in
===================================================================
--- sandbox/jng/cmake_v2/cmake/configs/mapguide.xml.in (rev 0)
+++ sandbox/jng/cmake_v2/cmake/configs/mapguide.xml.in 2018-01-09 11:44:55 UTC (rev 9298)
@@ -0,0 +1,17 @@
+<!--
+
+ Context configuration file for the Tomcat Manager Web App
+
+ $Id: manager.xml,v 1.3 2004/08/26 17:03:34 remm Exp $
+
+-->
+
+
+<Context docBase="@MG_WWWROOT@"
+ privileged="true" antiResourceLocking="false" antiJARLocking="false">
+
+ <!-- Link to the user database we will get roles from -->
+ <ResourceLink name="users" global="UserDatabase"
+ type="org.apache.catalina.UserDatabase"/>
+
+</Context>
\ No newline at end of file
Added: sandbox/jng/cmake_v2/cmake/configs/tomcat.conf.in
===================================================================
--- sandbox/jng/cmake_v2/cmake/configs/tomcat.conf.in (rev 0)
+++ sandbox/jng/cmake_v2/cmake/configs/tomcat.conf.in 2018-01-09 11:44:55 UTC (rev 9298)
@@ -0,0 +1,23 @@
+#Tomcat Integration
+# 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 "@MG_INSTALL_WEB_PREFIX@/apache2/conf/mapguide/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 "@MG_INSTALL_WEB_PREFIX@/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
\ No newline at end of file
Added: sandbox/jng/cmake_v2/cmake/configs/workers.properties.in
===================================================================
--- sandbox/jng/cmake_v2/cmake/configs/workers.properties.in (rev 0)
+++ sandbox/jng/cmake_v2/cmake/configs/workers.properties.in 2018-01-09 11:44:55 UTC (rev 9298)
@@ -0,0 +1,11 @@
+# Define 1 real worker using ajp13
+worker.list=worker1
+# Set properties for worker1 (ajp13)
+worker.worker1.type=ajp13
+worker.worker1.host=localhost
+worker.worker1.port=@MG_TOMCAT_PORT@
+worker.worker1.lbfactor=50
+worker.worker1.cachesize=10
+worker.worker1.cache_timeout=600
+worker.worker1.socket_keepalive=1
+worker.worker1.recycle_timeout=300
\ No newline at end of file
Modified: sandbox/jng/cmake_v2/cmake_bootstrap.sh
===================================================================
--- sandbox/jng/cmake_v2/cmake_bootstrap.sh 2018-01-09 10:01:47 UTC (rev 9297)
+++ sandbox/jng/cmake_v2/cmake_bootstrap.sh 2018-01-09 11:44:55 UTC (rev 9298)
@@ -176,9 +176,20 @@
echo "Building HTTPD. Please wait"
make 2>&1 | tee $OEM_WORK_DIR/make_httpd_fake.log
check_build
- make install 2>&1 | tee $OEM_WORK_DIR/make_install_httpd_fake.log
- check_build
fi
+cd ${HTTPD_WORKDIR}
+echo "Installing HTTPD"
+make install 2>&1 | tee $OEM_WORK_DIR/make_install_httpd_fake.log
+check_build
+echo "Include conf/mapguide/*.conf" >> ${MG_INSTALL_WEB_PREFIX}/apache2/conf/httpd.conf
+# Activate mod_rewrite
+sed -i "s/#LoadModule rewrite_module modules\/mod_rewrite.so/LoadModule rewrite_module modules\/mod_rewrite.so/g" ${MG_INSTALL_WEB_PREFIX}/apache2/conf/httpd.conf
+# Make sure lib dirs are in envvars
+cat >> ${MG_INSTALL_WEB_PREFIX}/apache2/bin/envvars <<END-OF-ENVVARS
+export LD_LIBRARY_PATH=${MG_INSTALL_WEB_PREFIX}/lib:${MG_INSTALL_WEB_PREFIX}/php/lib:${MG_INST_PREFIX}/lib
+export MENTOR_DICTIONARY_PATH=${MG_INST_PREFIX}/share/gis/coordsys
+END-OF-ENVVARS
+
if test $HAS_PHP -eq 0; then
cd $SOURCE_DIR/Oem/LinuxApt
echo "Extracting PHP tarball"
@@ -190,25 +201,30 @@
echo "Building PHP. Please wait"
make 2>&1 | tee $OEM_WORK_DIR/make_php.log
check_build
- make install 2>&1 | tee $OEM_WORK_DIR/make_install_php.log
- check_build
fi
+cd ${PHP_WORKDIR}
+echo "Installing PHP"
+make install 2>&1 | tee $OEM_WORK_DIR/make_install_php.log
+check_build
+
if test $HAS_TOMCAT_CONNECTOR -eq 0; then
cd $SOURCE_DIR/Oem/LinuxApt
echo "Extracting Tomcat Connector tarball"
tar -zxf tomcat-connectors-${TC_VER}-src.tar.gz -C ${LA_WORKDIR}
cd ${TC_WORKDIR}/native
echo "Configuring Tomcat Connector"
- ./configure--with-apxs2=${MG_INSTALL_WEB_PREFIX}/apache2/bin/apxs 2>&1 | tee $OEM_WORK_DIR/configure_tc.log
+ ./configure --with-apxs=${MG_INSTALL_WEB_PREFIX}/apache2/bin/apxs 2>&1 | tee $OEM_WORK_DIR/configure_tc.log
check_build
echo "Building Tomcat Connector. Please wait"
make 2>&1 | tee $OEM_WORK_DIR/make_tc.log
check_build
- make install 2>&1 | tee $OEM_WORK_DIR/make_install_php.log
- check_build
fi
+echo "Installing Tomcat Connector"
+cd ${TC_WORKDIR}/native
+make install 2>&1 | tee $OEM_WORK_DIR/make_install_tc.log
+check_build
-#dump vars
+# dump vars to setup script
echo "#!/bin/sh" > $OEM_WORK_DIR/env_vars.sh
echo "export MG_INST_PREFIX=$MG_INST_PREFIX" >> $OEM_WORK_DIR/env_vars.sh
echo "export BUILD_CPU=$BUILD_CPU" >> $OEM_WORK_DIR/env_vars.sh
More information about the mapguide-commits
mailing list