-
2. Re: Two webapps on different ports in one JBoss
supermario Nov 16, 2004 12:34 PM (in response to supermario)I saw this site before.
But I don't want to change the hostname or create viratual hosts with another name.
I want to deploy my webapps on different ports (one on 80 and other on 81).
Is this also possible with this "virtual hosts" description ?? Do you mean I have to set up 2 Connectors ?? To be honest, I'm not really familiar with the JBoss configuration.
Best Regards,
Mario -
3. Re: Two webapps on different ports in one JBoss
sj_bennett Nov 17, 2004 1:06 PM (in response to supermario)The problem with the solution you're looking at is that the application will still be available on port 80 (use the JMX console and look at the applications listed under the jboss.web heading). I will describe below how I was able to limit access to users inside our firewall using virtual hosts.
You need to define a virtual host in your server.xml file found in the jboss-tomcat50.sar directory. You can just copy the definition for "localhost", modify the 'name' attribute, and then add an to the host definition. An example for host "foo" is shown below.<Host name="foo" autoDeploy="false" deployOnStartup="false" deployXML="false"> <alias>bar.foo.com</alias> <Valve className="org.apache.catalina.valves.AccessLogValve" prefix="foo_access_log." suffix=".log" pattern="common" directory="${jboss.server.home.dir}/log" resolveHosts="false" /> <DefaultContext cookies="true" crossContext="true" override="true"/> </Host>
Next, you need to modify your jboss-web.xml file in the application that you want to run on this virtual host. An example jboss-web.xml is shown below for the "foo" virtual host.<jboss-web> <context-root>/myfoo</context-root> <virtual-host>bar.foo.com</virtual-host> </jboss-web>
Finally, you need to add an entry to your DNS server to map bar.foo.com to the IP address of your server.
If you make these changes, then fire up the JMX console, you should see that the listing for your application under the 'jboss.web' section is shown as //bar.foo.com/myfoo .
Hope this helps.
steve