ΓΫΆΉΚΣΖ΅

Dispatcher configurations manage-your-dispatcher-configurations

Learn how to deploy Dispatcher configuration files using Cloud Manager

Deploy Dispatcher configurations with Cloud Manager deploying-dispatcher-configurations

Cloud Manager is able to deploy web server and Dispatcher configuration files assuming they are stored in the Git repository alongside normal AEM content packages.

To take advantage of this capability, the Maven build should produce a .zip file, which contains at least two directories: conf and conf.d. This .zip file can be produced using the maven-assembly-plugin.

Projects generated by Cloud Manager using the built-in project creation wizard have the correct Maven project structure created automatically. This path is recommended if you are new to ΓΫΆΉΚΣΖ΅ Managed Services (AMS).

When you deploy to a Dispatcher instance, the directories on the instance are replaced with those directories from your Git repository. Because web server and Dispatcher configuration files often require environment-specific details, you must collaborate with your Customer Success Engineers (CSE) to set the appropriate environment variables in /etc/sysconfig/httpd before using this feature correctly.

Dispatcher configuration for existing managed service customers steps-for-configuring-dispatcher

Follow these steps below to complete the initial Dispatcher configuration.

  1. Obtain the current production configuration files from your CSE.
  2. Remove hard-coded environment-specific data such as publish renderer IP and replace with variables.
  3. Define required variables in key-value pairs for each target Dispatcher and request your CSE to add them to /etc/sysconfig/httpd on each instance.
  4. Test the updated configurations in your staging environment.
  5. Once tested, request your CSE to deploy to production.
  6. Commit the files to your Git repository.
  7. Deploy through Cloud Manager.
NOTE
Migrating Dispatcher and web server configurations to your Git repository may be done during Cloud Manager onboarding, but can also be done at a later point in time.

Example example

