Important concepts before configuring your project's Dispatcher

Important concepts before configuring your project's Dispatcher

In the context of Adobe Experience Manager and Dispatcher, the conf.d and conf.dispatcher.d directories play different roles in configuring and customizing Dispatcher.

In the following repository, I generated an AEM archetype and defined some dispatcher configs: https://github.com/JenniferSantoss/aem-sample-project/tree/feature/dispatcher

conf.d:

conf.d/available_vhosts/default.vhost:

  • The available_vhosts directory is where *.vhost files are stored, and the enabled_vhosts directory is where you enable Virtual Hosts by symlinking a file in available_vhosts to the enabled_vhosts directory.
  • A vhost file is a configuration file used by web servers, such as Apache HTTP Server, to configure virtual host settings.
  • A virtual host is a configuration that allows a single web server to host multiple different websites or domains on a single physical server.
  • The vhost file contains configuration directives that specify how the web server should respond to requests for a given hostname or IP address. These directives include information such as the website's root directory, log file name, security settings, reverse proxy settings, and more.
  • Each virtual host can have its own vhost file, which allows different websites hosted on the same server to have specific configurations that are isolated from each other.
  • A ServerAlias is a configuration directive used in web servers, such as the Apache HTTP Server, to specify additional host names that should be associated with a specific virtual host. This directive is used to allow a single virtual host to respond to requests made by multiple host names.
  • Besides just having the default.vhost file with some default configuration, we can create a project specification vhost file with specific configurations. Check here: https://github.com/JenniferSantoss/aem-sample-project/blob/feature/dispatcher/sampleproject-dispatcher/src/conf.d/available_vhosts/sampleproject.vhost

conf.d/rewrites/rewrite.rules

conf.d/variables/custom.vars

conf.dispatcher.d:

  • The conf.dispatcher.d directory is used to store site or application specific configuration fragments.
  • It allows you to break your configuration into smaller, more manageable chunks, which can be useful in environments where multiple teams or sites share the same Dispatcher server.
  • Each configuration file placed in this directory is included in the overall Dispatcher configuration at runtime.
  • This allows you to customize the configuration for specific sites or for specific functionality without having to modify the global Dispatcher configuration.
  • The conf.dispatcher.d directory contains site or application specific configuration files, such as dispatcher.any, farm.any, cache.any, filter.any, and others.
  • Check here: https://github.com/JenniferSantoss/aem-sample-project/tree/feature/dispatcher/sampleproject-dispatcher/src/conf.dispatcher.d

conf.dispatcher.d/available_farms/default.farm:

  • The *.farm files are included in the conf.dispatcher.d/dispatcher.any file. These farm.any files exist to control the behavior of the module for each rendering or site type. The files are created in the available_farms directory and enabled with a symbolic link in the enabled_farms directory.
  • The available_farms folder within the conf.dispatcher.d directory in the context of AEM Dispatcher is used to store configuration files that define the so called "farms" available to Dispatcher. A farm in Dispatcher is a configuration that defines a set of rules for directing HTTP requests to specific backend servers.
  • These configuration files contain information about the backend servers, such as their IP addresses, ports, load balancing settings, security settings, etc. Each configuration file in the available_farms folder usually defines a specific farm.
  • These files are called available because Dispatcher does not necessarily use all of the farms defined in these files. Instead, the Dispatcher chooses which farm to use based on rules defined in its main configuration file, usually called dispatcher.any.
  • In this file, I included some custom configs that I created for my specific sample project example, such as clientheaders and virtualhosts: https://github.com/JenniferSantoss/aem-sample-project/blob/feature/dispatcher/sampleproject-dispatcher/src/conf.dispatcher.d/available_farms/sampleproject.farm

conf.dispatcher.d/filters/filters.any

  • The filters.any file within the conf.dispatcher.d/filters directory in the context of AEM Dispatcher is used to define the filtering settings that the Dispatcher will apply to the HTTP requests it receives. These filter settings help you control which requests are allowed or blocked, as well as make modifications to the requests or responses as needed.
  • The best practice is to deny everything on filters and then allow only what is necessary for your project.

conf.dispatcher.d/virtualhosts/virtualhosts.any

conf.dispatcher.d/cache/rules.any

  • The rules.any file inside the conf.dispatcher.d/cache directory is used to configure caching rules in Dispatcher, controlling which HTTP requests are cached, for how long, and how the cache should be managed and invalidated. This plays a key role in optimizing website performance and efficiently delivering content to end users.

conf.dispatcher.d/clientheaders/clientheaders.any

  • The clientheaders.any file is used to define settings related to the HTTP headers sent by clients to the Dispatcher, allowing you to control, filter, and manipulate these headers as needed to ensure proper application security, performance, and functionality.

conf.dispatcher.d/dispatcher.any

  • The dispatcher.any file inside the conf.dispatcher.d directory in AEM Dispatcher is the main configuration file for Dispatcher. It plays a crucial role in the configuration and functioning of Dispatcher, allowing you to control how HTTP requests are routed, managed, and delivered to the origin server.?
  • It's basically a file provided by the runtime environment and only included for illustration purposes and we should not edit this file.

Daniel Ribeiro de almeida

Adobe Experience Manager | Web Developer | Full-stack | Database

2 周

Genial

Wilson Cavalcante

Tech Lead | Analista de Sistemas | Desenvolvedor Full Stack | Arquitetura e Engenharia de Software | Plataforma Adobe EAP e AEM.

1 个月

??????

Salom?o da Silva Santos

Software Architect | Tech lead | Adobe Experience Manager (AEM) na Compass.UOL

1 个月

????

要查看或添加评论,请登录

Jennifer Santos的更多文章

社区洞察

其他会员也浏览了