Feb
7

This post is a followup to my previous guide to installing ColdFusion 9 on Ubuntu. While that post was all about the specifics to getting ColdFusion up and running on Ubuntu, this post is all about CentOS. The overall process is the same and I'm covering all the same steps, but the commands in this post are specific to the CentOS operating system. So why I'm writing this?

Overall, installing ColdFusion isn't that big of a deal. But I've yet to see a guide or blog post that outlines all the other topics related to getting a decent ColdFusion server on CentOS up and running. That's why I wrote this super guide, to outline what I believe is important to know about installing ColdFusion. Of course, I'm not covering every single possible detail, but I believe I've hit on all the major topics. Along the way I sprinkle in my own ideas, thoughts, and what I believe are best practices. After you read this post and walk through all the instructions you should have a very solid ColdFusion / Apache set up on CentOS Linux.

There are two important things to note, so please read on.

Everything you will read, all paths, and every setup aspect is written specifically for CentOS. I've tested these instructions on CentOS 5.5, but they should be applicable to other recent versions. If you need instructions for Ubuntu, please read that guide here.

Secondly, and this is extremely important, all commands throughout this post are assumed to be run as root. Some of the commands can be run without root, but most of them cannot. So please, log into your CentOS server using the root account, put sudo in front of every command, or run the su - root command (under a non-root account) before walking through the instructions.

Before we get going, here's a list of what I'll be covering:

  1. Creating a Linux user for ColdFusion
  2. Disabling SSH and FTP login for the coldfusion user account
  3. Installing the required libstdc++.so.5 C++ Library
  4. Running the ColdFusion installer
  5. Starting ColdFusion for the first time
  6. Installing the ColdFusion 9.0.1 updater
  7. Verifying the installation of 9.0.1
  8. Creating a new ColdFusion instance for general use
  9. Tweaking the JVM memory settings
  10. Hooking Apache and ColdFusion together
  11. Getting the Apache Connector running with selinux
  12. Locking down Apache
  13. Configuring ColdFusion to start on system boot

Continue Reading

Aaron West's Gravatar
About this post:

This entry was posted by Aaron West on February 7, 2011 at 8:14 AM. It was filed in the following categories: ColdFusion, Apache, Security, Linux. It has been viewed 239336 times and has 75 comments.

1 related blog entries

