5 Replies Latest reply on Oct 22, 2013 8:00 AM by ctomc

    What happened to Web - Servlet/HTTP - Virtual Servers in WildFly?

    mdeanda

      I was trying to setup a local instance of WildFly to see how much progress had been made from JBoss 7.x but I found that the Virtual Server options are nowhere to be found. Was that removed?

        • 1. Re: What happened to Web - Servlet/HTTP - Virtual Servers in WildFly?
          ctomc

          Hi,

           

          in WildFly we replaced internal web server from jbossweb to Undertow.

          you can read some more about that here http://undertow.io/blog/2013/07/09/Undertow-Beta1-Released.html

           

          As it goes for virtual hosts, we still support them just configuration syntax has changed a bit.

           

          for example this would configure two virtual hosts:

           

           

              <server name="default-server" default-host="localhost" servlet-container="blah">

                  <ajp-listener name="ajp-connector" socket-binding="ajp"/>

                  <http-listener name="default" socket-binding="http"/>

                  <https-listener name="https" socket-binding="https" security-realm="UndertowRealm" />

           

                  <host name="default-host" alias="localhost, some.host" default-web-module="something.war">

                      <location name="/" handler="welcome-content">

                          <filter-ref name="security-other"/>

                          <filter-ref name="connection-limit"/>

                      </location>

                      <access-log pattern="REQ %{i,test-header}" directory="${jboss.server.server.dir}" prefix="access" />

                  </host>

                 <host name="other-host" alias="www.mysite.com" >

                      <location name="/" handler="welcome-content">

                          <filter-ref name="connection-limit"/>

                      </location>

                  </host>

              </server>

          hope this helps explain it.

           

          --

          tomaz

          • 2. Re: What happened to Web - Servlet/HTTP - Virtual Servers in WildFly?
            mdeanda

            So I took the default configuration and add a new host...

             

                   <subsystem xmlns="urn:jboss:domain:undertow:1.0">
            

                        <buffer-caches>

                            <buffer-cache name="default" buffer-size="1024" buffers-per-region="1024" max-regions="10"/>

                        </buffer-caches>

                        <server name="default-server">

                            <http-listener name="default" socket-binding="http" max-post-size="10485760"/>

                            <host name="default-host" alias="localhost">

                                <location name="/" handler="welcome-content"/>

                            </host>

                            <host name="other-host" alias="www.mysite.com" default-web-module="something.war">

                                <location name="/" handler="welcome-content">

                                    <filter-ref name="connection-limit"/>

                                </location>

                            </host>

                        </server>

                        <servlet-container name="default" default-buffer-cache="default" stack-trace-on-error="local-only">

                            <jsp-config/>

                            <persistent-sessions path="persistent-web-sessions" relative-to="jboss.server.data.dir"/>

                        </servlet-container>

                        <handlers>

                            <file name="welcome-content" path="${jboss.home.dir}/welcome-content" directory-listing="true"/>

                        </handlers>

                    </subsystem>

             

            but i get this error now:

             

            11:29:36,171 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 49) JBAS014612: Operation ("add") failed - address: ([

                ("subsystem" => "undertow"),                                                                                                                                                     

                ("server" => "default-server"),                                                                                                                                                  

                ("host" => "other-host"),                                                                                                                                                        

                ("location" => "/")                                                                                                                                                              

            ]): org.jboss.msc.service.DuplicateServiceException: Service jboss.web.common.host./ is already registered                                                                           

                    at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:317) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]

                    at org.jboss.as.controller.OperationContextImpl$ContextServiceBuilder.install(OperationContextImpl.java:1422) [wildfly-controller-8.0.0.Beta1.jar:8.0.0.Beta1]

                    at org.wildfly.extension.undertow.LocationAdd.performRuntime(LocationAdd.java:84)

                    at org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:75) [wildfly-controller-8.0.0.Beta1.jar:8.0.0.Beta1]

                    at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:609) [wildfly-controller-8.0.0.Beta1.jar:8.0.0.Beta1]

                    at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:487) [wildfly-controller-8.0.0.Beta1.jar:8.0.0.Beta1]

                    at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:277) [wildfly-controller-8.0.0.Beta1.jar:8.0.0.Beta1]

                    at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:272) [wildfly-controller-8.0.0.Beta1.jar:8.0.0.Beta1]

                                                                                                                           

            • 3. Re: What happened to Web - Servlet/HTTP - Virtual Servers in WildFly?
              ctomc

              this is a bug, can you file a jira.

               

              tnx.

              1 of 1 people found this helpful
              • 5. Re: What happened to Web - Servlet/HTTP - Virtual Servers in WildFly?
                ctomc

                Fix for this has been just merged, so you can try it out by building current master or use tomorrows nightly build