Question

I have an app on a subdomain, I wish to access like so:

http://sub.domain.com/myApp/some.jsp

I've tried various config options and I'm close, as JBoss returns 404s, but can't load as expected. JBoss 7.1.1, apache2.

jboss-web.xml:

<jboss-web>
   <virtual-host>sub.domain.com</virtual-host>
   <context-root>/myApp</context-root>
</jboss-web>

jboss' standalone.xml:

<virtual-server name="sub.domain.com" default-web-module="myApp">
    <alias name="sub.domain.com/myApp"/>
    <access-log prefix="myApp-" rotate="true">
        <directory path="server.log"/>
    </access-log>
</virtual-server>

apache conf:

<VirtualHost *:80>
    ServerName sub.domain.com
    ServerAlias sub.domain.com
    JkMount /myApp jk
    JKMount /myApp/* jk
</VirtualHost>

workers.properties:

worker.list=jk
worker.jk.port=8009
worker.jk.host=localhost
worker.jk.type=ajp13
worker.jk.mount=/myApp/*
Was it helpful?

Solution

I got it! I was doing too much before. Here is how it's done.

jboss-web.xml: Commented out all those settings above.

jboss' standalone.xml: Removed the virtual-server above, updated the default-host with an alias.

<virtual-server name="default-host" enable-welcome-root="true">
    <alias name="localhost"/>
    <alias name="sub.domain.com"/>
</virtual-server>

apache conf:

<VirtualHost *:80>
    JkMount /myApp/* jk
</VirtualHost>

workers.properties:

worker.list=jk
worker.jk.port=8009
worker.jk.host=localhost
worker.jk.type=ajp13

Alright!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top