{"id":1347,"date":"2009-05-05T22:02:38","date_gmt":"2009-05-05T22:02:38","guid":{"rendered":"http:\/\/www.bartbusschots.ie\/blog\/?p=1347"},"modified":"2014-08-04T17:36:29","modified_gmt":"2014-08-04T17:36:29","slug":"installing-mod_jk-for-apache-22-on-mac-os-x-105-leopard","status":"publish","type":"post","link":"https:\/\/www.bartbusschots.ie\/s\/2009\/05\/05\/installing-mod_jk-for-apache-22-on-mac-os-x-105-leopard\/","title":{"rendered":"Installing mod_jk for Apache 2.2 on Mac OS X 10.5 Leopard"},"content":{"rendered":"<p><em><strong style=\"color:red\">Note:<\/strong> these instructions also work on OS X 10.6 Snow Leopard, and OS X 10.7 Lion<\/em><\/p>\n<p>A few years ago I did a similar tutorial for <a href=\"http:\/\/www.bartbusschots.ie\/blog\/?p=331\">installing <code>mod_jk<\/code> on OS X 10.4 Tiger<\/a>, but yesterday I discovered that those instructions do not work for Leopard. It took my quite a bit of googling and trial an error, but I&#8217;ve found a solution that works, which I&#8217;m going to share here. This solution is, in my opinion, a best practices solution, and does not involve any changes to your core apache configuration file (<code>httpd.conf<\/code>). These instructions are for the default install of Apache 2.2 that comes pre-installed on OS X 10.5 Leopard. I can verify that these instructions work for Tomcat 5.0.30, but I would be 99% sure they should also work un-changed for Tomcat 5.5.X and Tomcat 6.0.X.<\/p>\n<p><!--more-->The obvious first step is to download the latest version of the <code>mod_jk<\/code> Connector from <a href=\"http:\/\/tomcat.apache.org\/download-connectors.cgi\" target=\"_blank\">the Apache site<\/a> (download the <code>.tar.gz<\/code> source file). I tested these instructions using <a href=\"http:\/\/apache.mirrors.esat.net\/tomcat\/tomcat-connectors\/jk\/source\/jk-1.2.28\/tomcat-connectors-1.2.28-src.tar.gz\" target=\"_blank\">version 1.2.28<\/a>. Once you have the file downloaded extract it by double-clicking it in the Finder. Then launch the Terminal and change into the folder you just extracted from the <code>.tar.gz<\/code> file. From this location execute the following commands:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ cd native\r\n$ .\/configure CFLAGS=&#039;-arch x86_64&#039; APXSLDFLAGS=&#039;-arch x86_64&#039; --with-apxs=\/usr\/sbin\/apxs\r\n$ make\r\n$ sudo make install\r\n<\/pre>\n<p>Please note that these instructions are for 64bit Intel machines (Core 2 Duo and above), if your machine has a 32bit Intel processor (e.g. Core Duo or Core Solo) replace all instances of <code>x86_64<\/code> with <code>i386<\/code>, similarly 32bit PowerPC users (i.e. G4 users) should replace all instance of <code>x86_64<\/code> with <code>ppc<\/code>, and 64bit PowerPC users (i.e. G5 users) with <code>ppc64<\/code>.<\/p>\n<p>If the above Terminal commands execute without errors you have successfully compiled and installed <code>mod_jk<\/code>. In order to start using it you will need to do two more things. Firstly, you will need to create the file <code>\/etc\/apache2\/other\/workers.properties<\/code> and give it the following content:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n#\r\n# The workers that jk should create and work with\r\n#\r\nworker.list=ajp13\r\n\r\n#\r\n# Defining a worker named ajp13 and of type ajp13\r\n# Note that the name and the type do not have to match.\r\n#\r\nworker.ajp13.type=ajp13\r\nworker.ajp13.host=localhost\r\nworker.ajp13.port=8009\r\n<\/pre>\n<p>And secondly, you will need to create the file <code>\/etc\/apache2\/other\/mod_jk.conf<\/code> and give it content something like the following, substituting in your own JkMount directives at the end:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# Load mod_jk module\r\n# Update this path to match your modules location\r\nLoadModule jk_module libexec\/apache2\/mod_jk.so\r\n# Where to find workers.properties\r\n# Update this path to match your conf directory location (put workers.properties next to httpd.conf)\r\nJkWorkersFile \/etc\/apache2\/other\/workers.properties\r\n# Where to put jk shared memory\r\n# Update this path to match your local state directory or logs directory\r\nJkShmFile \/var\/log\/apache2\/mod_jk.shm\r\n# Where to put jk logs\r\n# Update this path to match your logs directory location (put mod_jk.log next to access_log)\r\nJkLogFile \/var\/log\/apache2\/mod_jk.log\r\n# Set the jk log level &#x5B;debug\/error\/info]\r\nJkLogLevel info\r\n# Select the timestamp log format\r\nJkLogStampFormat &quot;&#x5B;%a %b %d %H:%M:%S %Y] &quot;\r\n\r\n# Send everything for context \/example to worker named ajp13\r\nJkMount \/example\/* ajp13\r\n<\/pre>\n<p>That&#8217;s it, just verify that you don&#8217;t have any issues with your config by running:<\/p>\n<pre>\r\n$ sudo apachectl configtest\r\n<\/pre>\n<p>Then just restart Apache to load up the new configuration:<\/p>\n<pre>\r\n$ sudo apachectl restart\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Note: these instructions also work on OS X 10.6 Snow Leopard, and OS X 10.7 Lion A few years ago I did a similar tutorial for installing mod_jk on OS X 10.4 Tiger, but yesterday I discovered that those instructions do not work for Leopard. It took my quite a bit of googling and trial [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[12,446],"tags":[426,422,5,427,408,26,421],"series":[],"class_list":["post-1347","post","type-post","status-publish","format-standard","hentry","category-computers-tech","category-sysadmin","tag-apache","tag-apache-tomcat","tag-java","tag-mod_jk","tag-open-source","tag-os-x","tag-web-server"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7t9xK-lJ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/1347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/comments?post=1347"}],"version-history":[{"count":6,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/1347\/revisions"}],"predecessor-version":[{"id":7390,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/1347\/revisions\/7390"}],"wp:attachment":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/media?parent=1347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/categories?post=1347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/tags?post=1347"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/series?post=1347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}