[SOLVED] Was: Re: Mapping / -> jboss:/application in Apache …

Marc Fournier mfournier at sd63.bc.ca
Wed Nov 28 20:13:31 UTC 2012


Figured it out … much simpler (at least then I was able to find) then under Tomcat …

Step 1:

Edit standalone.xml to change enable-welcome-root to false:

From:

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

to:

            <virtual-server name="default-host" enable-welcome-root="false">
                <alias name="localhost"/>
                <alias name="example.com"/>
            </virtual-server>

And then add a file jboss-web.xml to your .war file's WEB-INF directory that contains:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
  <context-root>/</context-root>
</jboss-web>

And you are away to races …




On 2012-11-28, at 10:22 , Marc Fournier <mfournier at sd63.bc.ca> wrote:

> 
> What is the currently recommended way to do this?  I'm trying proxy_ajp in Apache 2.2, since it seems the simplist to setup, and reduces the # of modules I need to support ... but if I do something like:
> 
>         ProxyPass / ajp://localhost:8009/subfolder
>         ProxyPassReverse / ajp://localhost:8009/subfolder
> 
> When I go to:
> 
> http://localhost
> 
> the url gets rewritten as 'http://localhost/subfolder
> 
> and I get an error:
> 
> HTTP Status 404 - /subfoldersubfolder/
> 
> from jboss ...
> 
> I want the whole /subfolder to be hidden behind the scenes, since this is the only thing being served from that server, and adding /subfolder/ just makes the URL longer then it needs to be ...
> 
> Is this a problem with using Apache2.2/proxy_ajp itself, or how I'm setting up the proxy stuff ... ?  If its with Apache2.2, would using mod_jk fix it?
> 
> Or, should I just change the context-path in  jboss to re-point :8080/ and do / on Apache -> :8080/ on  jboss ... ?
> 
> Thoughts / advice?
> 
> thanks ...
> 
> 
> 
> 



More information about the freebsd-java mailing list