7 Replies Latest reply on Aug 5, 2009 4:16 PM by Chris Lowe

    Building from source

    Chris Lowe Apprentice

      Hi Jean-Frederic,

      I'm trying to build mod_cluster native components from the sources. I have Fedora core 11 (x64).

      I've successfully built and installed httpd 2.2.22 to location /usr/local/apache2.

      However, I'm unable to build mod_cluster from the trunk (r2522):

      mkdir mod_cluster_build
      cd mod_cluster_build
      svn co http://anonsvn.jboss.org/repos/jbossnative/trunk/mod_cluster/ mod_cluster
      <snip />
      Checked out revision 2522.
      cd mod_cluster/native/advertise/
      sh buildconf
      Creating configure ...
      ./configure --with-apache=/usr/local/apache2
      configure: WARNING: unrecognized options: --with-apache
      checking for Apache httpd installation... configure: error: Please use --with-apxs=FILE


      From the error message I also tried this:

      ./configure --with-apache=/usr/local/apache2 --with-apxs=/home/hive/mod_cluster_build/apache/httpd-2.2.12/support/apxs
      configure: WARNING: unrecognized options: --with-apache
      checking for Apache httpd installation... APXS is /home/hive/mod_cluster_build/apache/httpd-2.2.12/support/apxs
      apxs_support is false
      configure: error: mod_cluster module need a valid apxs


      To validate apxs, I can run the following directly:

      /home/hive/mod_cluster_build/apache/httpd-2.2.12/support/apxs
      
      Usage: apxs -g [-S <var>=<val>] -n <modname>
       apxs -q [-S <var>=<val>] <query> ...
       apxs -c [-S <var>=<val>] [-o <dsofile>] [-D <name>[=<value>]]
       [-I <incdir>] [-L <libdir>] [-l <libname>] [-Wc,<flags>]
       [-Wl,<flags>] [-p] <files> ...
       apxs -i [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ...
       apxs -e [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ...
      


      Is there anything else I should be doing?

      PS - I'm not sure of the criteria for applying the AJP patch but I tried it anyway and it was rejected:

      pwd
      /home/hive/mod_cluster_build/apache/httpd-2.2.12/modules/proxy
      
       patch -p0 < /home/hive/mod_cluster_build/mod_cluster_build/mod_cluster/native/mod_proxy_cluster/mod_proxy_ajp.patch
      patching file mod_proxy_ajp.c
      Hunk #1 FAILED at 550.
      Hunk #2 FAILED at 607.
      Hunk #3 FAILED at 628.
      3 out of 3 hunks FAILED -- saving rejects to file mod_proxy_ajp.c.rej
      


        • 1. Re: Building from source
          Jean-Frederic Clere Master

          Oops the documentation in http://www.jboss.org/mod_cluster/native/building.html needs to be updated.

          ./configure --with-apxs=/home/hive/mod_cluster_build/apache/httpd-2.2.12/support/apxs
          Should work.

          What does the following do/
          /home/hive/mod_cluster_build/apache/httpd-2.2.12/support/apxs -q PREFIX

          • 2. Re: Building from source
            Chris Lowe Apprentice

            Thanks Jean-Frederic, I got this working using a reference to the installed version of apxs and not the version in my build path:

            ./configure --with-apxs=/usr/local/apache2/bin/apxs
            checking for Apache httpd installation... APXS is /usr/local/apache2/bin/apxs
            apxs_support is true
            configure: creating ./config.status
            config.status: creating Makefile


            Where the subsequent call to make works fine. There is a warning message though:

            libtool: install: warning: remember to run `libtool --finish /usr/local/apache2/modules'


            Is that something that needs to be done? If so, then it would be good to the required steps in the build instructions.

            Also, here's the output you requested (although I suspect it's probably no longer required now that I got the above working):
            /home/hive/mod_cluster_build/mod_cluster_build/mod_cluster/native/advertise: /home/hive/mod_cluster_build/apache/httpd-2.2.12/support/apxs -q PREFIX
            sh: /home/hive/mod_cluster_build/apache/httpd-2.2.12/: is a directory
            apxs:Error: Sorry, no shared object support for Apache.
            apxs:Error: available under your platform. Make sure.
            apxs:Error: the Apache module mod_so is compiled into.
            apxs:Error: your server binary `/home/hive/mod_cluster_build/apache/httpd-2.2.12/'..
            


            Cheers,

            Chris.

            • 3. Re: Building from source
              Jean-Frederic Clere Master

              You should ignore the libtool error message.
              I have update the doc it should be online soon.

              • 4. Re: Building from source
                Chris Lowe Apprentice

                Thanks for the updates, the native build docs look great.

                I've just picked this up again and I've been trying to build the Java component using Maven. It's throwing out the following error:

                mvn pom.xml
                [INFO] Scanning for projects...
                Downloading: http://repo1.maven.org/maven2/org/jboss/jboss-parent/4/jboss-parent-4.pom
                [INFO] Unable to find resource 'org.jboss:jboss-parent:pom:4' in repository central (http://repo1.maven.org/maven2)
                [INFO] ------------------------------------------------------------------------
                [ERROR] FATAL ERROR
                [INFO] ------------------------------------------------------------------------
                [INFO] Error building POM (may not be this project's POM).
                
                
                Project ID: org.jboss.native:mod-cluster:jar:1.0.2.GA-SNAPSHOT
                
                Reason: Cannot find parent: org.jboss:jboss-parent for project: org.jboss.native:mod-cluster:jar:1.0.2.GA-SNAPSHOT for project org.jboss.native:mod-cluster:jar:1.0.2.GA-SNAPSHOT
                


                Is there anything I need to tweak before running Maven? BTW, I'm using Open JDK 6 and Maven 2.2.0.

                Cheers,

                Chris.

                • 5. Re: Building from source
                  Paul Ferraro Master

                  Add the following repository to your maven settings.xml:


                  repository.jboss.org
                  http://repository.jboss.org/maven2

                  true


                  false

                  • 6. Re: Building from source
                    Paul Ferraro Master

                    eh - that's what I get for using the "Instant reply"...
                    Here's that post again:

                    Add the following repository to your maven settings.xml:

                    <repository>
                     <id>repository.jboss.org</id>
                     <url>http://repository.jboss.org/maven2</url>
                     <releases>
                     <enabled>true</enabled>
                     </releases>
                     <snapshots>
                     <enabled>false</enabled>
                     </snapshots>
                    </repository>


                    • 7. Re: Building from source
                      Chris Lowe Apprentice

                      Thanks Paul, I used your recommendation in a local settings file:

                      cat ~/.m2/settings.xml
                      
                      <settings>
                       <profiles>
                       <profile>
                       <id>standard-extra-repos</id>
                       <activation>
                       <activeByDefault>true</activeByDefault>
                       </activation>
                       <repositories>
                       <repository>
                       <id>repository.jboss.org</id>
                       <url>http://repository.jboss.org/maven2</url>
                       <releases>
                       <enabled>true</enabled>
                       </releases>
                       <snapshots>
                       <enabled>false</enabled>
                       </snapshots>
                       </repository>
                       </repositories>
                       </profile>
                       </profiles>
                      </settings>


                      It took me a while to figure out how to get Maven to build the required mod_cluster.sar, but I eventually got a build to succeed using the following:

                      mvn package -Dmaven.test.skip=true


                      I had to skip the tests because I was running this on a system that didn't support multicast which was causing some of the tests to fail and consequently prevented the build from completing.

                      Cheers,

                      Chris.