8

ColdFusion 8 and Plesk 8 on Red Hat ES 4

By default the Plesk control panel does not work with ColdFusion 8 yet. It sounds like official support will be available in Q1 of ’08. I couldn’t wait that long. I’ve been able to get Plesk 8 to work with ColdFusion 8 to a degree.

I assume you’re familiar with how to install both separately so I’ll just be going over how to get both to play together.

In my world the Plesk control panel is just used simply used so that staff in our small software company can manage websites and not need to use a shell. No one else even has access to Plesk. Because of this, separation and security are not primary concerns. Also, I have no need to let anyone or myself manage CF DSN’s from within Plesk, being able to do this in CF Admin is fine.

So what I’ve done is enable the ColdFusion checkbox used when setting up a website so that CF code can be used on a particular website. Any ColdFusion management capabilities of Plesk are not enabled.

[root@yadda]# /usr/local/psa/bin/cfsetting -s /opt/coldfusion8
I/O warning : failed to load external entity "/opt/coldfusion8/runtime/servers/default/SERVER-INF/jrun.xml"
Config not parsed successfully.

Running that cfsetting command with the -s switch and the cf root from the commandline showed me an error plesk was running into. I found jrun.xml in a different place.

/opt/coldfusion8/runtime/servers/coldfusion/SERVER-INF/jrun.xml

Since I think jrun.xml should be pretty much the same from CF7 to CF8, I’m going to just try pointing Plesk to the right place with a simlink.

cd /opt/coldfusion8/runtime/servers/ && ln -s coldfusion default

Now I run the cfsetting command again.

/usr/local/psa/bin/cfsetting -s /opt/coldfusion8

Now I notice when starting up Apache that it’s trying to startup mod_jrun twice. In my ColdFusion install I selected to build a mod_jrun connector to hook into Apache during the install. Turns out that this conflicts with Plesk. It’s a simple fix. Just fire up your httpd.conf file and look for all instances of cfm or jrun. You should see these entries toward the bottom of the file. Just comment out the whole block of stuff by putting a hash sign in from of the lines. Or you could always delete this stuff if you want.

For each website that you enable ColdFusion support for you should see this code in the httpd.include file for the site.

JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore /opt/coldfusion8/runtime/lib/wsconfig/psa/jrunserver.store
JRunConfig Bootstrap 127.0.0.1:51800
AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc

If you need to do a little troubleshooting, just make sure that you don’t see code like this in any of the global config files for apache. As well make sure your jrunserver.store file exists. And make sure you’re loading the mod_jrun module somewhere. Plesk should drop this into zz010_psa_httpd.conf in the conf.d folder. Make sure that exists: LoadModule jrun_module /opt/coldfusion8/runtime/lib/wsconfig/psa/mod_jrun20.so. And lastly, double check your jrun.xml file you should see a mention of jrun broadcasting on port 51800 … you should see that in the jrun.servlet.jrpp.JRunProxyService block of the jrun.xml file. It’s possible that jrun is running on a different port, if that’s the case you’ll need to change it to 51800. Or somehow find out how to change the Plesk default.