The specific file and directory structure may vary based on the specifics of your project, but this example should provide a concrete guide to how to structure your project to include Apache and Dispatcher configurations.

  1. Create a subdirectory named dispatcher.

    You may use any name here, but the directory name created in this step must be the same as the name used in step 6.

  2. This subdirectory contains a Maven module that builds the Dispatcher .zip file using the Maven Assembly plug-in. In the dispatcher directory, create a pom.xml file with this content, changing the parent reference, artifactId, and name as necessary.

    code language-xml
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
            <!-- reference to your parent pom -->
        </parent>
    
        <artifactId>dispatcher</artifactId> <!-- feel free to change this -->
        <packaging>pom</packaging>
        <name>dispatcher</name> <!-- feel free to change this -->
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.1.0</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals><goal>single</goal></goals>
                            <configuration>
                                <descriptors>
                                    <descriptor>assembly.xml</descriptor>
                                </descriptors>
                                <appendAssemblyId>false</appendAssemblyId>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>
    
    • As in Step 1, the artifactId and name here can be other values if you want. dispatcher is used here just an example.
  3. The Maven Assembly plug-in requires a descriptor to define how the .zip file is created. To create this descriptor, create a file in the dispatcher subdirectory named assembly.xml with the following content. Note that this file name is referenced on line 26 in the pom.xml file above.

    code language-xml
    <assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
      <id>distribution</id>
      <formats>
        <format>zip</format>
      </formats>
      <includeBaseDirectory>false</includeBaseDirectory>
      <fileSets>
        <fileSet>
          <directory>${basedir}/src</directory>
          <includes>
            <include>**/*</include>
          </includes>
          <outputDirectory></outputDirectory>
        </fileSet>
      </fileSets>
    </assembly>
    
  4. Create a subdirectory named src (as referenced in the assembly descriptor above on line 11) inside the Dispatcher subdirectory to store the actual Apache and Dispatcher configurations. Within this src directory, create directories named conf, conf.d, conf.dispatcher.d, and conf.modules.d.

  5. Populate the conf, conf.d, conf.dispatcher.d, and conf.modules.d directories with your configuration files. For example, the default configuration consists of these files and symbolic links.

    code language-none
    dispatcher
    β”œβ”€β”€ assembly.xml
    β”œβ”€β”€ pom.xml
    └── src
        β”œβ”€β”€ conf
        β”‚  β”œβ”€β”€ httpd.conf
        β”‚  └── magic
        β”œβ”€β”€ conf.d
        β”‚  β”œβ”€β”€ README
        β”‚  β”œβ”€β”€ autoindex.conf
        β”‚  β”œβ”€β”€ available_vhosts
        β”‚  β”‚  β”œβ”€β”€ aem_author.vhost
        β”‚  β”‚  β”œβ”€β”€ aem_flush.vhost
        β”‚  β”‚  β”œβ”€β”€ aem_health.vhost
        β”‚  β”‚  β”œβ”€β”€ aem_lc.vhost
        β”‚  β”‚  └── aem_publish.vhost
        β”‚  β”œβ”€β”€ dispatcher_vhost.conf
        β”‚  β”œβ”€β”€ enabled_vhosts
        β”‚  β”‚  β”œβ”€β”€ aem_author.vhost -> ../available_vhosts/aem_author.vhost
        β”‚  β”‚  β”œβ”€β”€ aem_flush.vhost -> ../available_vhosts/aem_flush.vhost
        β”‚  β”‚  └── aem_publish.vhost -> ../available_vhosts/aem_publish.vhost
        β”‚  β”œβ”€β”€ rewrites
        β”‚  β”‚  β”œβ”€β”€ base_rewrite.rules
        β”‚  β”‚  └── xforwarded_forcessl_rewrite.rules
        β”‚  β”œβ”€β”€ userdir.conf
        β”‚  β”œβ”€β”€ variables
        β”‚  β”‚  └── ams_default.vars
        β”‚  β”œβ”€β”€ welcome.conf
        β”‚  └── whitelists
        β”‚      └── 000_base_whitelist.rules
        β”œβ”€β”€ conf.dispatcher.d
        β”‚  β”œβ”€β”€ available_farms
        β”‚  β”‚  β”œβ”€β”€ 000_ams_author_farm.any
        β”‚  β”‚  β”œβ”€β”€ 001_ams_lc_farm.any
        β”‚  β”‚  └── 999_ams_publish_farm.any
        β”‚  β”œβ”€β”€ cache
        β”‚  β”‚  β”œβ”€β”€ ams_author_cache.any
        β”‚  β”‚  β”œβ”€β”€ ams_author_invalidate_allowed.any
        β”‚  β”‚  β”œβ”€β”€ ams_publish_cache.any
        β”‚  β”‚  └── ams_publish_invalidate_allowed.any
        β”‚  β”œβ”€β”€ clientheaders
        β”‚  β”‚  β”œβ”€β”€ ams_author_clientheaders.any
        β”‚  β”‚  β”œβ”€β”€ ams_common_clientheaders.any
        β”‚  β”‚  β”œβ”€β”€ ams_lc_clientheaders.any
        β”‚  β”‚  └── ams_publish_clientheaders.any
        β”‚  β”œβ”€β”€ dispatcher.any
        β”‚  β”œβ”€β”€ enabled_farms
        β”‚  β”‚  β”œβ”€β”€ 000_ams_author_farm.any -> ../available_farms/000_ams_author_farm.any
        β”‚  β”‚  └── 999_ams_publish_farm.any -> ../available_farms/999_ams_publish_farm.any
        β”‚  β”œβ”€β”€ filters
        β”‚  β”‚  β”œβ”€β”€ ams_author_filters.any
        β”‚  β”‚  β”œβ”€β”€ ams_lc_filters.any
        β”‚  β”‚  └── ams_publish_filters.any
        β”‚  β”œβ”€β”€ renders
        β”‚  β”‚  β”œβ”€β”€ ams_author_renders.any
        β”‚  β”‚  β”œβ”€β”€ ams_lc_renders.any
        β”‚  β”‚  └── ams_publish_renders.any
        β”‚  └── vhosts
        β”‚      β”œβ”€β”€ ams_author_vhosts.any
        β”‚      β”œβ”€β”€ ams_lc_vhosts.any
        β”‚      └── ams_publish_vhosts.any
        └── conf.modules.d
            β”œβ”€β”€ 00-base.conf
            β”œβ”€β”€ 00-dav.conf
            β”œβ”€β”€ 00-lua.conf
            β”œβ”€β”€ 00-mpm.conf
            β”œβ”€β”€ 00-proxy.conf
            β”œβ”€β”€ 00-systemd.conf
            β”œβ”€β”€ 01-cgi.conf
            └── 02-dispatcher.conf
    
  6. Finally, in the pom.xml file in the root of your project, add a <module> element to include the Dispatcher module.

    For example, if your existing module list is the following:

    code language-xml
        <modules>
            <module>core</module>
            <module>ui.apps</module>
            <module>ui.content</module>
        </modules>
    

    Change it to the following:

    code language-xml
        <modules>
            <module>core</module>
            <module>ui.apps</module>
            <module>ui.content</module>
            <module>dispatcher</module>
        </modules>
    
    • As noted in step 1, the value of the <module> element must match the directory name created.
  7. To test, run mvn clean package in the project root directory. You should see lines like this in the output.

    code language-none
    [INFO] --- maven-assembly-plugin:3.1.0:single (default) @ dispatcher ---
    [INFO] Reading assembly descriptor: assembly.xml
    [INFO] Building zip: /Users/me/mycompany/dispatcher/target/dispatcher-1.0-SNAPSHOT.zip
    

    You can also unzip this file to view its contents.

    code language-shell
    $ unzip -l dispatcher/target/dispatcher-1.0-SNAPSHOT.zip
    Archive:  dispatcher/target/dispatcher-1.0-SNAPSHOT.zip
      Length      Date    Time    Name
    ---------  ---------- -----   ----
            0  09-12-2018 12:53   conf.modules.d/
            0  10-19-2018 10:38   conf.dispatcher.d/
            0  09-12-2018 12:53   conf.dispatcher.d/available_farms/
            0  09-12-2018 12:53   conf.dispatcher.d/filters/
            0  09-12-2018 12:53   conf.dispatcher.d/renders/
            0  09-12-2018 12:53   conf.dispatcher.d/cache/
            0  09-12-2018 12:53   conf.dispatcher.d/clientheaders/
            0  09-12-2018 12:53   conf.dispatcher.d/enabled_farms/
            0  09-12-2018 12:53   conf.dispatcher.d/vhosts/
            0  09-12-2018 12:53   conf.d/
            0  09-12-2018 12:53   conf.d/rewrites/
            0  09-12-2018 12:53   conf.d/whitelists/
            0  09-12-2018 12:53   conf.d/variables/
            0  11-01-2018 13:53   conf.d/enabled_vhosts/
            0  09-12-2018 12:53   conf.d/available_vhosts/
            0  09-12-2018 12:53   conf/
           88  09-12-2018 12:53   conf.modules.d/00-systemd.conf
         4913  09-12-2018 12:53   conf.dispatcher.d/available_farms/999_ams_publish_farm.any
          152  09-12-2018 12:53   conf.dispatcher.d/renders/ams_lc_renders.any
          490  09-12-2018 12:53   conf.dispatcher.d/clientheaders/ams_common_clientheaders.any
         1727  09-12-2018 12:53   conf.d/rewrites/base_rewrite.rules
           36  09-12-2018 12:53   conf.d/enabled_vhosts/aem_author.vhost
        11753  09-12-2018 12:53   conf/httpd.conf
          957  09-12-2018 12:53   conf.modules.d/00-proxy.conf
          944  09-12-2018 12:53   conf.dispatcher.d/available_farms/001_ams_lc_farm.any
          220  09-12-2018 12:53   conf.dispatcher.d/cache/ams_author_invalidate_allowed.any
           43  09-12-2018 12:53   conf.dispatcher.d/enabled_farms/999_ams_publish_farm.any
          516  09-12-2018 12:53   conf.d/welcome.conf
           37  09-12-2018 12:53   conf.d/enabled_vhosts/aem_publish.vhost
        13077  09-12-2018 12:53   conf/magic
           96  09-12-2018 12:53   conf.modules.d/02-dispatcher.conf
         2601  09-12-2018 12:53   conf.dispatcher.d/available_farms/000_ams_author_farm.any
          837  09-12-2018 12:53   conf.dispatcher.d/cache/ams_author_cache.any
           42  09-12-2018 12:53   conf.dispatcher.d/enabled_farms/000_ams_author_farm.any
         2926  09-12-2018 12:53   conf.d/autoindex.conf
         2555  09-12-2018 12:53   conf.d/available_vhosts/aem_lc.vhost
           41  09-12-2018 12:53   conf.modules.d/00-lua.conf
         2234  09-12-2018 12:53   conf.dispatcher.d/filters/ams_publish_filters.any
          220  09-12-2018 12:53   conf.dispatcher.d/cache/ams_publish_invalidate_allowed.any
          402  09-12-2018 12:53   conf.dispatcher.d/dispatcher.any
          573  09-12-2018 12:53   conf.d/whitelists/000_base_whitelist.rules
          871  09-12-2018 12:53   conf.d/available_vhosts/aem_flush.vhost
          139  09-12-2018 12:53   conf.modules.d/00-dav.conf
          742  09-12-2018 12:53   conf.dispatcher.d/filters/ams_author_filters.any
          557  09-12-2018 12:53   conf.dispatcher.d/cache/ams_publish_cache.any
          105  09-12-2018 12:53   conf.dispatcher.d/vhosts/ams_lc_vhosts.any
          101  09-12-2018 12:53   conf.dispatcher.d/vhosts/ams_publish_vhosts.any
         3582  09-12-2018 12:53   conf.d/dispatcher_vhost.conf
         2529  09-12-2018 12:53   conf.d/available_vhosts/aem_publish.vhost
          742  09-12-2018 12:53   conf.modules.d/00-mpm.conf
           88  09-12-2018 12:53   conf.dispatcher.d/filters/ams_lc_filters.any
          177  09-12-2018 12:53   conf.dispatcher.d/clientheaders/ams_lc_clientheaders.any
          366  09-12-2018 12:53   conf.d/README
         2723  09-12-2018 12:53   conf.d/available_vhosts/aem_author.vhost
         3739  09-12-2018 12:53   conf.modules.d/00-base.conf
          138  09-12-2018 12:53   conf.dispatcher.d/renders/ams_author_renders.any
           44  09-12-2018 12:53   conf.dispatcher.d/clientheaders/ams_publish_clientheaders.any
          112  09-12-2018 12:53   conf.dispatcher.d/vhosts/ams_author_vhosts.any
          580  09-12-2018 12:53   conf.d/variables/ams_default.vars
           35  09-12-2018 12:53   conf.d/enabled_vhosts/aem_flush.vhost
         1252  09-12-2018 12:53   conf.d/userdir.conf
          451  09-12-2018 12:53   conf.modules.d/01-cgi.conf
          321  09-12-2018 12:53   conf.dispatcher.d/renders/ams_publish_renders.any
          170  09-12-2018 12:53   conf.dispatcher.d/clientheaders/ams_author_clientheaders.any
          220  09-12-2018 12:53   conf.d/rewrites/xforwarded_forcessl_rewrite.rules
         1753  09-12-2018 12:53   conf.d/available_vhosts/aem_health.vhost
    ---------                     -------
        69017                     66 files
    
recommendation-more-help
c6cdc82b-cee9-48e0-a6ee-48149d5e72c3