6 Replies Latest reply on May 13, 2011 2:19 AM by nimo22

    JBoss AS 6 with Apache-WebServer or Jboss-WebServer

    nimo22

      Hello,

       

      I am using Jboss AS 6 (which includes Tomcat).

       

      I have the following questions:

       

      1. In production mode, should I use a typical WebServer in front of Jboss AS?

      (I do not have a lot of static files/pages. I am using JSF, so these files, I guess, are all served dynamically.)

       

       

      2. Should I connect Jboss AS either with Jboss-WebServer or with Apache-WebServer (via AJP).

      Does it matters?

      Both Jboss AS and Jboss WebServer include Tomcat, hence I guess, it is better to use Jboss AS with Apache WebServer. Am I right?

       

       

      3. I have already built and linked the native APR Connector in a standalone Tomcat-Distribution (without jboss as), which worked fine.

      However, when using Jboss AS, then it is sufficient to put the jboss-native (http://www.jboss.org/jbossweb/downloads/jboss-native-2-0-9.html) in Jboss-Home-Directory as suggested here http://community.jboss.org/thread/2147. Am I right?

        • 1. JBoss AS 6 with Apache-WebServer or Jboss-WebServer
          peterj

          3: Yes.

           

          1 & 2:

           

          JBoss AS provides a full web server stack, so you don't need anything in front of it. It will happily server static content (html, css, gif,etc) as well as dynamic content (JSF, JSP, etc).

           

          JBoss Web Server is a variation fo Tomcat. It is not a variation of Apache Web Server (aka HTTPD).

           

          Some of the reasons for placing HTTPD in front of JBoss AS include:

           

          a) You have a lot of static content and you want to serve out of HTTPD. (HTTPD could be run on the same or a different system from JBoss AS)

           

          b) You need to run multiple instance of JBoss AS to handle the load and thus use HTTPD to do load-balancing. (HTTPD and each JBoss AS instance are run on their own systems.)

           

          c) You want to access JBoss AS via ports 80 & 443 on Linux, so you set of HTTPD to handle those ports and redirect to JBoss AS. (Usually HTTPD and JBoss AS are on the same system, but they could be different.)

          • 2. Re: JBoss AS 6 with Apache-WebServer or Jboss-WebServer
            nimo22

            Hello Peter,

             

            thank you for helping. I have a a few questions about the relations of Jboss AS, HTTPD and Tomcat?

             

            Question 1:


            {quote}JBoss Web Server is a variation fo Tomcat. It is not a variation of Apache Web Server (aka HTTPD).{quote}

             

            Jboss Web Server has a "Native module API" handling PHP, .NET or the like.

            Does Jboss AS (or its variation of its embeeded Tomcat) also has a "Native Module API" ? If not, the only way is to set up a HTTPD in front of a JBOSS AS instance, am I right?

             

            Question 2:

             

            There are different Tomcat-Distributions (Core, Deployer, Embedded). Jboss As embeeds the "Embeeded-Tomcat-Distribution", am I right?

             

            Question 3:

             

            When using Tomcat with HTTPD, then Tomcat does not act as a WebServer but only as a JSP/Servlet container.

            But when using Tomcat with JBOSS AS, then Tomcat acts both as a WebServer and as a JSP/Servlet container, hence JBoss AS does not act as a WebServer but its embedded Tomcat does, am I right?

             

            Question 4:

             

            Tomcat does not startup by default with security enabled, you need to add the -security option to the startup script. Does the embeeded Tomcat start with -security option (catalina.sh start -security is triggerd by using jboss.sh start -security)?

             

            Question 5:


            By default, persistent sessions is not configured in Tomcat. Does Jboss AS handles the persistent sessions by delegating it to its web container? So I can use the related settings provided by Jboss AS instead of the the tomcat-specific-settings, am I right?

             

            Question 6:

             

            Tomcat has a lot of configurations. Does it makes sense to use the tomcat-specific settings or should I always go the indirection by using the settings provided by jboss (server.xml, Valves, Realms, etc) ? Are there 100% congruent?

            Are there settings of tomcat which cannot be set in Jboss setting-files?

             

            Question 7:

             

            Clustering (or Load Balancing for High Availability) in Jboss AS enables a set of Jboss instances to appear to users a single server. If I want to use Clustering (via Apache mod_proxy or mod_jk as a load balancer) or to provide Interoperability, the best practice will to use HTTPD in front of Jboss AS instances. Am I right?

             

            For AJP, should Jboss AS be integrated with Apache (with its mod_jk or mod_proxy) by using JK Connector? So the settings are the same as I would do a connection with Tomcat-Instances and HTTPD, am I right?

             

            I have red about the Jboss-Bitnami-Native-Stack (http://bitnami.org/stack/jboss). It includes Apache, JBoss, MySQL and Java with its required dependencies. Did you hear about it ? Should I go for that?

            • 3. Re: JBoss AS 6 with Apache-WebServer or Jboss-WebServer
              peterj

              1) Check out JBoss Native - that applies the native module to JBoss AS. JBoss Native has an option PHP component. See these threads:

              http://community.jboss.org/thread/80067?tstart=0

              http://community.jboss.org/message/248194#248194

              http://community.jboss.org/message/426266

               

              2) I think so.

               

              3) I do nor entirely agree with your statements. Tomcat, and JBoss Web Server, can ahdle all web content, bot hstatic and dynamic, regardless of whether HTTPD is used as a front end. And yes, JBoss Web Server is used by JBoss AS as the web servicer.

               

              4) No, security is handled entirely differently. See http://community.jboss.org/wiki/SecureJBoss

               

              5) I don't know. Try looking for this in the docs.

               

              6) Typcially, all Tomcat configuration works as-is with the stand-alone JBoss Web Server. However, only some of the Tomcat configuration settings work with the JBoss Web Server embeded within JBoss AS.

               

              7) Yes. I think so. Never heard of it.

              • 4. Re: JBoss AS 6 with Apache-WebServer or Jboss-WebServer
                nimo22

                Okay thank you!

                 

                So to sum up (please correct me, if I am wrong:) :

                 

                - Not Tomcat but Jboss Web Server (which is a variation of Tomcat) is integrated in Jboss AS.

                 

                - All Tomcat-Configuration or JbossWebServer-Configuration

                  can and should be indirectly set in Jboss AS via JbossAS-specific files and names.

                 

                The point, which I want to make clear is:

                 

                I do not have to learn the servers Tomcat or JbossWebServer, if I only want to use Jboss AS (which is a superset of all of these).

                 

                All the settings and configuration possibilities of the web-container

                can and should be set up by jbossAS related settings and configuration

                without the nomenclatur/files/definitions of Tomcat or JbossWebServer!

                 

                Looking, for example, in Geronimo Documentation (https://cwiki.apache.org/GMOxDOC30/configuring-the-web-container.html), it is really clear, what and how the integrated web container is integrated. But in Jboss AS Documentation, the Web Container is not explicitly mentioned!

                 

                Where can I find the JbossWebServer within the Jboss AS-Directory ?

                 

                Is this the right path: jboss-as\server\jbossweb-standalone\.. ?

                • 5. Re: JBoss AS 6 with Apache-WebServer or Jboss-WebServer
                  peterj


                  The directories under server are configurations (aka domains in other app servers). The jbossweb-standalone is a configuration that provides only a servlet container. There was similar configuration in 5.1.0 named 'web' that provided a servlet container and JCA connectors (so that you could deploy a data source), not sure why the data source deployment capabiulity was removed in 6.0.0, without the ability to deploy data sources the jbossweb-standalone configuration is pretty useless as far as I am concerned.

                   

                  Instead you want to look at two locations per configurtion (replace 'xxx' by the actual configuration name):

                  server/xxx/deploy/jbossweb.sar - this is the main portion of the embedded JBoss Web Server

                  server/xxx/deployers/jbossweb.deployer - this is the portion of the embedded JBoss Web Server that deployes WAR files

                   

                  The configuration files are spread out among those two locations.

                   

                  Also, even though you need to follow JBoss AS configuration procedures, in some cases those revert back to modifying configuration files (the global web.xml and server.xml) for which there is often detailed documentation only on the Tomcat site.

                  • 6. JBoss AS 6 with Apache-WebServer or Jboss-WebServer
                    nimo22

                    Okay, thank you !!