Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!
SOLVED

Issue setting up dispatcher vhosts on my local machine

Avatar

Level 4

I am running dispatcher using docker on my local. I am trying to serve weekend.com from port 4503. localhost:80 is already serving it, but when I tried to run it using weekend.com I am having issues. What I have done so far is as follows :

I have mapped my local IP to weekend.com and local.weekend.com

I have created a farm file named weekend.farm inside enabled farm. This farm references the weekend.vhost from conf.dispatcher.d/virtualhosts. It's content is "local.weekedn.com" "weekend.com".

 

Inside Conf.d I have create weekend.vhost inside available_vhosts. And the content looks like this :

 

# Include customer defined variables
Include conf.d/variables/custom.vars
 
<VirtualHost *:80>
ServerName "weekend.com"
# Put names of which domains are used for your published site/content here
ServerAlias "*.weekend.com"
# Use a document root that matches the one in conf.dispatcher.d/default.farm
DocumentRoot "${DOCROOT}"
# URI dereferencing algorithm is applied at Sling's level, do not decode parameters here
AllowEncodedSlashes NoDecode
# Add header breadcrumbs for help in troubleshooting
<IfModule mod_headers.c>
Header add X-Vhost "weekend-vhost"
</IfModule>
<Directory />
<IfModule disp_apache2.c>
# Some items cache with the wrong mime type
# Use this option to use the name to auto-detect mime types when cached improperly
ModMimeUsePathInfo On
# Use this option to avoid cache poisioning
# Sling will return /content/image.jpg as well as /content/image.jpg/ but apache can't search /content/image.jpg/ as a file
# Apache will treat that like a directory.  This assures the last slash is never stored in cache
DirectorySlash Off
# Enable the dispatcher file handler for apache to fetch files from AEM
SetHandler dispatcher-handler
</IfModule>
Options FollowSymLinks
AllowOverride None
# Insert filter
SetOutputFilter DEFLATE
# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Prevent clickjacking
Header always append X-Frame-Options SAMEORIGIN
</Directory>
<Directory "${DOCROOT}">
AllowOverride None
Require all granted
</Directory>
<IfModule disp_apache2.c>
# Enabled to allow rewrites to take affect and not be ignored by the dispatcher module
DispatcherUseProcessedURL On
# Default setting to allow all errors to come from the aem instance
DispatcherPassError 0
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
Include conf.d/rewrites/rewrite.rules
 
# Rewrite index page internally, pass through (PT)
RewriteRule "^(/?)$" "/index.html" [PT]
 
</IfModule>
</VirtualHost>
 
And this vhost file is included in enabled_vhosts/weekend.vhost 
 
I am getting these errors  when running the validator to generate out folder :
Cloud manager validator 2.0.62
2024/03/18 16:18:58 Dispatcher configuration validation failed:
2024/03/18 16:18:58 conf.dispatcher.d\available_farms\weekend.farm:9: file included at unknown location: /etc/httpd/conf.dispatcher.d/virtualhosts/weekend-virtualhosts.any
2024/03/18 16:18:58 skipping symlinks resolution checks for global folder due to windows platform
2024/03/18 16:18:58 please use a Linux/OS X environment to run locally or check results with a Cloud Manager pipeline

 

Attaching my dispatcher src folder for references.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Ankan_Ghosh ,

As it's a windows machine, it looks like an issue with symlink. Pls check the below article. Hope this will help .

 

https://medium.com/@arjunmat/local-aem-dispatcher-for-aem-as-a-cloud-service-in-windows-a59d5988838e

 

Thanks,

Somen

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @Ankan_Ghosh ,

As it's a windows machine, it looks like an issue with symlink. Pls check the below article. Hope this will help .

 

https://medium.com/@arjunmat/local-aem-dispatcher-for-aem-as-a-cloud-service-in-windows-a59d5988838e

 

Thanks,

Somen