Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

AEM 6 : Dispatcher configuration issue with domain mapping

Avatar

Level 4

Hi,

I have made an entry for a domain myapp.com in httpd.conf like this :

<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName myapp.com DocumentRoot "C:/Apache2.2/htdocs" <Directory "C:/Apache2.2/htdocs"> Options FollowSymLinks AllowOverride None </Directory> RewriteEngine On RewriteRule ^/$ /content/myuhc/en/myuhc-login-page.html [PT,L] RewriteCond %{REQUEST_URI} ^/content RewriteCond %{REQUEST_URI} !^/content/campaigns RewriteCond %{REQUEST_URI} !^/content/dam RewriteRule !^/content/myuhc/en/myuhc-login-page - [R=404,L,NC] RewriteCond %{REQUEST_URI} !^/apps RewriteCond %{REQUEST_URI} !^/bin RewriteCond %{REQUEST_URI} !^/content RewriteCond %{REQUEST_URI} !^/etc RewriteCond %{REQUEST_URI} !^/home RewriteCond %{REQUEST_URI} !^/libs RewriteCond %{REQUEST_URI} !^/tmp RewriteCond %{REQUEST_URI} !^/var RewriteRule ^/(.*)$ /content/myuhc/en/myuhc-login-page/$1 [PT,L] <IfModule disp_apache2.c> SetHandler dispatcher-handler </IfModule> </VirtualHost>

and I have configured dispatcher like this:

# name of the dispatcher /name "internet-server" # each farm configures a set off (loadbalanced) renders /farms { # first farm entry (label is not important, just for your convenience) /website { # client headers which should be passed through to the render instances # (feature supported since dispatcher build 2.6.3.5222) /clientheaders { * } # hostname globbing for farm selection (virtual domain addressing) /virtualhosts { # entries will be compared against the 'host' request header. # example: www.company.com # example: intranet.* #"www.myapp.com" } # the load will be balanced among these render instances /renders { /rend01 { # hostname or IP of the render /hostname "127.0.0.1" # port of the render /port "4503" # connect timeout in milliseconds, 0 to wait indefinitely /timeout "0" } } # only handle the requests in the following acl. default is 'none' # the glob pattern is matched against the first request line /filter { # deny everything and allow specific entries /0001 { /type "deny"  /glob "*" } # open consoles #     /0011 { /type "allow" /glob "* /admin/*"  }  # allow servlet engine admin #     /0012 { /type "allow" /glob "* /crx/*"    }  # allow content repository #     /0013 { /type "allow" /glob "* /system/*" }  # allow OSGi console /0014 { /type "allow" /glob "* /system/sling/login*" } # Allow sling logins # allow non-public content directories #     /0021 { /type "allow" /glob "* /apps/*"   }  # allow apps access /0022 { /type "allow" /glob "* /bin/*"    } /0023 { /type "allow" /glob "* /content*" }  # disable this rule to allow mapped content only #     /0024 { /type "allow" /glob "* /libs/*"   } #     /0025 { /type "allow" /glob "* /home/*"   } #     /0026 { /type "allow" /glob "* /tmp/*"    } #     /0027 { /type "allow" /glob "* /var/*"    } # enable specific mime types in non-public content directories /0041 { /type "allow" /glob "* *.css *"   }  # enable css /0042 { /type "allow" /glob "* *.gif *"   }  # enable gifs /0043 { /type "allow" /glob "* *.js *"    }  # enable javascript /0044 { /type "allow" /glob "* *.png *"   }  # enable png /0045 { /type "allow" /glob "* *.swf *"   }  # enable flash /0046 { /type "allow" /glob "* *.svg *"   }  # enable svg /0047 { /type "allow" /glob "* *.woff*"  }  # enable woff /0048 { /type "allow" /glob "* *.eot *"   }  # enable eot /0049 { /type "allow" /glob "* *.ttf *"   }  # enable ttf /0050 { /type "allow" /glob "* *.otf *"   }  # enable otf /0051 { /type "allow" /glob "* *.jpg *"   }  # enable jpg /0052 { /type "allow" /glob "* *.ico *"   }  # enable icos # enable features /0061 { /type "allow" /glob "POST /content/[.]*.form.html" }  # allow POSTs to form selectors under content /0062 { /type "allow" /glob "* /libs/cq/personalization/*"  }  # enable personalization # deny content grabbing /0081 { /type "deny" /glob "GET *.infinity.json*" } /0082 { /type "deny" /glob "GET *.tidy.json*"     } /0083 { /type "deny" /glob "GET *.sysview.xml*"   } /0084 { /type "deny" /glob "GET *.docview.json*"  } } # allow propagation of replication posts (should seldomly be used) /propagateSyndPost "0" # the cache is used to store requests from the renders for faster delivery # for a second time. /cache { # the cacheroot must be equal to the document root of the webserver /docroot "C:/Apache2.2/htdocs" # sets the level upto which files named ".stat" will be created in the # document root of the webserver. when an activation request for some # handle is received, only files within the same subtree are affected # by the invalidation. /statfileslevel "0" # caches also authorized data /allowAuthorized "1" # the rules define, which pages should be cached. please note that # - only GET requests are cached # - only requests with an extension are cached # - only requests without query parameters ( ? ) are cached # - only unauthorized pages are cached unless allowUnauthorized is set to 1 /rules { /0000 { # the globbing pattern to be compared against the url # example: *             -> everything #        : /foo/bar.*    -> only the /foo/bar documents #        : /foo/bar/*    -> all pages below /foo/bar #        : /foo/bar[./]* -> all pages below and /foo/bar itself #        : *.html        -> all .html files /glob "*" /type "deny" } } /ignoreUrlParams { /0001 { /glob "_alpsPartnerName" /type "deny" } /0002 { /glob "*" /type "allow" } } # the invalidate section defines those pages which are 'invalidated' after # any activation. please note that, the activated page itself and all # related documents are flushed on an modification. for example: if the # page /foo/bar is activated, all /foo/bar.* files are removed from the # cache. /invalidate { /0000 { /glob "*" /type "deny" } /0001 { /glob "*.html" /type "allow" } } } # the statistics define, how the load should be balanced among the renders # according to the media-type. /statistics { /categories { /html { /glob "*.html" } /others { /glob "*" } } } } }

