How to Deploy Cross-Platform CData Sync to IIS



CData Sync can be deployed to Microsoft Internet Information Services (IIS), which enables businesses to host Sync as an externally facing website, allowing authorized users to access it remotely. This deployment allows organizations to utilize the advanced features of IIS, such as enhanced security, load balancing, or centralized management of web applications, all while keeping the simplicity and functionality of CData Sync's embedded web server.

This article provides a guide to deploy CData Sync in IIS using two methods: The recommended method of setting up IIS as a reverse proxy for CData Sync and the legacy method for deploying CData Sync to IIS.

IIS Configured as a Reverse Proxy (Recommended Method)

Prerequisites:

  • A server with CData Sync installed and configured.
  • A server with IIS installed, including the URL Rewrite and Application Request Routing (ARR) modules.
  • Appropriate network permissions to allow communication between IIS and the CData Sync server.

Step 1: Install and configure CData Sync

Ensure that CData Sync is installed and operational on its default port or a custom port if you have configured it differently. Confirm that you can access the CData Sync web interface directly before proceeding.

Step 2: Install IIS and necessary modules

  1. Install IIS on the server where you want to set up the reverse proxy.
  2. Ensure that the URL Rewrite and ARR modules are installed. These can be downloaded and installed from the Microsoft IIS download page if they are not already present.

Step 3: Configure IIS as a reverse proxy

  1. Open IIS Manager: Launch the Internet Information Services (IIS) Manager from your server.
  2. Select the Site: Choose or create the site under which you want to configure the reverse proxy. Typically, this is the Default Web Site.
  3. URL Rewrite:
    1. Go to the URL Rewrite feature within the IIS Manager.
    2. Click on Add Rule(s)… and click OK
    3. Choose Reverse Proxy from the list of available rule templates.
    4. Enter the hostname (IP address or domain) and the port where CData Sync is running. For example, if CData Sync is running on the same server, enter localhost and the port number.
  4. ARR Configuration:
    1. Go to Application Request Routing Cache under the IIS Manager.
    2. In the right panel, open Server Proxy Settings.
    3. Check the box for Enable proxy, and ensure the settings are configured to forward HTTP requests to your CData Sync server.

Step 4: Testing and validation

Test the configuration by accessing the CData Sync UI through the IIS server’s URL. Verify that all functionalities are working as expected without any loss of functionality or performance issues.

Optional Step: Configure SSL

If you require SSL for secure communications:

  • Configure SSL certificates in IIS to handle HTTPS requests.
  • Set up SSL termination at IIS, which means SSL requests will be decrypted at IIS and forwarded as HTTP to CData Sync, or configure SSL pass-through to forward encrypted requests directly.

IIS Configured (Legacy Method)

Although Sync comes packaged with the embedded Jetty web server, you can also deploy it to the Microsoft IIS web server. The sections that follow provide the steps you need to accomplish a deployment to IIS.

Prerequisites:

  • A server with CData Sync installed and configured.
  • A server with IIS installed, including the HttpPlatformHandler module from the Microsoft IIS download page.
  • Appropriate network permissions to allow communication between IIS and the CData Sync server.
  • Create a new folder for Sync (for example, C:\inetpub\sync).
  • Create the web.config file in the folder that you created. Then, add the following content to web.config:
    <?xml version="1.0" encoding="UTF-8" ?>
    <configuration>
        <system.webServer>
            <handlers>
                <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
            </handlers>
            <httpPlatform processPath="C:\Program Files\CData\CData Sync\jre\jdk-17.0.5+8\bin\java.exe"
                          arguments="-Dcdata.http.port=%HTTP_PLATFORM_PORT% -jar &quot;C:\Program Files\CData\CData Sync\sync.jar&quot;"
                          stdoutLogEnabled="true"
                          stdoutLogFile="C:\inetpub\sync\log.txt">
            </httpPlatform>
        </system.webServer>
    </configuration>

