Jetty has moved!
Jetty is a project at the Eclipse Foundation.
Homepage:http://www.eclipse.org/jetty
Downloads: http://download.eclipse.org/jetty/
Documentation:http://www.eclipse.org/jetty/documentation/current/
About:http://www.eclipse.org/jetty/about.php
Jetty Powered:http://www.eclipse.org/jetty/powered/
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

Apache AJP13, mod_jk and mod_proxy_ajp

The apache web server is frequently used as a server in front of a servlet container.
While there are no real technical reasons to front Jetty with apache, sometimes this is needed to fit with a corporate infrastructure or simply to stick with a known deployment structure.

Requests can be forwarded from apache to jetty either as HTTP, using mod_proxy or with the AJP protocol using mod_jk or mod_proxy_ajp. The mod_proxy approach appears to be more flexible, maintained and is now fully featured with mod_proxy_balancer.

Configuring Apache HTTPD server with mod_jk

  • put mod_jk.so into your <apache-root>/modules/ directory
  • you can download mod_jk.so here http://www.opensourcecommunity.ph/apache/tomcat/tomcat-connectors/jk/binaries/
  • add the entry below in your httpd.conf apache configuration file located in <apache-root>/conf/ directory.



Where:

  • LoadModule jk_module modules/mod_jk.so tells your apache server to load the mod_jk libray and where it is located.
  • JkWorkersFile conf/worker.properties tells mod_jk where your worker.properties is located.
  • JkLogFile logs/mod_jk.log tells mod_jk where to write mod_jk related Logs.
  • After adding the mod_jk configuration you may add a VirtualHost Entry in the same file (httpd.conf) as long as its located below your mod_jk configuration entry:



  • Add a worker file worker.properties in your <apache-root>/conf/
  • add the entries below, and make sure to specify your ip-address or hostname in worker.jetty.host property entry to where your jetty application is runnning



 Configuring Apache HTTPD server with mod_proxy_ajp

  •  add the entry below in your httpd.conf apache configuration file located in <apache-root>/conf/ directory.


Where:

  

  • LoadModule proxy_module modules/mod_proxy.so tells your apache server to load the mod_proxy libray and where it is located.
  • LoadModule proxy_ajp_module modules/mod_proxy_ajp.so tells your apache server to load the mod_proxy_ajp libray and where it is located.
  • LoadModule proxy_balancer_module modules/mod_proxy_balancer.so tells your apache server to load the mod_proxy_balancer libray and where it is located.
  • ProxyPreserveHost On - keeps the original Host Header.
  • ProxyPass - Maps the remote server Path to the Jetty Vertual Server Path, in our example we used a balancer.
  • Below is where you map your balancer cluster to one of your jetty server.



Configure Jetty to Accept AJP Requests usisng AJP13SocketConnector

Using Jetty XML Configuration





Embedding Jetty in your application





Compatibilities

Apache

mod_jk

Win32

Linux(ubuntu)

Apache 1.3


No HTTPD Binary Available



mod_jk-1.2.14


Not yet tested


mod_jk-1.2.15


Not yet tested


mod_jk-1.2.18


Not yet tested


mod_jk-1.2.19


Not yet tested

Apache 2.0 (2.0.59)





mod_jk-1.2.14

(tick)



mod_jk-1.2.15

(tick)



mod_jk-1.2.18

(tick)



mod_jk-1.2.19

(tick)


Apache 2.2





mod_jk-1.2.14

No Binary Available



mod_jk-1.2.15

No Binary Available



mod_jk-1.2.18

(tick)



mod_jk-1.2.19

(tick)


  • No labels
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery