6 Replies Latest reply on May 22, 2013 6:19 AM by PawanChillar

    Configure dispatcher on ubuntu

    PawanChillar

      Am not able to get dispatcher working on my Ubuntu machine, following is the error that I get after apache restart

       

      Syntax error on line 2 of /etc/apache2/conf.d/dispatcher.any:

      Invalid command '/farms', perhaps misspelled or defined by a module not included in the server configuration

      Action 'configtest' failed.

       

      Am using the default dispatcher.any file without any changes.

       

      I've enabled the dispatcher module as below:

       

       

      LoadModule dispatcher_module /usr/lib/apache2/modules/dispatcher-apache2.2-4.1.4.so

       

      <IfModule disp_apache2.c>

              # location of the configuration file. eg: 'conf/dispatcher.any'

              DispatcherConfig conf.d/dispatcher.any

       

              # location of the dispatcher log file. eg: 'logs/dispatcher.log'

              DispatcherLog    /var/log/apache2/dispatcher.log

       

              # log level for the dispatcher log

              # 0 Errors

              # 1 Warnings

              # 2 Infos

              # 3 Debug

              DispatcherLogLevel 3

       

              # if turned to 1, the dispatcher looks like a normal module

              DispatcherNoServerHeader 0

       

              # if turned to 1, request to / are not handled by the dispatcher

              # use the mod_alias then for the correct mapping

              DispatcherDeclineRoot 0

       

              # if turned to 1, the dispatcher uses the URL already processed

              # by handlers preceeding the dispatcher (i.e. mod_rewrite)

              # instead of the original one passed to the web server.

              DispatcherUseProcessedURL 0

       

              # if turned to 1, the dispatcher does not spool an error

              # response to the client (where the status code is greater

              # or equal than 400), but passes the status code to

              # Apache, which e.g. allows an ErrorDocument directive

              # to process such a status code.

              DispatcherPassError 0

      </IfModule>

       

      Can anyone please help me out in resolving the issue?

       

      Thanks,

      -- Pawan

        • 1. Re: Configure dispatcher on ubuntu
          Ove Lindström Level 4

          How does your dispatcher.any file look like?

          What is the encoding of that file?

          • 2. Re: Configure dispatcher on ubuntu
            PawanChillar Level 1

            Ove,

             

            The encoding is "text/plain; charset=us-ascii" and following is the content:

             

            # Each farm configures a set of load balanced renders (i.e. remote servers)

            /farms

              {

              # First farm entry

              /website

                { 

                # Request headers that should be forwarded to the remote server.

                /clientheaders

                  {

                  # Forward all request headers that are end-to-end. If you want

                  # to forward a specific set of headers, you'll have to list

                  # them here.

                  "*"

                  }

                 

                # Hostname globbing for farm selection (virtual domain addressing)

                /virtualhosts

                  {

                  # Entries will be compared against the "Host" request header

                  # and an optional request URL prefix.

                  #

                  # Examples:

                  #

                  #   www.company.com

                  #   intranet.*

                  #   myhost:8888/mysite

                  "*"

                  }

                 

                # 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 "8080"

                    # Connect timeout in milliseconds, 0 to wait indefinitely

                    # /timeout "0"

                    }

                  }

                 

                # The filter section defines the requests that should be handled by the dispatcher.

                # The globs will be compared against the request line, e.g. "GET /index.html HTTP/1.1".

                /filter

                  {

                  # Deny everything first and then 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

                   

                  # 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 "deny"  /glob "* /libs/shindig/proxy*" } # if you enable /libs close access to proxy

             

             

            #     /0026 { /type "allow" /glob "* /home/*"   }

            #     /0027 { /type "allow" /glob "* /tmp/*"    }

            #     /0028 { /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 "* *.ico *"   }  # enable icos

                  /0044 { /type "allow" /glob "* *.js *"    }  # enable javascript

                  /0045 { /type "allow" /glob "* *.png *"   }  # enable png

                  /0046 { /type "allow" /glob "* *.swf *"   }  # enable flash

                  /0047 { /type "allow" /glob "* *.jpg *"   }  # enable jpg

                  /0048 { /type "allow" /glob "* *.jpeg *"  }  # enable jpeg

             

             

                  # Enable features

                  /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*"  }

                  /0085 { /type "deny"  /glob "GET *.docview.xml*"  }

                 

                  /0086 { /type "deny"  /glob "GET *.*[0-9].json*" }

            #     /0087 { /type "allow" /glob "GET *.1.json*" }          # allow one-level json requests

             

             

                  # Deny query

                  /0090 { /type "deny"  /glob "* *.query.json*" }

                  }

             

             

                # The cache section regulates what responses will be cached and where.

                /cache

                  {

                  # The docroot must be equal to the document root of the webserver. The

                  # dispatcher will store files relative to this directory and subsequent

                  # requests may be "declined" by the dispatcher, allowing the webserver

                  # to deliver them just like static files.

                  /docroot "/opt/communique/dispatcher/cache"

             

             

                  # Sets the level upto which files named ".stat" will be created in the

                  # document root of the webserver. When an activation request for some

                  # page is received, only files within the same subtree are affected

                  # by the invalidation.

                  #/statfileslevel "0"

                 

                  # Flag indicating whether to cache responses to requests that contain

                  # authorization information.

                  #/allowAuthorized "0"

                 

                  # Flag indicating whether the dispatcher should serve stale content if

                  # no remote server is available.

                  #/serveStaleOnError "0"

                 

                  # The rules section defines what responses should be cached based on

                  # the requested URL. Please note that only the following requests can

                  # lead to cacheable responses:

                  #

                  # - HTTP method is GET

                  # - URL has an extension

                  # - Request has no query string

                  # - Request has no "Authorization" header (unless allowAuthorized is 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 "allow"

                      }

                    }

                   

                  # The invalidate section defines the pages that 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

                      {

                      # Consider all HTML files stale after an activation.

                      /glob "*.html"

                      /type "allow"

                      }

                    /0002

                      {

                      /glob "/etc/segmentation.segment.js"

                      /type "allow"

                      }

                    /0003

                      {

                      /glob "*/analytics.sitecatalyst.js"

                      /type "allow"

                      }

                    }

             

             

                  # The allowedClients section restricts the client IP addresses that are

                  # allowed to issue activation requests.

                  /allowedClients

                    {

                    # Uncomment the following to restrict activation requests to originate

                    # from "localhost" only.

                    #

                    #/0000

                    #  {

                    #  /glob "*"

                    #  /type "deny"

                    #  }

                    #/0001

                    #  {

                    #  /glob "127.0.0.1"

                    #  /type "allow"

                    #  }

                    }

                   

                  # The ignoreUrlParams section contains query string parameter names that

                  # should be ignored when determining whether some request's output can be

                  # cached or delivered from cache.

                  #

                  # In this example configuration, the "q" parameter will be ignored.

                  #/ignoreUrlParams

                  #  {

                  #  /0001 { /glob "*" /type "deny" }

                  #  /0002 { /glob "q" /type "allow" }

                  #  }

                 

                  }

                 

                # The statistics sections dictates how the load should be balanced among the

                # renders according to the media-type.

                /statistics

                  {

                  /categories

                    {

                    /html

                      {

                      /glob "*.html"

                      }

                    /others

                      {

                      /glob "*"

                      }

                    }

                  }

                }

              }

            • 3. Re: Configure dispatcher on ubuntu
              Kristian Wright Level 1

              Ensure that all your { and  } match up, as this will cause issues otherwise.

              • 4. Re: Configure dispatcher on ubuntu
                PawanChillar Level 1

                KWright, the curly braces are matching properly. Anything else that you might cause the issue?

                • 5. Re: Configure dispatcher on ubuntu
                  Kristian Wright Level 1

                  Yes, I just re-read that you're using the default dispatcher.any.

                   

                  The only difference I see in your  apache conf file settings compared to mine is that I'm using the default 'suggested' settings for the location of the dispatcher.any and log files:

                   

                  # location of the configuration file. eg: 'conf/dispatcher.any'

                  DispatcherConfig     conf/dispatcher.any

                   

                  # location of the dispatcher log file. eg: 'logs/dispatcher.log'

                  DispatcherLog          logs/dispatcher.log

                   

                   

                  Apart from that, I don't see anything different to what I'm running.

                   

                  K

                  • 6. Re: Configure dispatcher on ubuntu
                    PawanChillar Level 1

                    KWright,

                     

                    I changed the location of dispatcher.any and log file and it seemed to work It's weird!!!

                     

                    Thanks for your time mate!