Hyrax - Apache Integration: Difference between revisions

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
No edit summary
No edit summary
Line 1: Line 1:
'''Request for Alternate Solutions:''' ''If these suggestions work for you then we are all happy. If you have a better method for achieving the same or similar goals then we would love to hear about it. If you're stuck and can't figure out how to achieve your goals, get in touch and I will try to help. - ndp (ndp at opendap dot org) Or email the OPeNDAP tech support list (opendap-tech at unidata dot ucar dot edu); see [http://www.opendap.org/mailLists/index.html mail lists] for information about the list.''
== Overview ==
== Overview ==
The problem of linking Tomcat with Apache has been greatly reduced as of Apache 2.2. In previous incarnations of Apache & Tomcat, it was fairly complex. To see how to solve the problem for older versions of Apace, see the [[old Apache Integration instructions]]. What follows are the instructions for Apache 2.2 and Tomcat 6.x.
The problem of linking Tomcat with Apache has been greatly reduced as of Apache 2.2. In previous incarnations of Apache & Tomcat, it was fairly complex. To see how to solve the problem for older versions of Apace, see the [[old Apache Integration instructions]]. What follows are the instructions for Apache 2.2 and Tomcat 6.x.


== Prerequisites ==
== Prerequisites ==
* Apace 2.2 or greater
* Apace 2.2 or greater
* Tomcat 6.x or greater
* Tomcat 6.x or greater
* mod_proxy_ajp installed in Apache (typically this is present in 2.2+)
* mod_proxy_ajp installed in Apache (typically this is present in 2.2+)


== How to do it ==
== What ==
 
=== The Tomcat configuration ===
=== The Tomcat configuration ===
You have to create the AJP connector in the ''conf/server.xml'' file:
You have to create the AJP connector in the ''conf/server.xml'' file:


Line 22: Line 16:


=== Apache2 configuration ===
=== Apache2 configuration ===
Add this to Apache's ''httpd.conf'' file:
Add this to Apache's ''httpd.conf'' file:


Line 36: Line 29:
NB: It's possible to embed these in a ''VirtualHost'' directive.
NB: It's possible to embed these in a ''VirtualHost'' directive.


== Why this works ==
== Why ==
 
ProxyPass and ProxyPassReverse are classic reverse proxy directives used to forward the stream to another location.
ProxyPass and ProxyPassReverse are classic reverse proxy directives used to forward the stream to another location.
''ajp://...'' is the AJP connector location (your tomcat's server host/port)
''ajp://...'' is the AJP connector location (your tomcat's server host/port)


A web client will connect through HTTP to http://localhost/ (supposing your apache2 server is running on localhost), the ''mod_proxy_ajp'' will forward you request transparently using the AJP protocol to the tomcat application server on localhost:8009.
A web client will connect through HTTP to http://localhost/ (supposing your apache2 server is running on localhost), the ''mod_proxy_ajp'' will forward you request transparently using the AJP protocol to the tomcat application server on localhost:8009.

Revision as of 12:12, 6 November 2011

Overview

The problem of linking Tomcat with Apache has been greatly reduced as of Apache 2.2. In previous incarnations of Apache & Tomcat, it was fairly complex. To see how to solve the problem for older versions of Apace, see the old Apache Integration instructions. What follows are the instructions for Apache 2.2 and Tomcat 6.x.

Prerequisites

  • Apace 2.2 or greater
  • Tomcat 6.x or greater
  • mod_proxy_ajp installed in Apache (typically this is present in 2.2+)

What

The Tomcat configuration

You have to create the AJP connector in the conf/server.xml file:

<Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

This line will enable AJP connections to the 8009 port of your tomcat server (localhost for example).

Apache2 configuration

Add this to Apache's httpd.conf file:

  <Proxy *>
    AddDefaultCharset Off
    Order deny,allow
    Allow from all
  </Proxy>

  ProxyPass / ajp://localhost:8009/
  ProxyPassReverse / ajp://localhost:8009/

NB: It's possible to embed these in a VirtualHost directive.

Why

ProxyPass and ProxyPassReverse are classic reverse proxy directives used to forward the stream to another location. ajp://... is the AJP connector location (your tomcat's server host/port)

A web client will connect through HTTP to http://localhost/ (supposing your apache2 server is running on localhost), the mod_proxy_ajp will forward you request transparently using the AJP protocol to the tomcat application server on localhost:8009.