75 Responses to Super Guide: Installing ColdFusion 9 on CentOS Linux

  1. When creating the linux user you can simply run:
    useradd -s /sbin/nologin 'user'

    Saves you from having to manually edit the passwd file.

  2. Nice suggestion Andy, thanks!

  3. Having had to rebuild my linux server from scratch I was dreading the CF installation, Aaron this is a fantastic resource buddy well done and thanks!

    Simon

  4. @Simon - thanks for the kind words. And good luck with your next installation; hopefully this guide will be able to help you out.

  5. Hi aaron

    Your article has been a live saver so far but I am running into a problem after the Hook Apache and ColdFusion part. everything is going smooth however when I try an access the .cfm page my browser prompts me to download the file. It's like the connector did not work or something. I do have plesk installed do you think that would create any problems can you provide any insights?

  6. figured it out i needed to change the dev referance in to the name of my instance ...... thank you you are a life saver!

  7. Sandeep

    Thanks for saving my time.

    I am getting this error when i tried to access .cfm file :

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    httpd log says :

    [notice] jrApache[3792: 45723] Server has not been properly configured for JRun.

    Thanks,
    Sandeep

  8. Nick

    Really, really great tutorial. Generally, I try to follow these types of guides and end up stuck somewhere because the environments are different. Aside from the 'service' command (using mt), all was very tight!

  9. @Nick - thank you for the feedback, it makes the effort of putting together a detailed post worth it. Most of the online Linux guides I have seen leave much to be desired. Authors often assume you understand as much as them so they leave out critical pieces that make it near impossible to make progress.

    I try and do the exact opposite. It's not for everyone as it makes for much longer posts, but knowing folks like yourself find it useful makes it all worth it. Thanks again.

  10. Daryl

    Thanks for the terrific tutorial. I followed it to the "T" with making the service script but coldfusion won't auto start when I reboot... renamed the server instance and everything.

    What else could be preventing it from starting?

  11. Daryl, check the system logs to see if there are any error messages about the boot sequence. Also, are you using SELinux? If so, try turning it off permanently using the instructions in this post and reboot. Make sure you are following the instructions about editing the selinux config file, not the instructions about temporarily disabling SELinux.

    Finally, make sure the CF instance name in the boot script matches your real CF instance name and that the script was properly adding to the boot sequence with the chkconfig command.

  12. Daryl

    Bingo on the SELinux, turned it off and kept it off permanently, rebooted, works like a charm. Thanks, Aaron!

  13. @Daryl, that's great to hear. You've identified the issue being with SELinux, but I'd recommend you try and resolve why SELinux is preventing ColdFusion from starting on boot. Is it possible you missed one of the steps I outlined in the section on configuring ColdFusion, Apache, and SELinux? If you want to have your system run with SELinux enabled you could read through the instructions I wrote and see if you missed something. Your system will be more secure with SELinux running but it's certainly not a requirement.

  14. jairobg

    This is realy a Super Guide, I'm new for linux (and english) and is very easy follow the guide, tanks Aaron. I have a problem with the ajax framework, no error, no messages only not work. any idea?

  15. @jairobg4 Thanks for the kind words. I worked hard to make this guide useful and easy to follow. Can you give me more info about your Ajax framework issue? I'm not sure what you are referring to or what isn't working properly.

  16. jairobg

    Tanks Aaron for your answer... There is an application using cfwindow, cfdiv, cflayout, that works on local server But does not work in the new linux server, don't show the cfdiv content, don't show the cfwindow, and cflayout shows all content without the tabs or acordeon object. Checking javascritp in the page show "ReferenceError: ColdFusion is not defined".

  17. jairobg

    I fout some thing ... in IIS you need create virtual directory to CFIDE, in this place is the javascript library. (Insecure... I think... ) ok . Maybe .. in CentOs apache .. how I do that?

  18. Jace

    Hi Aaron, amazing tutorial, you got me up and running on my test machine with no problem. However, I seemed to have screwed up on another machine, how would you advise a newbie on the proper way to uninstall CF9 on Centos?

  19. @Jace Glad to hear you had some success. There's an uninstall script for ColdFusion located in the /opt/jrun4/bin directory on Linux (assuming you installed CF in the default location). You should run the script as root or as the same user who owns all the CF and JRun directories.

  20. Mevin Pothunnah

    That is the best ever tutorial on installing ColdFusion I have ever read. Thanks Aaron!!!!!!!!!

  21. Mevin, thank you for the kind words. Knowing folks like yourself enjoy the things I write about is why I spent so much time on each post.

  22. Aaron maybe you can help me. I installed Coldfusion, although not the multi server instance, using your guide. Everything appears to have gone correctly. The connector ran and updated my httpd.conf file. However when I surf to any .cfm file it says NOT FOUND, even though it is there. It is throwing a CF not found error, so apparently apache is handing the request off correctly to coldfusion.

    Any ideas?

    Kelly

  23. Mevin Pothunnah

    Do you have similar guide for installing Tomcat 7 on Centos?

  24. @Kelly - without looking at your system I'm unsure what the problem could be. There are several things that come to mind like path issues, permissions issues, or issues with how the connector configured itself. I'd troubleshoot with plain html files and a cfm file to see if you can verify the path is correct. An html file won't hit your ColdFusion server so you'll be able to test just Apache.

    @Mevin - I replied to the e-mail you sent me, but in case others come here wondering about Tomcat, I don't have any experience with it so I'm afraid I couldn't be of much help.

  25. @Aaron thanks I am using Virtualmin and it sets a different home directory. For whatever reason even though I specified the correct home directory, coldfusion still used the default. So I just moved all the home directories there and it works like a charm! :)

  26. Larry Lowe

    Aaron, Your a life savior this was so helpful, thanks you!! I do have two questions, 1) After the reboot I did a ps -ef|grep jrun and it returned "root 3146 1 8 22:13 ? 00:00:31 /opt/jrun4/bin/jrun -start dev" it looks like jrun is running as root instead of coldfusion did I miss something? 2) I'm a DBA by training who did a little CF when the version was 4.5 and have gotten drafted into CF development again so if you covered this elsewhere I'm sorry but can I get RDS working with CFEclipse with this setup and if so how?

    Thanks
    Larry

  27. @Larry - sorry the late reply. I thought my post covered having the start up script run as a specific user, such as the coldfusion user I created in the post. I see that is missing now. I'll update the post when I get a chance.

  28. Hi Aaron,

    Useful article! You've help me a lot today :)

    Thanks

  29. Aaron,

    Your guide was essential for getting me up and running on CentOS. All of the comments here about what a great service you've done in writing this are spot-on. Please keep up the great work!

  30. David J, thanks for letting me know the guide was useful to you and thanks for reading!

  31. Thanks for a great article.

    I was just going through this and ran into an error creating the apache connector..

    /usr/lib64/apr-1/build/libtool: line 970: gcc: command not found
    Error running "/opt/jrun4/lib/wsconfig/1/build_jrun22": exit code was 1
    apxs:Error: Command failed with rc=65536
    Could not build Apache2 web server connector from source. Use build script /opt/jrun4/lib/wsconfig/1/build_jrun22.

    This literally left Apache unusable. Since I have a couple skills (I know how to use google) I rooted around for a solution. The issue as quickly remedied by running:

    yum install libtool


    Thanks,

    --Dave

  32. @Dave - Did you have to install libtool and libstdc++.so.5 (mentioned in the post)? Curious as I've only ever had to install libstdc++.so.5 on CentOS for this process to work. What version of CentOS were you trying this on.. or was it CentOS?

  33. Yes.. I had to install both.

    The server is running: CentOS Linux release 6.0 (Final)

    --Dave

  34. I've not tested these instructions on CentOS 6, so perhaps the requirement of libtool is new and specific to v6.

  35. Well.. I can say that with the exception of needing to install libtool, the instructions worked just fine on CentOS 6.

  36. Awesome, thanks for the feedback Dave!

  37. Jean-Paul Claude

    I have CentOS 6, followed the directions & even the extras recommended by Dave Ferguson, however the install errors out with 27 NonFatalErrors and 1 Fatal Errors.

    I don't want to flood this post with the log file so I sent it to you via your "contact" form.

  38. Patrick

    Really a great tuto.

    I'm a CFM lover since more 10 years but not linux expert...

    Install on Centos5... perfect at first time...

    Thanks

  39. Anthony Webb

    One major gotcha I am hitting just now, wanted to see if anyone had any insight.

    I installed using the instructions, and it worked flawlessly.

    Problem was when I sent to apply my license key. It accepted my license key find, but I am now finding out that my $1300 license key wont work in a multiserver config like the tutorial recommends, I'll need the $7500 license!?

    I've got sufficient time into this build that I hate to have to do it again from scratch.

    Is there anyone out there who knows how to go from a multiserver config to a singel server config? Or if it is even possible?

  40. The guide looks great but before I start the install can anyone confirm that this will work with the coldfusion standard version?

  41. Anthony Webb

    @peter, yes it did work with CFStandard for us.

  42. @Anthony Webb, thanks for that, was there anything extra you had to do, or did just entering your licence key work?

  43. @Peter @Anthony - The topic of how licensing works in a multi-server installation is something we should explore further. I wrote these instructions without any respect to licensing ColdFusion 9. I have always purchased ColdFusion Enterprise and have always installed ColdFusion using the multi-server option. But honestly, I don't know if "ColdFusion Standard" requires any specific type of installation. Maybe someone else knows and can chime in.

    In the meantime I can ping my contacts at Adobe to get more information and report back.

  44. The install has worked a treat, thanks really good tutorial and very well written. I have had some nightmares installing ColdFusion in the past and this has made it an absolute breeze. But... When I try to enter a valid cf9 standard serial number into the "dev" instance I get the error "The Serial Number entered is not valid."

    Any ideas?

  45. @Peter @Anthony - I've received some initial input from Adobe's ColdFusion Product Manager regarding a CF Standard serial number being entered into a multi-instance installation. It sounds like this kind of setup should not work.

    By definition a CF Standard license does not give you the ability to have multiple instances, use cluster manager, and other things. While this certainly makes sense I was hoping you'd be able to install the multi-instance version of CF but ONLY create and use a single instance. But, it sounds like this won't work and Peter's latest comment seems to confirm this.

    I'm still waiting on a final clarification from Adobe so I'll post back if I learn anything else pertinent.

  46. Thanks Aaron, in theory do you think the install would still work if I just used cf standalone and selected "don't configure web server" during the installation process?

  47. The basic process will work, but some of the paths and commands will be different.

  48. I heard from Adobe again. The EULA for ColdFusion does not prevent you from using the multi-instance version of CF with a CF Standard license. But.. and this is a big but, you'd need to purchase multiple CF Standard licenses if you were going to have multiple instances. And this defeats the whole purpose of a multi-instance install.

    Long story short, buy an Enterprise license if you plan on using the multi-instance version of CF, the version I discuss in all my blog posts.

  49. Thx Aaron for taking the time! I plugged you on my own blog ;)

  50. Chee Wai

    I have installed CF9 Multi servers.
    How can I create the connector for both my main & instances so that I can have both Main & instance administrator login ??
    I only manage to create one connector in Apache...

  51. @Chee Wai - There's a section in the guide on this page where I talk about hooking Apache and ColdFusion. There I present a command that has several options. One of them is "-server" and the string following "-server" is the name of the ColdFusion instance you wish to hook to Apache. To hook multiple instances you simple run the command twice and change the name of the instance that follows "-server."

  52. Erik

    Install on Centos 5.8 (dedicated server with 16 go or ram), installation fine but at the and of CF 9 install before update to 901 I have :

    java.lang.OutOfMemoryError
       at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
       at java.io.UnixFileSystem.getBooleanAttributes(Unknown Source)
       at java.io.File.exists(Unknown Source)
       at jrun.deployment.WatchedOpenModule.changed(WatchedOpenModule.java:88)
       at jrun.deployment.DeployerService.redeployChanged(DeployerService.java:868)
       at jrun.deployment.DeployerService.run(DeployerService.java:888)
       at jrunx.scheduler.SchedulerService.invokeRunnable(SchedulerService.java:230)
       at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
       at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    08/04 17:14:04 user FileServlet: init

    I launched the cfadmin page, no problem and I have this message on my terminal :

    /opt/jrun4/bin/jrun status
    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create the Java virtual machine.

    Can I continu to uptade

    A idea ?
    Erik

  53. Erik, I wish I had more answers for you, but running out of memory during installation doesn't give me much to go on. If you were able to get CF9.0 installed and you can open the CF Administrator, I would then check to see how much RAM you have allocated to your CF instances via /opt/jrun4/lib/jvm.config. Bump it to 2GB or so based on my instructions in the Tweak JVM Memory Settings section. You'll want something like -Xms2048m -Xmx2048m.

    Second, restart CF and make sure the restart happens okay. If it does, try and open the CF Admin and make sure that works.

    If you don't have any issues I'd say you could move forward with the 9.0.x updates. After you get CF fully updated I'd revisit your JVM memory settings and tweak them if you don't really need 2GB.

  54. Erik

    Thanks Aaron, problem solve, but another problem.
    In fact its seems impossible to install connector.
    We speak about yum install httpd-deve, but impossible to install.
    I have this message :
    Setting up Install Process
    No package httpd-deve available.
    Nothing to do

    So when I continue the installation:
    /opt/jrun4/bin/wsconfig -ws Apache -dir /etc/httpd/conf -server dev -bin /usr/sbin/httpd -script /usr/sbin/apachectl -coldfusion -ws64 -v
    is not good for me because its not the same path, so I changed with the good path :
    /opt/jrun4/bin/wsconfig -ws Apache -dir /etc/httpd/conf -server dev -bin /usr/sbin/httpd -script /usr/local/apache/bin/apachectl -coldfusion -ws64 -v

    By default on CentOs the www root is not /var/www/ but usr/local/apache/htdocs, so I put index.cfm inside.

    I successfull install CF9 and 901, I have the admin page, not prob for cfusion or dev, but impossible to open cfm page.
    The connector not working.

    In fact impossible to do :
    # Set the Apache Connector to run in the same selinux security context as other Apache modules.
    chcon --reference=/etc/httpd/modules/mod_auth_basic.so /opt/jrun4/lib/wsconfig/1/mod_jrun22.so

    # Set the Apache Connector to use the proper selinux user security context
    chcon -u system_u /opt/jrun4/lib/wsconfig/1/mod_jrun22.so

    # Set the security file label of the jrunserver.store file to that of a regular static html file.
    # This eliminates errors in the Apache logs.
    chcon -R -h -t httpd_sys_content_t /opt/jrun4/lib/wsconfig/1/jrunserver.store

    # Configure selinux to allow scripts to connect to Apache
    setsebool -P httpd_can_network_connect=1

    because there is no mod_jrun22.so or other on my server.... why ?

    Erik

  55. Erik

    Thanks Aaron, problem solve, but another problem.
    In fact its seems impossible to install connector.
    We speak about yum install httpd-deve, but impossible to install.
    I have this message :
    Setting up Install Process
    No package httpd-deve available.
    Nothing to do

    So when I continue the installation:
    /opt/jrun4/bin/wsconfig -ws Apache -dir /etc/httpd/conf -server dev -bin /usr/sbin/httpd -script /usr/sbin/apachectl -coldfusion -ws64 -v
    is not good for me because its not the same path, so I changed with the good path :
    /opt/jrun4/bin/wsconfig -ws Apache -dir /etc/httpd/conf -server dev -bin /usr/sbin/httpd -script /usr/local/apache/bin/apachectl -coldfusion -ws64 -v

    By default on CentOs the www root is not /var/www/ but usr/local/apache/htdocs, so I put index.cfm inside.

    I successfull install CF9 and 901, I have the admin page, not prob for cfusion or dev, but impossible to open cfm page.
    The connector not working.

    In fact impossible to do :
    # Set the Apache Connector to run in the same selinux security context as other Apache modules.
    chcon --reference=/etc/httpd/modules/mod_auth_basic.so /opt/jrun4/lib/wsconfig/1/mod_jrun22.so

    # Set the Apache Connector to use the proper selinux user security context
    chcon -u system_u /opt/jrun4/lib/wsconfig/1/mod_jrun22.so

    # Set the security file label of the jrunserver.store file to that of a regular static html file.
    # This eliminates errors in the Apache logs.
    chcon -R -h -t httpd_sys_content_t /opt/jrun4/lib/wsconfig/1/jrunserver.store

    # Configure selinux to allow scripts to connect to Apache
    setsebool -P httpd_can_network_connect=1

    because there is no mod_jrun22.so or other on my server.... why ?

    Erik

  56. Masood Anwar

    Hi! Great post... but I am getting the following error... Help plz... thanks..

    /opt/jrun4/bin/wsconfig -ws Apache -dir /usr/local/apache2/conf -server dev -bin /usr/local/apache2/bin/httpd -script /usr/local/apache2/bin/apachectl -coldfusion -v
    Found JRun server cfusion at 127.0.0.1:2904
    Found JRun server dev at 127.0.0.1:2908
    Found JRun server admin at 127.0.0.1:2910
    Found JRun server samples at 127.0.0.1:2918
    Deleted directory /opt/jrun4/lib/wsconfig/1/.libs
    Deleted directory /opt/jrun4/lib/wsconfig/1
    Fedora release 17 (Beefy Miracle)
    Using Apache binary /usr/local/apache2/bin/httpd
    Server's Module Magic Number: 20120211:3. Supported major magic numbers on this platform are 20020628 and 20020903.
    Attempting to build connector from sources
    Server version: Apache/2.4.2 (Unix)
    Using Apache control script /usr/local/apache2/bin/apachectl
    Parsing Apache configuration file /usr/local/apache2/conf/httpd.conf
    Exec'ing chmod 777 /opt/jrun4/lib/wsconfig/1
    Set permission to 777 on /opt/jrun4/lib/wsconfig/1
    Exec'ing chmod +x /opt/jrun4/lib/wsconfig/1/build_jrun22
    Set permission to execute on /opt/jrun4/lib/wsconfig/1/build_jrun22
    Exec'ing /opt/jrun4/lib/wsconfig/1/build_jrun22
    /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/local/apache2/include -I/usr/include/apr-1 -I/usr/include/apr-1 -w -c -o /opt/jrun4/lib/wsconfig/1/mod_jrun22.lo /opt/jrun4/lib/wsconfig/1/mod_jrun22.c && touch /opt/jrun4/lib/wsconfig/1/mod_jrun22.slo
    /opt/jrun4/lib/wsconfig/1/mod_jrun22.c: In function 'init_apache_request':
    /opt/jrun4/lib/wsconfig/1/mod_jrun22.c:843:26: error: 'conn_rec' has no member named 'remote_addr'
    Error running "/opt/jrun4/lib/wsconfig/1/build_jrun22": exit code was 1
    apxs:Error: Command failed with rc=65536
    .
    Could not build Apache2 web server connector from source. Use build script /opt/jrun4/lib/wsconfig/1/build_jrun22.

  57. Sean

    Trying to get this to work... I cannot get the webserver connector to work. [centos 5.7, CF9.2 on a mediatemple dv ]

    I have all the tools http-devel, libtool etc installed, updated, verified etc.

    here is the error I get:


    ./build_jrun22
    /usr/share/build-1/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd -I/usr/include -I/usr/include -w -c -o /opt/coldfusion9/runtime/lib/wsconfig/1/mod_jrun22.lo /opt/coldfusion9/runtime/lib/wsconfig/1/mod_jrun22.c && touch /opt/coldfusion9/runtime/lib/wsconfig/1/mod_jrun22.slo
    sh: /usr/share/build-1/libtool: No such file or directory
    apxs:Error: Command failed with rc=8323072
    .
    /usr/lib64/httpd/build/instdso.sh SH_LIBTOOL='/usr/share/build-1/libtool' /opt/coldfusion9/runtime/lib/wsconfig/1/mod_jrun22.la /opt/coldfusion9/runtime/lib/wsconfig/1/
    /usr/share/build-1/libtool --mode=install cp /opt/coldfusion9/runtime/lib/wsconfig/1/mod_jrun22.la /opt/coldfusion9/runtime/lib/wsconfig/1//
    /usr/lib64/httpd/build/instdso.sh: line 54: /usr/share/build-1/libtool: No such file or directory
    apxs:Error: Command failed with rc=8323072
    .
    strip: '/opt/coldfusion9/runtime/lib/wsconfig/1/mod_jrun22.so': No such file


    something to do with the build directory...!! been googling for days trying to figure this out!

  58. Awesome guide Aaron ... much appreciated ... I'm running Debian Squeeze locally and the CF install was simple ...

    On production however I'm running CentOS 5.8 with WHM and cPanel and EasyApache @ hostgator and the install never worked ... I tried several times but I suspect there were some VPS controller settings that needed to be enabled to allow CF to run ...

    So I simply asked them to install CF for me it's was only $80 ... but Interestingly enough, though I referred to this guide for direction, they didn't setup a ColdFusion user and now my apps can't perform write - execute actions ... I spoke with them about it and they informed me this is a 'post-install' support issue and simply suggested changing my public_html/ directories to the nobody group ... tried that and it didn't work ... write and execute still can't be performed by CF as nobody has no privileges ...

    I'm hoping another 80 bucks and another take get things right ... if not I probably be looking for another VPS host ...

    my 2 cents ...

  59. Spent a few days reinstalling CF under as the coldfusion user ... for those interested here's the pain ...

    First off I'm running Server Edition so CF is installed as /opt/coldfusion9 ...

    Next ... I'm also on CentOS 5.8 Virtuozzo with WHM and cPanel ... cPanel doesn't support SELinux ... and uses EasyApache with Vhost block configs is in /usr/local/apache/conf/httpd.conf ... to support having CF work on different user accounts ... the Jrun vhost needs to be added to /usr/local/apache/conf/includes/pre_main_global.conf which is included at the top of the main httpd.conf ...

    Running wsconfig was a challenging proposition ... I was aware that I needed to have a proxy port for JRun on 51011 so I had requested that port be opened and my host opened that up ... that allowed Apache to communicate to JRun ... However ... I didn't do my homework well enough regarding other ports so wsconfig failed as it needed to have access localhost access to run ...

    Snooping around I found that the /opt/coldfusion9/runtime/servers/coldfusion/SERVER-INF/jndi.properties file shows a default listening port on localhost:2932 ... I found that the port was closed by running iptables -L -v -n ... so I requested the port opened and I was in business with ...

    ./wsconfig -server coldfusion -ws64 Apache -dir /usr/local/apache/conf -bin /usr/local/apache/bin/httpd -script /usr/local/apache/bin/apachectl -coldfusion -v

    Next I had a peculiar situation ... Apache is running a nobody on cPanel and using suPHP and suExec to run CGI as the target user:group ... As ColdFusion doesn't have that ability I had to figure a way to allow CF to run to the user accounts and leaving PHP happy ...

    Inter ACL ... By default ACL was installed so I ran yum and installed it ... then I had to set the facl control for the users accounts running CF ...

    find \( -type d -exec setfacl -m u:coldfusion:rwx '{}' ';' \) -o \( -type f -exec setfacl -m u:coldfusion:rw '{}' ';' \) ...

    Then to make suPHP happy for sites running CF and PHP I had to set the umask to 0002 and config suPHP to allow 0775 and 0664 while leaving the bits at 755 and 644 on the destination accounts ...

    All and all it was a cool experience ... that I don't feel like doing again ... Thanks for the great guide ... :-)

  60. Mike Rankin

    Have you tried this with CF10 yet? Any gotchas?

  61. @Edward - great write up. Most people don't stick with it when something goes wrong on Linux. Way to work through it and thanks for posting your process and progress.

  62. @Mike - I haven't used ColdFusion 10 at all so I can't speak to how to set it up on Linux or any machine for that matter.

  63. @Aaron ... TY ... I'm just glad there are quality posts like this out for the community ... I'd really like to see more CF support for nix based systems ... especially for desktop setups ... eh hem ... darwin kernel?

  64. I'm a CF guy form the days of Allaire but had never set up a Linux version. After three days, I would still be scratching my head and running Google searches without this awesome instruction set!

    I'm running the Stand Alone Server so I made a few tweaks and I can rebuild a box in a few minutes now!

    Thanks so much!

  65. Rajesh Mashirkar

    when i am giving this url : http://172.20.32.36:8300/CFIDE/administrator/index...
    It's giving me this error
    Aaron could you plz help me out ?
    java.lang.NullPointerException
       at java.lang.String.indexOf(Unknown Source)
       at java.lang.String.indexOf(Unknown Source)
       at jrun.servlet.session.SessionService.getUrlSessionID(SessionService.java:1097)
       at jrun.servlet.ForwardRequest.getRequestedSessionId(ForwardRequest.java:426)
       at jrun.servlet.ForwardRequest.isRequestedSessionIdValid(ForwardRequest.java:467)
       at jrun.servlet.ForwardRequest.getSession(ForwardRequest.java:344)
       at jrun.servlet.ForwardRequest.create(ForwardRequest.java:135)
       at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:253)
       at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
       at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
       at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
       at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

  66. @Rajesh - That is a very generic error so there's really no way for me to know what could be causing it. The only hint from the stack trace is something appears to be going on with sessions on your CF server. Have you changed anything in your CF Administrator with respect to sessions recently? Turned on J2EE sessions? Turned OFF J2EE sessions? Have you tried restarting your CF service to see if that helps? Tried using a different browser. These are just some things I would do if I were you. Good luck!

  67. Rajesh Mashirkar

    Thanks Aaron ,

    It was testing server so i have reinstalled it . Now it's running fine .

    By thw way thanks once again .........

  68. Prince

    Thank you for the good article.
    I got the error message below when I ran: # /opt/jrun4/bin/wsconfig -ws Apache -dir /etc/httpd/conf -server dev -bin /usr/sbin/httpd -script /usr/sbin/apachectl -coldfusion -ws64 -v
    ==============

    [root@cf9-1 ~]# /opt/jrun4/bin/wsconfig -ws Apache -dir /etc/httpd/conf -server dev -bin /usr/sbin/httpd -script /usr/sbin/apachectl -coldfusion -ws64 -v
    Found JRun server cfusion at 127.0.0.1:2904
    Found JRun server dev at 127.0.0.1:2908
    Deleted directory /opt/jrun4/lib/wsconfig/1/.libs
    Deleted directory /opt/jrun4/lib/wsconfig/1
    CentOS release 6.3 (Final)
    Using Apache binary /usr/sbin/httpd
    Server's Module Magic Number: 20051115:24. Supported major magic numbers on this platform are 20020628 and 20020903.
    Attempting to build connector from sources
    Server version: Apache/2.2.15 (Unix)
    Using Apache control script /usr/sbin/apachectl
    Parsing Apache configuration file /etc/httpd/conf/httpd.conf
    Exec'ing chmod 777 /opt/jrun4/lib/wsconfig/1
    Set permission to 777 on /opt/jrun4/lib/wsconfig/1
    Exec'ing chmod +x /opt/jrun4/lib/wsconfig/1/build_jrun22
    Set permission to execute on /opt/jrun4/lib/wsconfig/1/build_jrun22
    Exec'ing /opt/jrun4/lib/wsconfig/1/build_jrun22
    /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wformat-security -fno-strict-aliasing -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd -I/usr/include/apr-1 -I/usr/include/apr-1 -w -c -o /opt/jrun4/lib/wsconfig/1/mod_jrun22.lo /opt/jrun4/lib/wsconfig/1/mod_jrun22.c && touch /opt/jrun4/lib/wsconfig/1/mod_jrun22.slo
    /usr/lib64/apr-1/build/libtool: line 970: gcc: command not found
    Error running "/opt/jrun4/lib/wsconfig/1/build_jrun22": exit code was 1
    apxs:Error: Command failed with rc=65536
    .
    Could not build Apache2 web server connector from source. Use build script /opt/jrun4/lib/wsconfig/1/build_jrun22.

  69. Daniel

    Hey Aaron,

    I've followed all these steps, but every time I run: /opt/jrun4/bin/jrun status it says

    The cfusion server is not running
    The prod server is not running

    But yet both are running because I can access the CF Admins...

    And because of this, I can't issue start/stop commands because it thinks it's not running.

    Any ideas?

    CentOS 5.8/64 with CF 9.02

  70. @Daniel, I've seen that behavior before but I can't remember what the exact issue was. My hunch is it's related to the permissions of the jrun binary versus the user you are logging in as. Have you tried issuing the start/stop commands with sudo to see if you get different results. Also, have you tried rebooting? Rebooting shouldn't have _any_ affect on the behavior but it'd be interesting to see what happens. Finally, if you perform a long directory listing of /opt/jrun4/bin do all files have the same user/group?

    Just some thoughts, good luck.

  71. Daniel

    @Aaron, I believe it was my unqualified hostname, I set up a proper FQDN in /etc/vhosts and did the install again and it was successful. Thanks!

  72. Sandeep

    I have installed the CF9 over jonas. I keep getting following exceptions. Can any one help me in this?

    2014-01-17 19:08:18,613 : ApplicationContext.log : ColdFusionStartUpServlet: ColdFusion: application services are now available
    2014-01-17 19:08:18,671 : ApplicationContext.log : CFMxmlServlet: Macromedia Flex Build: 87315.134646
    01/17 19:08:18 INFO Macromedia Flex Build: 87315.134646
    01/17 19:08:19 [Thread-55] ERROR DDXM_S00004: Error creating JAXB Context
    javax.xml.bind.JAXBException: Unable to create context
    - with linked exception:
    [java.lang.NoSuchMethodException: com.sun.xml.bind.v2.ContextFactory.createContext(java.lang.String, java.lang.ClassLoader)]
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:75)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:77)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:73)
    at com.adobe.internal.ddxm.Executive.initContext(Executive.java:82)
    at com.adobe.internal.ddxm.Executive.<clinit>(Executive.java:74)
    at coldfusion.document.DocumentServiceImpl.callAssemblerInitFonts(DocumentServiceImpl.java:1249)
    at coldfusion.document.DocumentServiceImpl.initializeDocumentService(DocumentServiceImpl.java:230)
    at coldfusion.document.DocumentServiceImpl.access$000(DocumentServiceImpl.java:52)
    at coldfusion.document.DocumentServiceImpl$1.run(DocumentServiceImpl.java:180)
    Caused by: java.lang.NoSuchMethodException: com.sun.xml.bind.v2.ContextFactory.createContext(java.lang.String, java.lang.ClassLoader)
    at java.lang.Class.getMethod(Class.java:1605)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:72)
    ... 8 more
    **** MessageBrokerServlet in application 'Adobe ColdFusion 9' failed to initialize due to runtime exception: Exception: java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault cannot be cast to org.apache.xml.dtm.DTMManager
    at org.apache.xml.dtm.DTMManager.newInstance(DTMManager.java:137)
    at org.apache.xpath.XPathContext.<init>(XPathContext.java:102)
    at org.apache.xpath.CachedXPathAPI.<init>(CachedXPathAPI.java:77)
    at flex.messaging.config.ApacheXPathServerConfigurationParser.initializeExpressionQuery(ApacheXPathServerConfigurationParser.java:43)
    at flex.messaging.config.AbstractConfigurationParser.parse(AbstractConfigurationParser.java:68)
    at flex.messaging.config.FlexConfigurationManager.getMessagingConfiguration(FlexConfigurationManager.java:79)
    at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:109)
    at coldfusion.flex.ColdFusionMessageBrokerServlet.init(ColdFusionMessageBrokerServlet.java:78)
    at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:94)
    at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:59)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4420)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)
    at org.ow2.jonas.web.tomcat6.JOnASStandardContext.start(JOnASStandardContext.java:312)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
    at org.ow2.jonas.web.tomcat6.Tomcat6Service.__doRegisterWar(Tomcat6Service.java:764)
    at org.ow2.jonas.web.tomcat6.Tomcat6Service.doRegisterWar(Tomcat6Service.java)
    at org.ow2.jonas.web.base.BaseWebContainerService.registerWar(BaseWebContainerService.java:1003)
    at org.ow2.jonas.web.base.BaseWebContainerService.deployWars(BaseWebContainerService.java:1740)
    at org.ow2.jonas.ear.internal.EarDeployer.deployWARs(EarDeployer.java:1106)
    at org.ow2.jonas.ear.internal.EarDeployer.doDeploy(EarDeployer.java:782)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:96)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:95)
    at org.ow2.util.execution.helper.RunnableHelper.execute(RunnableHelper.java:77)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer.deploy(AbsDeployer.java:94)
    at org.ow2.util.ee.deploy.impl.deployer.DeployerManager.deploy(DeployerManager.java:129)
    at org.ow2.jonas.deployablemonitor.DeployableMonitor.detectNewArchives(DeployableMonitor.java:490)
    at org.ow2.jonas.deployablemonitor.DeployableMonitor.checkNewArchives(DeployableMonitor.java:306)
    at org.ow2.jonas.deployablemonitor.DeployableMonitor.run(DeployableMonitor.java:216)

    javax.servlet.ServletException: java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault cannot be cast to org.apache.xml.dtm.DTMManager
    at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:184)
    at coldfusion.flex.ColdFusionMessageBrokerServlet.init(ColdFusionMessageBrokerServlet.java:78)
    at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:94)
    at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:59)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4420)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)
    at org.ow2.jonas.web.tomcat6.JOnASStandardContext.start(JOnASStandardContext.java:312)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
    at org.ow2.jonas.web.tomcat6.Tomcat6Service.__doRegisterWar(Tomcat6Service.java:764)
    at org.ow2.jonas.web.tomcat6.Tomcat6Service.doRegisterWar(Tomcat6Service.java)
    at org.ow2.jonas.web.base.BaseWebContainerService.registerWar(BaseWebContainerService.java:1003)
    at org.ow2.jonas.web.base.BaseWebContainerService.deployWars(BaseWebContainerService.java:1740)
    at org.ow2.jonas.ear.internal.EarDeployer.deployWARs(EarDeployer.java:1106)
    at org.ow2.jonas.ear.internal.EarDeployer.doDeploy(EarDeployer.java:782)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:96)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:95)
    at org.ow2.util.execution.helper.RunnableHelper.execute(RunnableHelper.java:77)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer.deploy(AbsDeployer.java:94)
    at org.ow2.util.ee.deploy.impl.deployer.DeployerManager.deploy(DeployerManager.java:129)
    at org.ow2.jonas.deployablemonitor.DeployableMonitor.detectNewArchives(DeployableMonitor.java:490)
    at org.ow2.jonas.deployablemonitor.DeployableMonitor.checkNewArchives(DeployableMonitor.java:306)
    at org.ow2.jonas.deployablemonitor.DeployableMonitor.run(DeployableMonitor.java:216)
    Caused by: java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault cannot be cast to org.apache.xml.dtm.DTMManager
    at org.apache.xml.dtm.DTMManager.newInstance(DTMManager.java:137)
    at org.apache.xpath.XPathContext.<init>(XPathContext.java:102)
    at org.apache.xpath.CachedXPathAPI.<init>(CachedXPathAPI.java:77)
    at flex.messaging.config.ApacheXPathServerConfigurationParser.initializeExpressionQuery(ApacheXPathServerConfigurationParser.java:43)
    at flex.messaging.config.AbstractConfigurationParser.parse(AbstractConfigurationParser.java:68)
    at flex.messaging.config.FlexConfigurationManager.getMessagingConfiguration(FlexConfigurationManager.java:79)
    at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:109)
    ... 25 more
    2014-01-17 19:08:23,501 : ApplicationContext.log : failed to load: coldfusion.flex.ColdFusionMessageBrokerServlet
    2014-01-17 19:08:23,502 : StandardContext.loadOnStartup : Servlet /cfusion.ear threw load() exception
    java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault cannot be cast to org.apache.xml.dtm.DTMManager
    at org.apache.xml.dtm.DTMManager.newInstance(DTMManager.java:137)
    at org.apache.xpath.XPathContext.<init>(XPathContext.java:102)
    at org.apache.xpath.CachedXPathAPI.<init>(CachedXPathAPI.java:77)
    at flex.messaging.config.ApacheXPathServerConfigurationParser.initializeExpressionQuery(ApacheXPathServerConfigurationParser.java:43)
    at flex.messaging.config.AbstractConfigurationParser.parse(AbstractConfigurationParser.java:68)
    at flex.messaging.config.FlexConfigurationManager.getMessagingConfiguration(FlexConfigurationManager.java:79)
    at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:109)
    at coldfusion.flex.ColdFusionMessageBrokerServlet.init(ColdFusionMessageBrokerServlet.java:78)
    at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:94)
    at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:59)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4420)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)
    at org.ow2.jonas.web.tomcat6.JOnASStandardContext.start(JOnASStandardContext.java:312)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
    at org.ow2.jonas.web.tomcat6.Tomcat6Service.__doRegisterWar(Tomcat6Service.java:764)
    at org.ow2.jonas.web.tomcat6.Tomcat6Service.doRegisterWar(Tomcat6Service.java)
    at org.ow2.jonas.web.base.BaseWebContainerService.registerWar(BaseWebContainerService.java:1003)
    at org.ow2.jonas.web.base.BaseWebContainerService.deployWars(BaseWebContainerService.java:1740)
    at org.ow2.jonas.ear.internal.EarDeployer.deployWARs(EarDeployer.java:1106)
    at org.ow2.jonas.ear.internal.EarDeployer.doDeploy(EarDeployer.java:782)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:96)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:95)
    at org.ow2.util.execution.helper.RunnableHelper.execute(RunnableHelper.java:77)
    at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer.deploy(AbsDeployer.java:94)
    at org.ow2.util.ee.deploy.impl.deployer.DeployerManager.deploy(DeployerManager.java:129)
    at org.ow2.jonas.deployablemonitor.DeployableMonitor.detectNewArchives(DeployableMonitor.java:490)
    at org.ow2.jonas.deployablemonitor.DeployableMonitor.checkNewArchives(DeployableMonitor.java:306)
    at org.ow2.jonas.deployablemonitor.DeployableMonitor.run(DeployableMonitor.java:216)
    2014-01-17 19:08:24,116 : BaseWebContainerService.registerWar : War cfusion.war available at the context /cfusion.ear.
    2014-01-17 19:08:24,612 : BaseWebContainerService.registerWar : War rds.war available at the context /CFIDE.
    2014-01-17 19:08:24,686 : EarDeployer.doDeploy : 'cfusion.ear' EAR Deployable is now deployed
    2014-01-17 19:08:25,242 : J2EEServer.__info : JOnAS AS v5.2.0 named 'jonas' RUNNING

  73. Talk to at least three different decorators and obtain general quotes.
    If there is a difference between a highway motel setting and a high class hotel lounge.
    How about a shower curtain top with an interesting pattern,
    print or picture can diarrhea in early pregnancy act like a frame.


    Also visit my web site: <a href="http://new.ped1.gr/news/pregnancy-much-better-thes... more</a>

  74. I don't know whether it's just me or if everyone else encountering
    issues with your blog. It seems like some of the text within your content
    are running off the screen. Can somebody else please comment and let me know if this is
    happening to them as well? This could be a problem with my
    browser because I've had this happen before. Cheers

  75. It's a shame you don't have a donate button! I'd
    definitely donate to this outstanding blog! I suppose for now i'll settle for
    bookmarking and adding your RSS feed to my Google account.
    I look forward to new updates and will share this website
    with my Facebook group. Talk soon!