Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

AEMaaCS + dispatcher enabled_host: does anyone know what is this file?

Avatar

Level 9

might be best explained with some terminal output (I'm using WSL since I can create links there)

 

in the screen dump below, myhost1 and myhost2 are existing domains that can be deployed (to all environments) without any problems since last Friday (The last dev deployment was something I started). myhost3.com is the new domain I'm trying to configure.

 

I'm wondering what sort of file is "enabled_host/myhost1.com.vhost". It's not a symlink and I can open it in a text editor (vi/nano).

 

$ pwd
/mnt/d/projects/mysite/dispatcher/src/conf.d/enabled_vhosts

$ ls -al
-rwxrwxrwx 1 myuser myuser   99 Jul 01 12:37 README
-rwxrwxrwx 1 myuser myuser   43 Jul 01 12:37 myhost1.com.vhost
-rwxrwxrwx 1 myuser myuser   43 Jul 01 12:37 myhost2.com.vhost
-rwxrwxrwx 1 myuser myuser   43 Jul 01 12:37 myhost3.com.vhost

$ ls -al ../available_vhosts/
total 28
drwxrwxrwx 1 myuser myuser 4096 Jul 15 16:20 .
drwxrwxrwx 1 myuser myuser 4096 Jul 12 12:37 ..
-rwxrwxrwx 1 myuser myuser 2325 Jul 12 12:37 default.vhost
-rwxrwxrwx 1 myuser myuser 5713 Jul 12 12:37 myhost1.com.vhost
-rwxrwxrwx 1 myuser myuser 5856 Jul 12 12:37 myhost2.com.vhost
-rwxrwxrwx 1 myuser myuser 5900 Jul 16 15:52 myhost3.com.vhost


$ cat myhost1.com.vhost
../available_vhosts/myhost1.com.vhost

 

I am implementing a new site and I followed the same patterns used on existing sites. I did not use symlinks since the existing sites does not use symlink (based on my terminal output above) and they are working fine.

When I deployed the my changes to dev  cluster, I got an error stating my new vhost in "enabled_host" is not a symlink. I know I can easily change it to symlink but (i'll be repeating myself here), the existing sites does not use symlinks.

 

Any ideas what's happening here?

 UPDATE: I removed "enabled_host/myhost3.com.vhost" and my deployment to dev is working fine again. It was originally failing in the "Build & Unit Testing" step.

1 Reply

Avatar

Community Advisor

Hi @jayv25585659 

In AEM Dispatcher configuration, it's recommended to use symbolic links (symlinks) to link .vhost files from the available_vhosts directory to the enabled_vhosts directory rather than copying the files directly. Here are the some reasons for this practice:

 

  1. Centralized Configuration: By keeping all virtual host configurations in the available_vhosts directory, you have a centralized location for managing your .vhost files. When changes are needed, you only update the files in one place.
  2. Avoids Duplication: Copying files can lead to inconsistencies, where different copies of the same .vhost file might become out of sync. Symlinks ensure that there is always a single source of truth for each virtual host configuration.
  3. Version Control Friendly: When using version control systems (e.g., Git), managing a single set of .vhost files in available_vhosts is more straightforward than dealing with duplicated files across multiple directories.



Arun Patidar