I am looking for a correct way to install mod_jk on Mac OS X 10.7 Lion or above. The goal is to test Tomcat behind Apache HTTPD.
I've found so far the only way to install mod_jk is to download source then configure it in the console and make and make install.
This is not very true because I will need to manage mod_jk installation and configuration myself. I for example can forget to delete mod_jk later when needed. Anyway I think there should be more friendly way to install mod_jk like some kind of DMG package.
I also found that mod_jk is available in the OS X Server. Actually it's on my development machine, but available only for the server.
<IfDefine MACOSXSERVER>
...
#LoadModule jk_module libexec/apache2/mod_jk.so
...
</IfDefine MACOSXSERVER>
May be there is a package for mod_jk somewhere for developers who don't install OS X Server or any other way.
UPDATES
- mod_proxy_ajp is an alternative. Main Pros: it's bundled with Apache and Mac OS X
- I now tested mod_proxy_ajp in my configuration and can say that it's even better - because no need extra configuration. mod_proxy_ajp goes out of the box on Mac and perhaps on linux-server too I believe. You also don't need to use extra workers.properties file.
Here is how my config looks like:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/Users/me/Sites/projekt"
ServerName projekt.local
<Directory "/Users/me/Sites/projekt">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>
ProxyPass /coolapp ajp://localhost:8009/coolapp
ProxyPassReverse /coolapp ajp://localhost:8009/coolapp
ErrorLog "/private/var/log/apache2/projekt.local-error_log"
CustomLog "/private/var/log/apache2/projekt.local-access_log" common
</VirtualHost>
This above and configured Tomcat with AJP connector is only what you need. Amazing!
Reference:
- Install mod_jk on OS X - http://www.bartbusschots.ie/blog/?p=1347
- Comparison mod_jk vs. mod_proxy_ajp apache to tomcat: mod_jk vs mod_proxy
- How to configure mod_proxy_ajp with Tomcat ?
Please suggest.
<VirtualHost *:80>
go intohttpd.conf
or somewhere else? – Ibby/coolapp
" refers to. What's the relation of that to theDocumentRoot
setting? – IbbyLoadModule
line that goes intohttpd.conf
formod_proxy_ajp
? That is, what is "xxx
" inLoadModule xxx modules/mod_proxy_ajp.so
? – IbbyLoadModule
syntax, what seems to work is:LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
. – IbbyLoadModule proxy_ajp_module modules/mod_proxy_ajp.so
. – Ibbywebapps
directory; and indeed it can be merely/
to indicatewebapps
itself. – Ibby