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 2 Next »

Configuring Jetty 6 - AJP13 Using mod_jk 

Configuring Apache HTTPD server with mod_jk

  • in your <apache-root>/modules/ directory and your mod_jk.so
  • in your add the entry below in your httpd.conf apache configuration file located in <apache-root>/conf/ directory.
  • *_LoadModule jk_module modules/mod_jk.so_* tels your apache server to load the mod_jk libray and where it is located.
  • *JkWorkersFile "conf/worker.properties"* this line tells mod_jk where your worker.properties is located.
  • *JkLogFile "logs/mod_jk.log"* this line tells mod_jk were to write mod_jk related Logs.
  • And the rest of the line is self explanatory

<IfModule !mod_jk.c>
LoadModule jk_module modules/mod_jk.so
</IfModule>

<IfModule mod_jk.c>
JkWorkersFile "conf/worker.properties"

JkLogFile "logs/mod_jk.log"

JkLogLevel info

JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

JkOptions +ForwardKeySize +ForwardURICompat
</IfModule>

  • After add 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

<VirtualHost host:*>

ServerName yourserver

ServerAdmin user@yourserver

## you may add further entries concerning log-files, log-level, URL-rewriting, ...

## pass requests through to jetty worker

JkMount /* jetty
</VirtualHost>

  •  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
    worker.list=jetty

worker.jetty.port=8009

worker.jetty.host=<server name or ip where your jetty will be running>

worker.jetty.type=ajp13

worker.jetty.lbfactor=1

Configure Jetty to Accept AJP Requests usisng AJP13SocketConnector

Using Jetty XML Configuration

<Call name="addConnector">
<Arg>

<New class="org.mortbay.jetty.ajp.Ajp13SocketConnector">

<Set name="port">8009</Set>

</New>

</Arg>
</Call>

Embedding Jetty in your application

Server server = newServer();

Ajp13SocketConnector ajpConnector=newAjp13SocketConnector();

ajpConnector.setPort(8009);

server.setConnectors(new Connector[] 

Unknown macro: {ajpConnector}

);

HandlerCollection handlers = new HandlerCollection();

ContextHandlerCollection contexts = new ContextHandlerCollection();

handlers.setHandlers(newHandler[]{contexts, new DefaultHandler()});

server.setHandler(handlers);

...

server.start();

server.join();

  • 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