Installing and Configuring Apache for Use with the Platform

From AgileApps Support Wiki
Revision as of 18:46, 3 May 2011 by imported>Aeric (Text replace - 'Category:System Administration' to 'Category:Installation')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Configuring Apache to serve static content from LongJump

LongJump content includes gif and jpeg images, CSS, and JavaScript files. Apache httpd serves such static content efficiently, leaving the Application Server free to process incoming requests. This section tells you how to configure Apache to serve LongJump's static content.

Notepad.png

Note: LongJump versions the static content, so browsers use a locally cached copy, unless a later version is available.

Overview

With this arrangement, Apache will be in front of Tomcat. Any request that comes to LongJump will first go to Apache. Apache will determine if the request is a valid LongJump request and, if so, will forward the request to Tomcat to process the request.

Since Apache will be in front of Tomcat, it needs to be configured to listen on port 80 and port 443 for http and https traffic respectively. Apache also needs to be configured to forward traffic coming on these ports which is meant for LongJump to the port on which Tomcat is listening.

Requirements

  • LongJump Application Server set up.
  • Apache Server compiled using the following modules:
mod_proxy
mod_ssl
mod_expires
mod_headers

Configuration Process

In outline, the process looks like this:

  1. Configure Apache to serve static content.
  2. Configure Tomcat Connectors.
  3. Configure Apache Virtual host.
  4. Start Apache, Tomcat and memcached.

Configure Apache to Serve Static Content

These steps are optional. Do them if you intend to let Apache serve up static files. (That configuration is recommended, but not required.)

  1. Download LongJump installation file from FTP which will be of the form longjump_app_server-v7.x.x.x.gz
  2. Untar the archive.
    The longjump_app_server folder is created, containing the Installation Files.
  3. In longjump_app_server/, go to static_contents/
  4. Move static-networking.tar.gz, to the Apache web server's documentroot folder.
  5. Go to Apache’s documentroot folder
  6. Untar static-networking.tar.gz
    The networking folder is created, with a file hierarchy set up for static content:
    Charts/
    ckeditor/
    flash/
    graphics/
    images/
    js/
    style/
    wait.html

Configure Tomcat Connectors

  1. In longjump_installation/tomcat/conf/, edit server.xml
  2. Remove connectors pointing to ports 80 and 443.
  3. Add a connector for traffic forwarded from Apache, as shown here:
<Connector 
  port="8006"  maxThreads="450"  
  minSpareThreads="25"  maxSpareThreads="75" 
  debug="0"  enableLookups="false"  
  acceptCount="450"  connectionTimeout="30000"  
  disableUploadTimeout="true"  scheme="https"  proxyPort="443" 
  useIPVhosts="true"  URIEncoding="UTF-8"  
  maxHttpHeaderSize="8192"
/>

Notes:

  • The LongJump standard is to use port 8006. That value is assumed in the remainder of this section. (It can be changed, if desired.)
  • The next step will be to configure Apache so that incoming HTTP and HTTPS traffic on ports 80 and 443 will be forwarded to port 8006, where Tomcat will be listening.

Configure Apache Virtual Hosts

1. Add two virtual host entries
- One in httpd.conf for Apache to listen on port 80 for HTTP traffic.
- One in httpd-ssl.conf for Apache to listen on port 443 for HTTPS traffic.
Any traffic meant for LongJump coming on these ports will be forwarded to Tomcat. This request forwarding is achieved using the mod_proxy module.
The httpd.conf and httpd-ssl.conf configuration files can be found in the $APACHE_HOME directory. For each virtual host entry, make sure the following are set appropriately:
ServerAdmin root@localhost
DocumentRoot "/usr/local/apache/htdocs/"
ServerName example.com
ServerAlias www.example.com
2. Configure certificates for SSL virtual host on port 443
Make sure the following points to your certificate and private key.
httpd-ssl.conf:
SSLCertificateFile "longjump_installation/tomcat/conf/RN/<yourdomain>.cer"
:::SSLCertificateKeyFile "longjump_installation/tomcat/conf/RN/<yourdomain>_private_key"
3. Configure Proxy Paths in Apache
Proxy paths need to be configured to enable mod_proxy to recognize the request and forward it to Tomcat appropriately.
For example:
ProxyPass /networking/* http://tomcat-host-name:8006/networking/*
ProxyPassReverse /networking/* http://tomcat-host-name:8006/networking/*
Note: These instructions assume that Tomcat and Apache are running on the same server. If they are running on different servers, change the settings appropriately.
4.Configure virtual hosts
For each virtual host in httpd.conf and httpd-ssl.conf for ports 80 and 443, copy the settings in proxy_paths.txt, changing the standard port assignment of 8006, if needed.