8 Replies Latest reply on Sep 6, 2006 3:36 PM by Andrew Boyd

    Apache workers.properties help please.

    Andrew Boyd Novice

      Hi All,
      I'm using JBoss portal 2.4.0 final and Apache/2.0.52 (Red Hat) Server.

      I followed the instructions found in the wiki http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss

      as best as I could for my single server but I'm getting a 404 error when trying to access /web-console and /jmx-console. Here is my workers.properties:

      # Define list of workers that will be used
      # for mapping requests
      # The configuration directives are valid
      # for the mod_jk version 1.2.18
      #
      #worker.list=loadbalancer,status
      # since myDomain only has one server at this time
      worker.list=node1
      
      # Define Node1
      # modify the host as your host IP or DNS name.
      worker.node1.port=8009
      worker.node1.host=node1.myDomain.com
      worker.node1.type=ajp13
      worker.node1.lbfactor=1
      # worker.node1.connection_pool_size=10 (1)
      
      # since myDomain only has one server at this time comment out node2
      # Define Node2
      # modify the host as your host IP or DNS name.
      #worker.node2.port=8009
      #worker.node2.host= node2.myDomain.com
      #worker.node2.type=ajp13
      #worker.node2.lbfactor=1
      # worker.node1.connection_pool_size=10 (1)
      
      # Load-balancing behaviour
      worker.loadbalancer.type=lb
      #worker.loadbalancer.balance_workers=node1,node2
      worker.loadbalancer.balance_workers=node1
      
      # Status worker for managing load balancer
      #worker.status.type=status
      


      I replaced my real domain with myDomain just in this posting.

      I also commented out node2 from the wiki example since I only have one server. I also commented out the worker.status.type=status.

      I have installed mod_jk version 1.2.18
      rpm -Uvh mod_jk-1.2.18-1.rhel4.bjd.i386.rpm
      



      My uriworkermap.properties file is straight from the wiki:
      # Simple worker configuration file
      #
      
      # Mount the Servlet context to the ajp13 worker
      /jmx-console=loadbalancer
      /jmx-console/*=loadbalancer
      /web-console=loadbalancer
      /web-console/*=loadbalancer
      


      I added jvmRoute to my JBOSS_HOME/server/inetMillionaire/deploy/jbossweb-tomcat55.sar/server.xml

      <Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1">
      


      and I made sure that the jbossweb-tomcat55.sar/META-INF/jboss-service.xml is set to use JK
      <attribute name="UseJK">true</attribute>
      


      Anyone see what I've done wrong?

      Thanks in advance,

      Andrew

        • 1. Re: Apache workers.properties help please.
          Andrew Boyd Novice

          Its still not working but a little bit of sleep has helped me see at least one mistake.

          I did not have the loadbalancer in my worker.list but I referenced it in my uirworkermap.properties

          so now my workers.properties looks like:


          worker.list=loadbalancer,status
          
          
          # Define Node1
          # modify the host as your host IP or DNS name.
          worker.node1.port=8009
          worker.node1.host=node1.howibecameaninternetmillionaire.com
          worker.node1.type=ajp13
          worker.node1.lbfactor=1
          # worker.node1.connection_pool_size=10 (1)
          
          # since inetMillionaire only has one server at this time comment out node2
          # Define Node2
          # modify the host as your host IP or DNS name.
          #worker.node2.port=8009
          #worker.node2.host= node2.howibecameaninternetmillionaire.com
          #worker.node2.type=ajp13
          #worker.node2.lbfactor=1
          # worker.node1.connection_pool_size=10 (1)
          
          # Load-balancing behaviour
          worker.loadbalancer.type=lb
          #worker.loadbalancer.balance_workers=node1,node2
          worker.loadbalancer.balance_workers=node1
          
          # Status worker for managing load balancer
          worker.status.type=status
          


          Any ideas?

          Thanks,

          Andrew

          • 2. Re: Apache workers.properties help please.
            Andrew Boyd Novice

            I was looking at my mod-jk.conf:

            # Load mod_jk module
            # Specify the filename of the mod_jk lib
            LoadModule jk_module modules/mod_jk.so
            
            # Where to find workers.properties
            JkWorkersFile conf/workers.properties
            
            # Where to put jk logs
            JkLogFile logs/mod_jk.log
            
            # Set the jk log level [debug/error/info]
            JkLogLevel info
            
            # Select the log format
            JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
            
            # JkOptions indicates to send SSK KEY SIZE
            JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
            
            # JkRequestLogFormat
            JkRequestLogFormat "%w %V %T"
            
            # Mount your applications
            JkMount /application/* loadbalancer
            
            # You can use external file for mount points.
            # It will be checked for updates each 60 seconds.
            # The format of the file is: /url=worker
            # /examples/*=loadbalancer
            JkMountFile conf/uriworkermap.properties
            
            # Add shared memory.
            # This directive is present with 1.2.10 and
            # later versions of mod_jk, and is needed for
            # for load balancing to work properly
            JkShmFile logs/jk.shm
            
            # Add jkstatus for managing runtime data
            <Location /jkstatus/>
            JkMount status
            Order deny,allow
            Deny from all
            Allow from 127.0.0.1
            </Location>
            


            This line looks like it is not correct:
            # Mount your applications
            JkMount /application/* loadbalancer
            


            I don't have a /application/ directory does anyone know if this is wrong or what I should have this set to?

            Thanks,

            Andrew

            • 3. Re: Apache workers.properties help please.
              mike golan Newbie


              change this line

              
              worker.node1.host=node1.howibecameaninternetmillionaire.com
              
              


              to
              
              worker.node1.host=howibecameaninternetmillionaire.com
              
              


              i am not sure but before 2 weeks i make the same configuration and it works


              • 4. Re: Apache workers.properties help please.
                Andrew Boyd Novice

                Thanks for the reply golanbln. I tried your suggestion but still no luck.

                • 5. Re: Apache workers.properties help please.
                  Andrew Boyd Novice

                  Ok I checked out the Apache error.log and saw:

                  File does not exist: /var/www/html/web-console

                  The /var/www/html is set as my document root.

                  I just tried to set my JBOSS_HOME/server/myServer/deploy as DocumentRoot. It did not work. But I think we're getting closer.

                  The error log says:
                  File does not exist: /srv/website/mySite/app-server/jboss-portal/server/myServer/deploy/web-console

                  Do I need to set the document root to something or am I going down the wrong path?

                  Any suggestions?

                  Thanks,

                  Andrew

                  • 6. Re: Apache workers.properties help please.
                    Brian Stansberry Master

                    Did you do Step #3 from http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss ?

                    The "File does not exist" log sounds like it's not picking up that web-console is handled by mod_jk. Your uriworkersmap.properties looks OK, as does the mod-jk.conf, so I wonder if it's just Step #3 missing.

                    • 7. Re: Apache workers.properties help please.
                      Andrew Boyd Novice

                      Thanks Bstansberry!

                      Its not totaly working but missing Step #3 (the smallest step) seems to be what my road block was. Now I'm getting

                      "The server encountered an internal error or misconfiguration and was unable to complete your request."

                      thanks again,

                      Andrew

                      • 8. Re: Apache workers.properties help please.
                        Andrew Boyd Novice

                        Thanks to Bstansberry for pointing out I missed step #3.

                        I put the Document Root back to what it was and I followed the advice of golanbln and removed the node1 from worker.node1.host=node1....

                        And I can now get to the web-console.

                        Thanks everyone!

                        Andrew