If you have any troubles, post a comment here and I’ll see if I can help.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • StumbleUpon
  • Technorati
  1. Giancarlo Salamanca says:

    Thanks for this information, Matt, it’s really helped me along the path to getting CF8 working on my Plesk 8 server running CentOS :)

    However, there seems to be one last thing to overcome – when I try to load any .cfm pages on a domain with Coldfusion enabled in Plesk, all I get is this JRun Servlet Error 500 with the following stack trace:

    java.lang.NullPointerException
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:283)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
    at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

    Any ideas what might be causing this? It’s a fresh installation of Plesk and CF8.

  2. Matt says:

    Hi Giancario,

    I have seen this error before. This could very well be unrelated to plesk. I believe a NullPointerException is thrown when ColdFusion looks for something that’s undefined. Like if you were trying to call a custom tag that didn’t exist. Or if you had some old CF code that called function no longer available. Or it could be due to a broken CF install.

    Here’s a couple things I’d check.

    I assume you’ve tried to load up the ColdFusion administrator. If not, try to do that. That loading properly or not would rule out any issues with your code. Also, I think the first time you load the cfadmin, that does some additional install tasks.

    Next look at the install log file for your cf install. Mine’s at /opt/oldfusion8/Adobe_ColdFusion_8_InstallLog.log about a page down from the top I see:

    Summary
    ——-

    Installation: Successful.

    3697 Successes
    0 Warnings
    0 NonFatalErrors
    0 FatalErrors

    If you see any warnings or errors, find them to get more info.

    I did an install using RedHat 5 recently which didn’t have apxs installs with apache by default … that threw an error so I installed the http-devel package and reinstalled CF. Maybe this is the issue with CentOS too?

    If everything looks good there, check out your error logs to see if they offer anymore useful info that the NullPointer error. Assuming you’ve installed in /opt/coldfusion8 you can do a:

    tail -500 /opt/coldfusion8/cfserver.log

    tail -500 /opt/coldfusion8/exception.log

    Hopefully you see something a little more descriptive.

    And if all that doesn’t show anything new, you can try skipping plesk all together just to rule out if it’s a plesk+cf issue or just a cf issue.

    Assuming your apache conf and conf.d directories are in the same place as mine look for an temporarily comment out any mentions of jrun (my output will look different than yours):

    [root@server logs]# grep -ri jrun /etc/httpd/conf
    /etc/httpd/conf/httpd.conf:# JRun Settings
    /etc/httpd/conf/httpd.conf:#LoadModule jrun_module /opt/coldfusion8/runtime/lib/wsconfig/1/mod_jrun22.so
    /etc/httpd/conf/httpd.conf:#
    /etc/httpd/conf/httpd.conf: JRunConfig Verbose false
    /etc/httpd/conf/httpd.conf: JRunConfig Apialloc false
    /etc/httpd/conf/httpd.conf: JRunConfig Ignoresuffixmap false
    /etc/httpd/conf/httpd.conf: JRunConfig Serverstore /opt/coldfusion8/runtime/lib/wsconfig/1/jrunserver.store
    /etc/httpd/conf/httpd.conf: JRunConfig Bootstrap 127.0.0.1:51800
    /etc/httpd/conf/httpd.conf: #JRunConfig Errorurl url
    /etc/httpd/conf/httpd.conf: #JRunConfig ProxyRetryInterval 600
    /etc/httpd/conf/httpd.conf: #JRunConfig ConnectTimeout 15

    /etc/httpd/conf/httpd.conf: #JRunConfig RecvTimeout 300

    /etc/httpd/conf/httpd.conf: #JRunConfig SendTimeout 15

    /etc/httpd/conf/httpd.conf: AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf

    [root@bree logs]# grep -ri jrun /etc/httpd/conf.d
    /etc/httpd/conf.d/zz010_psa_httpd.conf:LoadModule jrun_module /opt/coldfusion8/runtime/lib/wsconfig/psa/mod_jrun20.so

    —-

    Now make sure you only have the following in you httpd.conf file and all other mentions of jrun stuff are commented out in any other conf or conf.d files:

    LoadModule jrun_module /opt/coldfusion8/runtime/lib/wsconfig/1/mod_jrun22.so
    JRunConfig Verbose false
    JRunConfig Apialloc false
    JRunConfig Ignoresuffixmap false
    JRunConfig Serverstore /opt/coldfusion8/runtime/lib/wsconfig/1/jrunserver.store
    JRunConfig Bootstrap 127.0.0.1:51800
    AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf

    Hopefully some new info will come out of this process. Let me know how it goes.

    -Matt

  3. Hugh says:

    Hey,

    I am using Fedora Core 6 – 64bit. In my zz010_psa_httpd.conf If I include:

    LoadModule jrun_module /opt/coldfusion8/runtime/lib/wsconfig/psa/mod_jrun20.so

    The HTTPD does not start. If I remove the line then HTTPD start obviously I need this command line. Any Ideas? Thanks!

    Hugh

  4. Matt says:

    What version of apache are you running? If it’s 2.2.something mod_jrun20 won’t work and you’ll need mod_jrun22

    You can check it by running the following in the command line:

    httpd -v

    If you’re running Apache 2.2.something, check out this post for hacking plesk to allow for mod_jrun22:

    http://www.usercore.com/2007/10/19/coldfusion-8-and-plesk-8-on-redhat-5-via-mod_jrun22/

    If you’re running Apache 2.0.something, you’re got the right version of mod_jrun so there’s another issue. The error log file for apache should offer more info.

    Try the following command when starting apache with the LoadModule line for mod_jrun in place.

    tail -100 /var/log/httpd/error_log

    That will show you the last 100 lines in the log. Or if you have two shell windows open, one for restarting apache and one for looking at the log you can do the following to see new entries in the log in realtime:

    tail -f /var/log/httpd/error_log

  5. Patrick says:

    Hi Matt,
    thanks for your tutorial. It works great.
    But Domains/Subdomains which already existed before installing ColdFusion doesn’t work. But new ones do.
    But the old domains also have the
    JRunConfig Verbose false
    JRunConfig Apialloc false
    JRunConfig Ignoresuffixmap false
    JRunConfig Serverstore /opt/coldfusion8/runtime/lib/wsconfig/psa/jrunserver.store
    JRunConfig Bootstrap 127.0.0.1:51800
    AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc
    entries.

  6. Matt says:

    Hi Patrick,

    I don’t have my RedHat 4 box online to check this anymore but it sounds like you’re very close. What’s the specific error you get when trying to go to one of these sites? Do you see anything in the error_log file for the site? How about the cfserver log? tail -f /opt/coldfusion8/cfserver.log

    Something to try, if the sites that don’t work contain the JRun options in their httpd.include files and it’s exactly the same stuff as you put in the global httpd.conf, try removing the matching jrun info in the global httpd.conf and make sure to click the coldfusion support box in plesk for all your new domains.

    -Matt

  7. Digerati says:

    This tutorial worked great. Thanks!

    One thing.. I couldn’t get any client domains in plesk to run through CF> Every request no matter how I formatted the file name woudl throw a 404 error. I checked permissions and they seemed fine.

    Answer: When installing Coldfusion, make sure it is set to run as the user apache (or psaserv) so CF will load the pages for domains other than the CF Administrator.

    You can use nobody if you add it to the pasaserv group.

    For details see this Plesk thread: http://forum.swsoft.com/showthread.php?threadid=16583

  8. mario says:

    Was wondering if someone can help help me.

    I have installed coldfusion 8 on a windows 2003 server. During installation i chose to install the Coldfusion admin files to a specific website set up. This was because i have Parallels Plesk installed and when I previously selected “All IIS websites” when istalling Coldfusion it screwed this up.

    The administrator works fine, no problem whatsoever, however when i create new websites i get 404 errors.

    How do i enable my new sites and existing sites to allow Coldfusion?

    many thanks