MobiLink Synchronization User's Guide
Synchronizing Through a Web Server
Configuring the servlet Redirector
This section describes how to install the servlet version of the Redirector to work on an Apache web server in conjunction with the Tomcat servlet container. Testing of the Redirector software has been carried out using Tomcat version 4.1 and Apache 2.0.45.
Installation requires the following steps:
Complete the steps in Configuring Redirector properties (all versions).
Install the servlet version of the Redirector in Tomcat.
Configure the Apache web server to run as a proxy.
This section uses %CATALINA_HOME% and %APACHE_HOME% as the root directory of your Tomcat and Apache installation respectively.
To install the servlet Redirector in Tomcat
Install Tomcat as a standalone server.
You can download Tomcat binaries from the Jakarta project on the Apache web site at http://jakarta.apache.org.
Optionally, set the required Tomcat HTTP port.
Tomcat binds to port 8080 by default. If there is a conflict, perhaps because another web server is using this port,
open the file: %CATALINA_HOME%/conf/server.xml
search for 8080 (which is in a <Connector> tag).
Change it to a port that is not in use.
Install the servlet Redirector as a web application.
Copy iaredirect.war file to %CATALINA_HOME%/webapps
Shutdown and restart Tomcat.
Tomcat expands the war file and creates the directory iaredirect for the Redirector web application.
Edit the file %CATALINA_HOME%/webapps/iaredirect/WEB-INF/web.xml. Search for redirector.config (in an <init-param> tag), and correct the path for the redirector.config file.
Change the entry redirector.config to read drive:/path/redirector.config. Even on Windows operating systems, use a forward slash as a path separator, as in d:/redirector.config.
Shutdown and restart Tomcat for the changes to take effect.
Once the changes have taken effect, you no longer need the war file in the deployed location.
The Redirector can now be invoked through the following URL:
http://tc-machine:tc-port/iaredirect/servlet/redirect/ml/
where tc-machine is the machine and tc-port the port on which Tomcat is listening.
To configure the Apache web server as a proxy
Install the Apache web server.
You can download binaries from the Apache web site at http://www.apache.org.
Optionally, change the Apache web server port.
Edit the file %APACHE_HOME%/conf/httpd.conf and change the Port setting to the desired port.
Configure Apache to run as a proxy.
In %APACHE_HOME%/conf/httpd.conf, add the following two directives:
LoadModule proxy_module {module-path}/mod_proxy.so LoadModule proxy_connect_module {module-path}/mod_proxy_connect.so LoadModule proxy_http_module {module-path}/mod_proxy_http.so
For example, the path may be modules/mod_proxy.so (the default).
Configure Apache to forward Redirector URLs to Tomcat.
In %APACHE_HOME%/conf/httpd.conf, add the following two directives so that Apache forwards URLs of the form http://localhost/iaredirect/* to the Tomcat 4 Connector listening on port 8080:
ProxyPass /iaredirect http://localhost:8080/iaredirect
The port number must match the port number used for Tomcat. If Tomcat and Apache are not running on the same machine, provide the machine name where Tomcat is running instead of localhost.
If you are using HTTPS synchronization, configure your server as follows:
Download and install binaries for mod_ssl and OpenSSL. You can find them using the Apache Module Registry at http://modules.apache.org/. mod_ssl.so must be copied to %APACHE_HOME%\modules. libeay32.dll and ssleay32.dll must be copied to %APACHE_HOME%\bin.
Generate a server certificate and private key either by generating a request with reqtool.exe and sending it to a third party certificate authority to sign it, or by generating a certificate directly using gencert.exe. The private key can either be in the same file as the server certificate or in its own file.
Add the following lines to %APACHE_HOME%\conf\httpd.conf:
LoadModule ssl_module modules/mod_ssl.so SSLEngine on SSLCertificateFile certificate_file
where certificate_file is the path and file name of the server's certificate file.
If the server's private key is in a separate file from the server's certificate, add the additional line
SSLCertificateKeyFile private_key_file
where private_key_file is the path and file name of the server's private key.
If the private key is encrypted using a pass phrase and you are running under win32, add the additional line
SSLPassPhraseDialog exec:exe_name
where exe_name is the path and file name of an executable that will return the pass phrase on stdout.
Alternatively, the pass phrase can be removed from the private key using openssl:
openssl rsa -in src_file -out dst_file
where src_file is the path and file name of the private key protected by a pass phrase, and dst_file is the path and file name of the output file that will contain the unprotected private key. Note that this may reduce server security.
Following is an example of how to configure Apache for HTTPS. This example uses Apache's virtual host feature to read HTTPS from port 443 (the default HTTPS port) and HTTP from port 80 at the same time.
LoadModule ssl_module modules/mod_ssl.so Listen 80 Listen 443 NameVirtualHost *:443 <VirtualHost _default_:443> ServerName server_name:443 ErrorLog logs/https_error CustomLog logs/https_access common SSLEngine on SSLCertificateFile rsaserver.crt SSLCertificateKeyFile rsaserver.key </VirtualHost>
To check your configuration
Call the Redirector using the following syntax:
http://host:port/iaredirect/servlet/redirect/ml/app
Check the log file to see if the Redirector logged a request.