When I hit the URL myapp.com and check the dispatcher.log file, this is the what I get in the logs:

[Thu Mar 12 00:34:54 2015] [D] [7692(824)] Found farm website for myapp.com
[Thu Mar 12 00:34:54 2015] [D] [7692(824)] checking [/]
[Thu Mar 12 00:34:54 2015] [D] [7692(824)] request URL has no extension: /
[Thu Mar 12 00:34:54 2015] [D] [7692(824)] cache-action for [/]: NONE
[Thu Mar 12 00:34:54 2015] [D] [7692(824)] Filter rejects: GET / HTTP/1.1
[Thu Mar 12 00:34:54 2015] [I] [7692(824)] "GET /" - - 1ms

And this is what I get on the browser :

Not Found

The requested URL /content/myuhc/en/myuhc-login-page.html was not found on this server.

I am not sure what is wrong.

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

can you try to directly accessing content/myuhc/en/myuhc-login-page.html via the browser and then post the trace of this request in the dispatcher logfile?

Jörg

View solution in original post

5 Replies

Avatar

Employee Advisor

Hi,

the log statements says it all:

Filter rejects: GET / HTTP/1.1

That's because you have a DENY statement on "*" (matches everything) as the only rule in your filter section. You should also some ALLOW statements so you requests get through.

kind regards,
Jörg

Avatar

Level 4

Thanks for the reply. However, I think there are a lot of Allow statements in the filter section. Deny is just the first line in filter section. After that there are a series of Allow statements. Anyway, are there any specific changes you want me to make to get this working.

Avatar

Employee Advisor

Hi,

my bad, saw only the "rules" section.

But there is no ALLOW rule matching "/", but only the DENY rule on "*" is matching for it. At least that's what the dispatcher is saying.

In the webserver config I wonder, what you want to achieve with this:

RewriteRule ^/$ /content/myuhc/en/myuhc-login-page.html [PT,L]

Instead of the PT I would send a plain redirect to the login to the browser.

kind regards,
Jörg

Avatar

Level 4

I referred this http://www.cognifide.com/blogs/cq/multidomain-cq-mappings-and-apache-configuration#.VP-psmSUc44 for the entries in Virtual Host. Regarding the entries in dispatcher, could you please suggest the entry that I should make ?

Thanks.

Avatar

Correct answer by
Employee Advisor

Hi,

can you try to directly accessing content/myuhc/en/myuhc-login-page.html via the browser and then post the trace of this request in the dispatcher logfile?

Jörg