Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CF on JBoss

New Here ,
Nov 18, 2009 Nov 18, 2009

Currently we are running four separate instances of ColdFusion 8 Enterprise which are using the bundled JRun server attached to Apache2. I have them split up using virtual machines on ESXi.

We just purchased CF 9 which I will be setting up on a new server and then migrating our applications over, but I am wondering if I would be better off just avoiding ESXi and intead running these 4 separate CF instances on one install of JBoss. In the past I toyed around with running several instances of CF8 on Tomcat 6, which I had working (for the most part), except I never got the virtual domains working correctly and the proxy between apache<>tomcat didn't seem to be working properly.

I just chucked that previous attempt at Tomcat expecially since it isn't an officially supported platform by Adobe. Looking around online I can find very little information about running on a J2EE server... will Tomcat 6 work fine (since it is the core to Jboss)? Should I use JBoss or am I better off the way I am with separate instances of JRun on Virtual Machines?

Thanks for any input.

1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 20, 2009 Nov 20, 2009

I did get CF 8 and 9 up and running on JBoss 5.1 the same day I made my first post and also got virtual hosts working with apache/ajp. Everything seems to be working quite well actually, and now that I am using jboss's rewrite engine instead of apache's I suppose I don't even need the apache part of the equation anymore.

But, I still have that question in the back of my mind of if this setup is worth the extra effort. Should this setup be more stable or efficient? I have noticed that if I need to restart a CF instance it is alot quicker to stop/start the EAR (or even stop/start JBoss entirely) than it is to stop/start JRun. JBoss will fully startup with 6 instances in under a minute where the CF service would take several minutes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 17, 2009 Dec 17, 2009

I'm running into this same problem. I have JBoss and CF9 set up and working with Apache and mod_proxy. There are going to be 3 or 4 more instances of CF set up on this box but I'm having a hard time trying to figure it all out.

I have CF deployed as an .ear in JBoss. Say I have 4 other CF apps that I want to get going. I can just make seperate .war folders under cfusion.ear and deploy that way, correct? They don't seem to deploy, what else do I need to configure? Do I need to copy the CFIDE and WEB-INF these .war folders and change the jboss-web.xml?

I'm also having issues trying to configure the server.xml for the virtual hosts. Can you give me any examples or point me in the right direction?

Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2009 Dec 17, 2009

There are two way to approach this and it depends if you are deploying from a EAR or WAR file. Since you chose to use a EAR like I did, these are the steps I follow to create an instance, if you're using linux I also put commands for reference:

  1. Copy the cfusion.ear file to a new folder, not inside your jboss directory to hold the new instance
    1. mkdir ~/newcfinstancename.ear
    2. cp /opt/coldfusion9/cfusion.ear ~/newcfinstancename.ear/
  2. Extract the EAR file
    1. cd ~/newcfinstancename.ear
    2. jar -xvf cfusion.ear
    3. rm cfusion.ear
  3. Create the directory to hold the extracted WAR and extract the WAR inside of that directory
    1. mkdir ~/newcfinstancename.ear/newcfinstancename.war
    2. cd ~/newcfinstancename.ear/newcfinstancename.war
    3. jar -xvf ../cfusion.war
    4. rm ../cfusion.war
  4. Edit the application.xml file inside your EAR's META-INF so it has the correct instance name information
    1. nano ~/newcfinstancename.ear/META-INF/application.xml
    2. Replace <web-uri>cfusion.war</web-uri> with the correct name:
      1. <web-uri>newcfinstancename.war</web-uri>
    3. Replace <context-root>/cfusion</context-root> with the correct name:
      1. <context-root>/newcfinstancename</context-root>
  5. Place a jboss-web.xml file inside your WAR's WEB-INF for your virtual host pointer
    1. nano ~/newcfinstancename.ear/newcfinstancename.war/WEB-INF/jboss-web.xml
    2. <jboss-web>
           <context-root>/</context-root>
           <virtual-host>newappname</virtual-host>
      </jboss-web>

  6. Edit your jboss/server/default/deploy/jbossweb.sar/server.xml file
    1. Under the last closing </Host> tag add a new host section for your new instance
    2. <Host name="newappname" autoDeploy="false" deployOnStartup="false" deployXML="false">
              <Alias>newappname.domain.com</Alias>
      </Host>

  7. You will now need to create your virtual host definition in apache, i'll assume you know where/how to do this, below is the code for a virtual host:
    1. <VirtualHost *:80>
              ServerName newappname.domain.com
              ProxyPass / ajp://newappname.domain.com:8009/
      </VirtualHost>

You need to make sure that the FQDN used for these configs is actually setup in your DNS since it is all name based... I put them in my hosts file while setting this up just to ensure there are no issues.

You will be using a completely separate instance.ear for each instance, each of which will contain their own instance.war

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 17, 2009 Dec 17, 2009

Thanks for the quick reply! This is on a Windows 2008 box btw. So I set everything up but everytime I have more than one instance of CF the other instance won't start. It shows the following error in JBoss when trying to start:

