BPS Stack Install Notes
The present document is relative to the installation carried out on a Mac OS X 10.6.8 system, running MAMP (Apache 2.0.63, MySQL 5.1.44, PHP 5.2.17 & 5.3.6).
For clarity, the process is decomposed in conceptually independent parts, although the actual process required a number of iterations. These notes are additional to those written by Patrick for the installation on Linode.
● MAMP Installation ○ Assuming installation folder is /Applications/MAMP ○ Set Apache port to 80, leave MySql to 3306 ○ Set PHP version to 5.2.17 ○ Do NOT, for any reason, set the root password in MySql to an empty string. ○ Make sure DocumentRoot is set to "/Applications/MAMP/htdocs" in httpd.conf ○ Add the mod_rewrite directives either in the
libphp5.so to conf/apache/httpd.conf
○ mod_jk ■ Compile (could be a hassle on MacOs X if XCode is not installed; a good option is https:// github.com/kennethreitz/osx-gcc-installer ■ Move to Library/modules/mod_jk.so ● Configuration of mod_jk ○ Apache side ■ httpd.conf ● LoadModule jk_module modules/mod_jk.so ● Include /Applications/MAMP/conf/apache/extra/mod_jk.conf ■ mod_jk.conf ● JkWorkersFile /Applications/MAMP/tomcat/conf/workers.properties ● JkMount /bps.services.webapp/* ajp13_worker ○ Tomcat side ■ workers.properties workers.tomcat_home=/Applications/MAMP/tomcat workers.java_home= local JVM installation (typically in something like /System/ Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home) ps=/ worker.list=ajp13_worker worker.ajp13_worker.port=8009 worker.ajp13_worker.host=localhost worker.ajp13_worker.type=ajp13 ■ server.xml ● Server SHUTDOWN port: 8010 ● Catalina HTTP 1.1 connector: Tomcat port, typically 8080 ● AJP/1.3 Connector por: 8009 ● Engine: defaultHost=’localhost’ ● BPS environment variables ○ In Finder, select “Go->Go To Folder”, type /etc and open launchd.conf with an editor (not TextEdit - doesn’t allow to edit as root). Alternatively, do this from command line. ○ Add and edit as necessary: #BPS Environment Settings setenv APACHE_CONF /Applications/MAMP/conf/apache setenv DB_USER root setenv DB_PASSWORD root setenv DB_PASSWORD_BPS G0Names! setenv BPS_CORPORA /Users/
● Notable issues ● Workers port issues: configuring the apache-side and the tomcat-side of mod_jk led to erratic behaviours that initially seemed to be related to a malfunction in the URL rewriting. Having verified the issue wasn't there, I was finally able to diagnose it as a port issue in the connection between Tomcat and Apache. ● Tomcat database connection: Tomcat seemed not to be able to authenticate to the local MySql database. The issue was originated by a mismatch in the classpath (Tomcat was indicating a general database connection error, but it was in fact not accessing the lib directory where mysql-connector lived). ● PHP Libraries: After getting the stack to work, issues arose in the authentication process: after a gruesome research where a number of other minor issues were highlighted and corrected (including legacy code and version mismatches), I uncovered the issue to be an obscurely documented error of libraries duplication. Cleared up the classpath and straightened up the dependencies.
● Troubleshooting ○ 502 Error when Apache tries to access Tomcat resources: most likely a port issue. Check the port settings in tomcat’s server.xml and workers.properties. ○