Step 1: Create a new website

  1. Open the IIS Manager.
  2. Right-click Sites (in the Connections pane) and select Add Website.
  3. Enter the following information in the Add Website dialog that is displayed:
    • Site name - The name for your website (for example, “My Sync Website”).
    • Physical path - The physical path of the folder that you created earlier, for example, C:\inetpub\sync.
    • Type - The protocol type (leave this field as the default value, http).
    • Port - The port number to which you want the website to bind. The default port (80) is fine, or you can choose another port.
  4. Click OK to start the new website
  5. In your browser, navigate to http://127.0.0.1:YourPortNumber to access Sync.

Notes:

  • This example uses the default website.
  • You cannot use “localhost” in the HTTP path. You must use the IP value instead.

Step 2: Configure directory permissions

The application must have full access to the Sync application directory for full functionality. The application directory contains the following folders: connections, data, db, downloads, locks, logs, and profiles

To set permissions, locate the application directory for your Sync installation and follow these steps:

  1. Right-click the folder and click Properties On the Security tab, select Edit > Add.
  2. Enter the following text in the Enter the object names to select box. Substitute the name of your application pool for YourApplicationPool in the line below (example: IIS AppPool\\DefaultAppPool):
    IIS AppPool\\[YourApplicationPool]
  3. Ensure that the application pool has the following permissions: Read, Write, Modify, Read & Execute, List Folder Contents

Note: You can also use the command line to allow access to the application pool, as shown in this example:

icacls "www" /grant "IIS APPPOOL\\DefaultAppPool":(OI)(M)

Step 3: Prevent application processes from unloading

IIS can close a web application for several reasons, including when an idle timeout is exceeded or when IIS deems that the application pool's resource use is too high. This action might halt background tasks from occurring in your application. Ensure that the application stays running by modifying the following settings:

  1. Enable the optional Application Initialization feature.
    • In Windows Server 2012 R2 and Windows Server 2016, open Server Manager and select Dashboard > Quick Start > Add Roles and Features to open the Add Roles and Features wizards. In the Server Roles step, select Web Server (IIS) > Web Server > Application Development > Application Initialization.
    • In Windows 8 and Windows 10, open the Control Panel and select Programs and Features > Turn Windows Features On or Off Then, select Internet Information Services > World Wide Web Services > Application Development Features > Application Initialization.
  2. On the Connections panel in IIS Manager, select Application Pools > YourApplicationPool > Advanced Settings. Then configure these settings:
    • Under the General settings, set Start Mode to AlwaysRunning.
    • Under the Process Model settings, set the Idle Timeout property to 0. If you use IIS 8, ensure that the Start Automatically property in the General settings is set to True.
    • Under the CPU section, set the LimitInterval property to 0.
    • Under the Recycling section, set the Regular Time Interval property to 0.
    • Under the Recycling section of the Generate Recycle Event Log Entry node, set Regular Time Interval to False.

Step 4: Configure ASP.NET app pool recycling

IIS recycles regularly so that it can clean up the ASP.NET app pool processes. You can schedule recycling during off-peak hours instead by navigating to the Recycling section and setting Specific Time to True. Then, enter the time (in the format hh:mm:ss) that you want recycling to start.

Step 5: Preloading applications

The IIS preloading feature improves performance by allowing the application to run before a user connects. To enable this feature, right-click the web application associated with Sync in the Connections pane and select Manage Application > Advanced Settings. In the PreloadEnabled menu, select True.

When PreloadEnabled is set to True, IIS simulates a user request to the default page of the website or virtual directory so that the application initializes.

Step 6: Confirm settings

To open the application and confirm your settings, navigate to http://127.0.0.1/YourPortNumber.

Optional Step: Configure SSL

If you require SSL for secure communications:

  • Configure SSL certificates in IIS to handle HTTPS requests.
  • Set up SSL termination at IIS, which means SSL requests will be decrypted at IIS and forwarded as HTTP to CData Sync, or configure SSL pass-through to forward encrypted requests directly.

Free Trial & More Information

Now that you have seen how to deploy CData Sync to Microsoft Internet Information Services (IIS), visit our CData Sync page to read more information about CData Sync and download a free trial. Start consolidating your enterprise data to a cloud data warehouse today! As always, our world-class Support Team is ready to answer any questions you may have.