java.lang.SecurityException: Seed must be between 20 and 64 bytes. Only 8 bytes supplied.

Here are my config files, I have a cfusion.ear and brazil.ear under the JBoss deploy directory.

application.xml under brazil.ear

<web>
            <web-uri>brazil.war</web-uri>
            <context-root>/brazil</context-root>

</web>

jboss-web.xml under brazil.war

<jboss-web>
     <context-root>/brazil</context-root>
     <virtual-host>abellasbrazil-dev.mysite</virtual-host>
</jboss-web>

server.xml

<Host name="abellasbrazil-dev.mysite" autoDeploy="false" deployOnStartup="false" deployXML="false">
<Alias>abellasbrazil-dev.mysite</Alias>
</Host>

Apache virtual host file

<VirtualHost *:80>
   ServerAdmin abellas@mysite.com"
   ServerName devmktgweb.mysite.com
   ServerAlias devmktgweb.mysite.com
   ProxyPass / ajp://devmktgweb.mysite.com:8080/
   ErrorLog "logs/devmktgweb.mysite.com-error.log"
   CustomLog "logs/devmktgweb.mysite.com-access.log" common

</VirtualHost>

Thanks again for any help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 18, 2009 Dec 18, 2009

Are you running v5.1.0GA-jdk6 or the new v6?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 18, 2009 Dec 18, 2009

Yeah it's JBoss v5.1.0GA and JDK1.6u16.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 20, 2009 Dec 20, 2009

Interesting... I have encountered that error before but in a different scenario. Is your JAVA_HOME set so that you know jboss is loading up the correct JDK instance?

Take a look at this link: http://help.adobe.com/en_US/ColdFusion/9.0/Installing/WSc3ff6d0ea77859461172e0811cdec18c28-7fbd.html it has some tweaks that you need to perform, these would also apply to CF8. There are sections only for windows servers.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 21, 2009 Dec 21, 2009

Yes, the JAVA_HOME variable is set to the correct (and only) JDK instance. I also followed that help article when setting up JBoss and CF9 so I'm kind of at a loss on what to do next...

I found this article http://daveshuck.instantspot.com/blog/2009/05/08/Solving-javalangSecurityException-Seed-must-be-between-20-and-64-bytes-Only-8-bytes-supplied but its referring to JRun.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 21, 2009 Dec 21, 2009

Sorry I completely forgot about that (what I get for not documenting as I go). You need to edit the bin/run.sh (bin/run.bat in your case) and down around like 230 you should see a JAVA_OPTS property. Replace this with...

JAVA_OPTS="-Dcoldfusion.disablejsafe=true $JAVA_OPTS"

-Patrick

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 21, 2009 Dec 21, 2009

Hm, I didn't see exactly where to put this but here are my JAVA_OPTS section's.

if "x%JAVA_OPTS%" == "x" (

  set "JAVA_OPTS=-Dprogram.name=%PROGNAME%"

) else (

  set "JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%"

set JAVA_OPTS=%JAVA_OPTS% "-Djava.library.path=%JBOSS_NATIVE_HOME%;%PATH%;%JBOSS_HOME%\bin"

"%JAVA%" %JAVA_OPTS% ^

   -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" ^

   -classpath "%JBOSS_CLASSPATH%" ^

   org.jboss.Main %*

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 21, 2009 Dec 21, 2009

Try changing the file as follows:

Original

if "x%JAVA_OPTS%" == "x" (  
  set "JAVA_OPTS=-Dprogram.name=%PROGNAME%"
) else (
  set "JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%"
)

New

if "x%JAVA_OPTS%" == "x" (  
  set "JAVA_OPTS=-Dcoldfusion.disablejsafe=true"
) else (
  set "JAVA_OPTS=-Dcoldfusion.disablejsafe=true %JAVA_OPTS%"
)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 21, 2009 Dec 21, 2009

Thanks, I just saw that at the bottom of the help doc right after I posted. Anyways both CF instances are up and running

However, the other site still won't come up. My config is still the same as in post 4. Is there anything that you can see that I'm missing?

Thanks again for all the help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 22, 2009 Dec 22, 2009

So you can access the instances via Tomcat but not via Apache?

First thing thats obvious to me is your proxypass statement...

   ProxyPass / ajp://devmktgweb.mysite.com:8080/

ajp operates by default on port 8009, separate of tomcats http server operating on 8080.

You should have:

   ProxyPass / ajp://devmktgweb.mysite.com:8009/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 22, 2009 Dec 22, 2009
LATEST

If I go to localhost:8080 I can get the test CF page to come up just fine. I modified my hosts file on my computer and I can get to devmktgweb.mysite.com just fine. However brazil-dev.mysite.com gives me a 404 error and I can't get to the other test page on the local machine by going to localhost:8080/brazil.

I tried changing the ProxyPass to 8009 but still couldn't get to the other test page. I know there's something I'm missing but I'm just not sure what I need to change or add.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources