karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré ...@nanthrax.net>
Subject Re: Assigning Wars To Ports And Subdirectories?
Date Fri, 29 Jul 2011 21:16:14 GMT
Hi Gareth,

1/ currently, Pax Web support the webapp context path using the 
following OSGi statements:

   <Web-ContextPath>/myapp</Web-ContextPath>
   <Webapp-Context>/myapp</Webapp-Context>

When you install the HTTP feature, it installs a jetty.xml file in the 
etc folder.
In this jetty.xml file, you can define several port number for the 
embedded jetty server.

Create a new Connector in the jetty.xml with an ID, like:

<Call name="addConnector">
   <Arg>
     <New id="my" 
class="org.eclipse.jetty.server.nio.SelectChannelConnector">
       ...
       <Set name="port">5340491</Set>
       ...
     </New>
   </Arg>
</Call>

After, to associate the webapp with the Configured server, try to create 
a etc/context.xml file containing:

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
   <Set name="contextPath">/myapp</Set>
   <Set name="connectorNames">
     <Array type="String">
       <Item>my</Item>
     </Array>
   </Set>
</Configure>

Without guarantee, I never tried this before :)

2/ for the directory, you can create a new file in etc, for instance 
etc/org.apache.felix.fileinstall-war.cfg containing:

felix.fileinstall.dir=${karaf.base}/war
felix.fileinstall.tmpdir=${karaf.data}/webapp
felix.fileinstall.poll=1000

Could you try this ?

Regards
JB

On 07/29/2011 10:47 PM, Gareth wrote:
> Hello,
>
> I am not sure whether this is a PAX Web question, or a Karaf question but:
>
> (1) If I install a war/wab file, is there any way of making it available on
> certain ports? For example, I would probably want the Karaf console and
> Active MQ console on a separate port to my application wabs/wars (as my
> wabs/wars may be visible through a firewall whilst Karaf console should not
> be).
>
> (2) Any way of installing wars (which are not OSGi wabs) to subdirectories?
> In tomcat I could do this by adding a "#" as part of the war name (e.g.
> hosting#fred.war could be accessed by http://hostname/hosting/fred.war).
> There isn't a similar feature in Karaf/PAX Web, is there?
>
> thanks in advance,
> Gareth
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Assigning-Wars-To-Ports-And-Subdirectories-tp3210710p3210710.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Mime
View raw message