Solved

Virtual Hosting on JBoss

Posted on 2010-11-22
14
1,049 Views
Last Modified: 2013-12-20
I am working on migrating my development hosting environment from Tomcat 6 to JBoss 4.2.3.  I got my CF server running on it, but I am having trouble figuring out the virtual hosting part of things.  The really confusing part is that I have JBoss sitting in /usr/local/jboss, but all my web apps are in /home/david/workspace/coldfusion.  If someone could just give me an example of how to create the tomcat host in jboss...

<Host name="muracms" appBase="webapps"
		unpackWARs="true" autoDeploy="true"
		xmlValidation="false" xmlNamespaceAware="false">
	<Context path="" docBase="/home/david/workspace/coldfusion/muracms"/>
</Host>

Open in new window

0
Comment
Question by:paldie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
14 Comments
 
LVL 19

Expert Comment

by:ramazanyich
ID: 34203964
Hi, you can find server.xml of web server of jboss in $JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml place (if you do not use default config you can change default to the config which you are using).
It's configuration similar to tomcat config. I think you can put <Context> element inside <Host name="localhost"... part there.
0
 

Author Comment

by:paldie
ID: 34205627
@ramazanyich - That is what I tried in my server.xml on JBoss (in the same path), but it just crashes.
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 34225902
probably you need to remove server/default/jboss-web.deployer/ROOT.war as it is suggested in http://docs.jboss.org/jbportal/v2.7.1/referenceGuide/html/configuration.html (see pp3.2.1 there).
After that jboss should use your Context definition.
I tried it on my local installation and indeed without removing of ROOT.war my context was not used.
But since I remove ROOT.war my context is used.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:paldie
ID: 34233011
It seems that your solution, ramazanyich, only works for JBoss Web, but not on JBoss AS.  I tried it and it still didn't seem to work.  I am going to have some time to try taking the steps a little further tonight and will see what comes from it.
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 34233583
If you worry about appbase then the simplest way is to move all your apps from webapps folder of tomcat to the server/deploy directory. All war files will be automatically picked up by jboss AS as web applications (web deployer  recognizes them by .war extension)
0
 

Author Comment

by:paldie
ID: 34233855
The problem is that I don't keep them in the tomcat/webapps folder.  I keep them in /home/david/workspaces/coldfusion/ so that I can keep all my work in one place on my drive.
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 34234044
Ok, I see. So in that case you should not bother with <Context> or <Host> element in jboss-web.
the application (by application I mean all type of applications: web, ejbs,etc) scanner is configured in server/default/conf/jboss-service.xml . If you search for <attribute name="URLs"> element in this file you will see that it is configured to track deploy folder inside server/default. But you can put multiple urls there.
And there is also comment there:
         URLs are comma separated and resolve relative to the server home URL
         unless the given path is absolute. If the URL ends in "/" it is
         considered a collection and scanned, otherwise it is simply deployed;
         this follows RFC2518 convention and allows discrimination between
         collections and directories that are simply unpacked archives.

         URLs may be local (file:) or remote (http:). Scanning is supported
         for remote URLs but unpacked deployment units are not.

         Example URLs:
            deploy/
                 scans ${jboss.server.url}/deploy/, which is local or remote
                 depending on the URL used to boot the server
            ${jboss.server.home}/deploy/
                 scans ${jboss.server.home)/deploy, which is always local
            file:/var/opt/myapp.ear
                 deploy myapp.ear from a local location
            file:/var/opt/apps/
                 scans the specified directory
            http://www.test.com/netboot/myapp.ear
                 deploys myapp.ear from a remote location
            http://www.test.com/netboot/apps/
                 scans the specified WebDAV location
       -->
 
so for your case ityou will need to add
file://home/david/workspace/coldfusion/muracms/
and jboss will scan your folder for web apps.
0
 

Author Comment

by:paldie
ID: 34234107
I did a search for <attribute name="URLs" and found nothing, so I did a search for URL and didn't find anything like what you said, and even just scanning through the document didn't help.  I am on JBoss 5.1.0.GA as Railo CF Server doesn't work on more recent versions of JBoss.  Are you using a more modern version that may have added that attribute?
0
 
LVL 19

Accepted Solution

by:
ramazanyich earned 500 total points
ID: 34234402
ok, I see. Your first message was mentioning jboss4.2.3 - that's why I was sending you solution for jboss4.2.3
in jboss5.1 it is changed. JBOSS uses virtual filesystem there.
You need to look for <property name="applicationURIs"> in jboss-5.1.0.GA\server\default\conf\bootstrap\profile.xml

It contains <list elementClass="java.net.URI">
                        <value>${jboss.server.home.url}deploy</value>
                  </list>
you should add you directory there: file:/home/david/workspaces/coldfusion/

it will look like
<list elementClass="java.net.URI">
                        <value>${jboss.server.home.url}deploy</value>
                                <value>file:/home/david/workspaces/coldfusion/</value>
                  </list>
0
 

Author Closing Comment

by:paldie
ID: 34509439
This was only a partial solution
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question