Hi Sir,
I have configured dispatcher server, flash agent on publish is fine as well.
page on publish server is fine: http://x.x.x.x:4503/content/geometrixx/zh/support.html
but failed to access page on dispatcher server: http://x.x.x.x/content/geometrixx/zh/support.html
it gets error "Already forwarded by dispatcher (x.x.x.x), declined." in log file, and no cache file is created. anyone can give me some advice?
detail error in log:Found farm website for x.x.x.x
checking [/content/geometrixx/zh/support.html]
Cache rule entry /0000 allowed '/content/geometrixx/zh/support.html'
cachefile does not exist: /usr/local/httpd/htdocs/content/geometrixx/zh/support.html
try to create new cachefile: /usr/local/httpd/htdocs/content/geometrixx/zh/support.html
cache-action for [/content/geometrixx/zh/support.html]: CREATE
Filter rule entry /0023 allowed 'GET /content/geometrixx/zh/support.html HTTP/1.1'
Dropping socket after 170 seconds of inactivity: x.x.x.x:80
Creating new socket: x.x.x.x:80
Connected to backend rend01 (x.x.x.x:80)
request.uri = "/content/geometrixx/zh/support.html"
request.headers[Host] = "x.x.x.x"
request.headers[Cache-Control] = "max-age=0"
request.headers[User-Agent] = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"
request.headers[Upgrade-Insecure-Requests] = "1"
request.headers[Accept] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
request.headers[Accept-Encoding] = "gzip, deflate"
request.headers[Accept-Language] = "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
request.headers[Via] = "1.1 x.x.x.x (dispatcher)"
request.headers[X-Forwarded-For] = "122.225.226.181"
request.headers[Server-Agent] = "Communique-Dispatcher"
Already forwarded by dispatcher (x.x.x.x), declined.
"GET /content/geometrixx/zh/support.html" - - 0ms [-/-]
response.status = 404
response.headers[Date] = "Tue, 30 Jan 2018 08:38:45 GMT"
response.headers[Content-Length] = "232"
response.headers[Content-Type] = "text/html; charset=iso-8859-1"
Storing socket for later reuse: x.x.x.x:80
"GET /content/geometrixx/zh/support.html" 404 232 2ms [website/rend01]
Solved! Go to Solution.
In the dispatcher.any you need to specify the AEM instance in the /rend01 section, not your webserver/dispatcher. That's the easiest way to create this loop the dispatcher is complaining about :-)
Jörg
We asked our Dispatcher expert to look at this.
Views
Replies
Total Likes
What version of the dispatcher are you using? It looks to me that you ran into a limitation which tried to prevent daisy-chaining dispatcher instances, but has been removed lately.
Jörg
Views
Replies
Total Likes
Hi Jörg,
Thanks for your response!
I'm using the version 4.2.3 for dispatcher and the Apache version is 2.4.29.
Files:
dispatcher-apache2.4-4.2.3.so
httpd-2.4.29.tar
Views
Replies
Total Likes
The problem is this:
request.headers[Via] = "1.1 x.x.x.x (dispatcher)"
...
Already forwarded by dispatcher (x.x.x.x), declined.
The dispatcher thinks that it already had processed this request (and added a Via header), and this request is again routed through the same dispatcher instance; this means that the dispatcher detected a loop (or at least it think it does).
Can you verify that? Otherwise it would be great if you anonymize your IP addresses and server names a bit, but not just XXX'ing them :-)
Jörg
Views
Replies
Total Likes
Hi Jörg,
This is the first time I install and config Apache/dispatcher server. not sure where my problem is. hence I pasted my configuration files (httpd.conf and dispatcher.any), could you help review it?
All of the ips replaced in log and below configuration files are 10.x.x.186 server.(I hid two number of them here)
BTW, I can view the home page on Apache server normally, it displays "It works!"
httpd.conf
ServerRoot "/usr/local/httpd"
Listen 80
LoadModule dispatcher_module modules/mod_dispatcher.so
<IfModule disp_apache2.c>
DispatcherConfig conf/dispatcher.any
DispatcherLog logs/dispatcher.log
DispatcherLogLevel trace
DispatcherDeclineRoot Off
DispatcherUseProcessedURL Off
DispatcherPassError 0
DispatcherKeepAliveTimeout 60
</IfModule>
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule filter_module modules/mod_filter.so
LoadModule mime_module modules/mod_mime.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
<IfModule unixd_module>
User daemon
Group daemon
</IfModule>
ServerAdmin you@example.com
ServerName 10.x.x.186 #it is true ip on my server, here I hid two number of them
<Directory />
AllowOverride None
Require all denied
</Directory>
DocumentRoot "/usr/local/httpd/htdocs"
<Directory />
<IfModule disp_apache2.c>
ModMimeUsePathInfo On
SetHandler dispatcher-handler
</IfModule>
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/usr/local/httpd/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Require all granted
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access_log" common
</IfModule>
<IfModule alias_module>
Alias /manual /usr/local/httpd/manual
<Directory "/usr/local/httpd/manual">
Order allow,deny
Allow from all
</Directory>
Redirect permanent /test https://www.baidu.com
ScriptAlias /cgi-bin/ "/usr/local/httpd/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "/usr/local/httpd/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule headers_module>
RequestHeader unset Proxy early
</IfModule>
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
<IfModule proxy_html_module>
Include conf/extra/proxy-html.conf
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
dispatcher.any
/farms
{
/website
{
/clientheaders
{
"*"
}
/virtualhosts
{
"*"
}
/renders
{
/rend01
{
/hostname "10.x.x.186" #hid two number in this post, I have true ip is on my server
/port "80"
}
}
/filter
{
/0001 { /type "deny" /glob "*" }
/0041
{
/type "allow"
/extension '(clientlibs|css|gif|ico|js|png|swf|jpe?g|woff2?)'
}
/0081
{
/type "deny"
/selectors '((sys|doc)view|query|[0-9-]+)'
/extension '(json|xml)'
}
/0082
{
/type "deny"
/path "/content"
/selectors '(feed|rss|pages|languages|blueprint|infinity|tidy)'
/extension '(json|xml|html)'
}
}
/cache
{
/docroot "/usr/local/httpd/htdocs"
/rules
{
/0000
{
/glob "*"
/type "allow"
}
}
/invalidate
{
/0000
{
/glob "*"
/type "deny"
}
/0001
{
/glob "*.html"
/type "allow"
}
/0002
{
/glob "/etc/segmentation.segment.js"
/type "allow"
}
/0003
{
/glob "*/analytics.sitecatalyst.js"
/type "allow"
}
}
/allowedClients
{
}
}
/statistics
{
/categories
{
/html
{
/glob "*.html"
}
/others
{
/glob "*"
}
}
}
}
}
Views
Replies
Total Likes
In the dispatcher.any you need to specify the AEM instance in the /rend01 section, not your webserver/dispatcher. That's the easiest way to create this loop the dispatcher is complaining about :-)
Jörg
It works ! Thank you Jörg!
Everything goes well now.
Views
Replies
Total Likes