-
1. Re: Webservice on separate port
g.hohl Feb 12, 2019 8:16 AM (in response to herkules)Same here: I have to applications. And I want that each application listens on different ports (HTTP & HTTPS). Is that possible and how?
I already solved the problem of different SSL certificates for HTTPS:
Different SSL certificates for different web applications
But still struggling with HTTP as well as application separation.
-
2. Re: Webservice on separate port
g.hohl Feb 12, 2019 9:16 AM (in response to g.hohl)Okay, I tried it via virtual-host, but somehow that doesn't work either:
http://www.mastertheboss.com/jboss-web/jbosswebserver/jboss-as-virtual-host-configuration
I've added another alias for 127.0.0.1 in my hosts file.
I also added a server and a host to my standalone-full.xml via the web interface.
<subsystem xmlns="urn:jboss:domain:undertow:8.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other"> <buffer-cache name="default"/> <server name="default-server"> <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/> <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/> <host name="default-host" alias="localhost"> <location name="/" handler="welcome-content"/> <http-invoker security-realm="ApplicationRealm"/> </host> </server> <server name="myapp-server" default-host="myapp-host"> <http-listener name="http-myapp" socket-binding="http-myapp" redirect-socket="https-myapp" enable-http2="true"/> <https-listener name="https-myapp" socket-binding="https-myapp" security-realm="MyAppRealm" enable-http2="true"/> <host name="myapp-host" alias="myapp-localhost" default-web-module="welcome.war"> <location name="/" handler="welcome-content"/> <access-log prefix="myapp_access_log."/> <http-invoker security-realm="MyAppRealm"/> </host> </server> <servlet-container name="default"> <jsp-config/> <websockets/> </servlet-container> <handlers> <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/> </handlers> </subsystem>
My jboss-web.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss-web> <jboss-web xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.org/schema/jbossas http://www.jboss.org/schema/jbossas/jboss-web_7_2.xsd"> <context-root>/myapp</context-root> <virtual-host>myapp-host</virtual-host> </jboss-web>
But when I try to deploy my application I get the following error:
15:06:07,931 ERROR [org.jboss.as.server] (External Management Request Threads -- 1) WFLYSRV0021: Deploy of deployment "myapp-ear-1.0.4.ear" was rolled back with the following failure message:
{
"WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.server.default-server.myapp-host"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.deployment.subunit.\"myapp-ear-1.0.4.ear\".\"myapp-web-1.0.4.war\".undertow-deployment.UndertowDeploymentInfoService is missing [jboss.undertow.server.default-server.myapp-host]",
"jboss.deployment.subunit.\"myapp-ear-1.0.4.ear\".\"myapp-web-1.0.4.war\".undertow-deployment is missing [jboss.undertow.server.default-server.myapp-host]"
]
}
What I don't understand is why it says "default-server"?
Of course there is no host "myapp-host" in the "default-server" server section, it is in the "my-server" server section.
-
3. Re: Webservice on separate port
g.hohl Feb 13, 2019 8:56 AM (in response to g.hohl)Found the solution. See my other thread: Different SSL certificates for different web applications