Prerequisite: Tomcat and, if applicable, Apache are installed.
The following examples have been tested with Apache version 2.0.59, Apache version 2.2.4, and Tomcat
5.5.17:
In the following example, the Ajax Web application is deployed into an unmodified Tomcat installation.
By default Tomcat is available at port 8080.
The file ajax.war is copied to the Tomcat directory webapps.
After Tomcat is started, the Web application is available at http://<server name>:8080/ajax.
In the following example, the Tomcat installation is adapted so that the parameter ":8080" is unnecessary.
Note:
You must first use "netstat -an" to check whether port 80 is occupied (for example by another installed Apache).
To make Tomcat available on port 80, the following parameter must be changed in the file conf/server.xml:
Replace
<Connector port="8080" ...
with
<Connector port="80" ...
The file ajax.war is copied to the Tomcat directory webapps.
When Tomcat is started, the Web application is available at http://<server name>/ajax.
In the following example, the Ajax Web application is deployed into an unmodified Tomcat installation.
The Apache installation, however, is adjusted so that access to Tomcat is supported.
Note:
For the connection between Apache and Tomcat with mod_jk. there is an alternative solution.
In the Apache file httpd.conf, the following lines must be added for access to Tomcat:
# activate proxy modules
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
# proxy for ajax Web application
ProxyPass /ajax/ http://localhost:8080/ajax/
ProxyPass /ajax http://localhost:8080/ajax/
ProxyPassReverse /ajax/ http://localhost:8080/ajax/
The file ajax.war is copied to the Tomcat directory webapps.
After Apache and Tomcat are started, the Web application is available at http://<server name>/ajax.
As in the previous example,
the Ajax Web application is installed with Tomcat unmodified.
The Apache installation in this example is
extended in such a way that Ajax is only available over HTTPS.
In the Apache file httpd.conf, the only access is configured over HTTPS. This requires adding the following lines in front of the parameters for Ajax:
# activate and configure SSL modules LoadModule ssl_module modules/mod_ssl.so SSLPassPhraseDialog builtin SSLMutex default SSLCertificateFile "<Apache installation directory>/conf/<file with certificate>" SSLCertificateKeyFile "<Apache installation directory>/conf/<file with private key>" Listen 443 <VirtualHost *:443> SSLEngine on # activate proxy modules LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so
# proxy for Ajax web application ProxyPass /ajax/ http://localhost:8080/ajax/ ProxyPass /ajax http://localhost:8080/ajax/ ProxyPassReverse /ajax/ http://localhost:8080/ajax/
The following line must be added after the Ajax parameters:
</VirtualHost>
The file ajax.war is copied to the Tomcat directory webapps.
After Apache and Tomcat are started, the Web application is available at https://<server name>/ajax.
In the following example, the Ajax Web application is deployed into an unmodified Tomcat installation.
The Apache installation, however, is customized in such a way that data exchange between Apache
and Tomcat is carried out over the Apache module mod_jk.
Note:
This installation type often leads to better performance than an installation with the Apache module mod_proxy. See Access with Apache and Tomcat.
Note:
It is important to use the appropriate version of mod_jk (depending on the installed version of Apache and Tomcat). The module mod_jk (and also the file isapi_redirect.dll under Windows) must be downloaded separately.
In the Apache file httpd.conf, the following lines for mod_jk must be added:
LoadModule jk_module modules/<downloaded module mod_jk (for example mod_jk-apache-2.2.4.so)>
JkWorkersFile "<Apache installation directory>/conf/workers.properties"
JkLogFile logs/mod_jk.log
JkLogLevel error
# connection to ajax Web application
JkMount /ajax/* mainworker
JkMount /ajax mainworker
The file "<Apache installation directory>/conf/workers.properties" must also be made available:
workers.tomcat_home="<Tomcat installation directory>"
workers.java_home="<Java installation directory>"
worker.list=mainworker
workers.mainworker.type=ajp13
workers.mainworker.port=8009
workers.mainworker.cachesize=20
The linkage between the files http.conf and workers.properties is done using the name mainworker.
The file ajax.war is copied to the Tomcat directory webapps.
After Apache and Tomcat are started, the Web application is available at http://<server name>/ajax.
Data can be compressed during transmission by modifying Apache or Tomcat.
In the first example, the Apache installation is modified so that data is transmitted in the form
of compressed (zipped) files.
In addition to the parameters for LogWeb/Ajax, the following lines must be added in the Apache file httpd.conf.
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
<Location />
# Insert Filter
SetOutputFilter deflate
# Netscape 4.x has some problems
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as netscape but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
#Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
In the second example, the Tomcat installation is modified so that data is transmitted in the form of compressed (zipped) files.
This requires modifying the following line in the Tomcat file conf/server.xml:
<Connector port="8080" ... compression="on"
Note:
The second variant is not possible in connection with the Apache module mod_jk (see above)!
The file ajax.war is copied to the Tomcat directory webapps.
After Apache and Tomcat are started, the Web application is available at http://<server name>/ajax.
The computer with the Ajax Web application is configured as in one of the previous examples.
The Apache on the front-end computer routes the external HTTPS access requests to the computer
with Ajax. HTTP is used for this purpose. Internal access is also gained over HTTP.
In the Apache file httpd.conf on the front-end computer, the exclusive access over HTTPS is configured. This requires adding the following lines:
# activate and configure SSL modules
LoadModule ssl_module modules/mod_ssl.so
SSLPassPhraseDialog builtin
SSLMutex default
SSLCertificateFile "<Apache installation directory>/conf/<file with certificate>"
SSLCertificateKeyFile "<Apache installation directory>/conf/<file with private key>"
Listen 443
<VirtualHost *:443>
SSLEngine on
# activate proxy modules
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
# proxy for ajax Web application
ProxyPass /ajax/ http://<internal computer with ajax>/ajax/
ProxyPass /ajax http://<internal computer with ajax>/ajax/
ProxyPassReverse /ajax/ http://<internal computer with ajax>/ajax/
</VirtualHost>
When the front-end Apache is started, the Web application is available externally at https://<front-end computer>/ajax.
If you plan to migrate from LogWeb to LogWeb/Ajax, it can be useful to migrate step by step and use both technologies simultaneously for some time. In this case, you simply add the entries mentioned here to your Apache configuration and remove the entries relevant for LogWeb when the migration is completed.
You can find obsolete entries by searching the configuration files for logwebhtml and logwebcgi.