Skip navigation
Currently Being Moderated

Why must urls end in .cfm to get coldfusion to process the file?

Oct 25, 2009 10:59 AM

I have newly installed coldfusion 9 on OSX SnowLeopard Server (10.6) sitting on the default Apache2.2 that comes bundled in osx server.

 

If I go to:

http://127.0.0.1/CFIDE/administrator/index.cfm

>> I get the admin just fine, can browse around the admin etc.

 

If I go to:

http://127.0.0.1/CFIDE/administrator/

>> I see the source code for index.cfm in plain text

 

As you can see, index.cfm is set to be the default handler, it's just that unless coldfusion sees ".cfm" as the extension it will simple dump the page as plain text.

 

Any ideas?  I obviously would like to not have to have my users specify www.website.com/index.cfm if they want to see the website, and further, letting them see the sourcecode of the page is not cool at all.

 
Replies
  • Currently Being Moderated
    Oct 25, 2009 12:13 PM   in reply to ievolve

    I think this is more down to an IIS configuration than ColdFusion, have you setup your default documents correctly? what IIS are you running> If you are running IIS7 it requires a little more configuration see: http://forums.iis.net/t/1005992.aspx

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 25, 2009 12:23 PM   in reply to ievolve

    sorry I see your running under OS X Snow Leopard. I am not sure if CF9 runs under Snow Leopard I know the beta had some issues with mapping.  CF8 this helped a few guys I knew setting up CF on Mac

     

    http://www.flyingtroll.com/2009/09/coldfusion-8-on-snow-leopard/

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 25, 2009 5:56 PM   in reply to ievolve

    I don't know anything about Macs, but according to the sytem requirements table (http://www.adobe.com/products/coldfusion/systemreqs/), OS X 10.6 is supported on 64-bit systems.

     

    Note that it sounds to me like it's Apache not passing the requests to CF when they're not specifically qualified with .cfm extension, rather than CF not handling them properly.  This makes little difference to your situation, but I'd be examining the Apache end of things rather than the CF end of things.

     

    Have a gander @ the alias settings for /CFIDE to see if there's anything amiss.

     

    Do you have the same symptoms for files in the webroot, or in other aliased directories?

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 26, 2009 12:17 PM   in reply to ievolve

    I am not running server but when you installed CF9 did it add the following to your httpd.conf file?

     

    # JRun Settings
    LoadModule jrun_module /Applications/ColdFusion9/runtime/lib/wsconfig/1/mod_jrun22.so
    <IfModule mod_jrun22.c>
        JRunConfig Verbose false
        JRunConfig Apialloc false
        JRunConfig Ignoresuffixmap false
        JRunConfig Serverstore /Applications/ColdFusion9/runtime/lib/wsconfig/1/jrunserver.store
        JRunConfig Bootstrap 127.0.0.1:51800
        #JRunConfig Errorurl url <optionally redirect to this URL on errors>
        #JRunConfig ProxyRetryInterval 600 <number of seconds to wait before trying to reconnect to unreachable clustered server>
        #JRunConfig ConnectTimeout 15 <number of seconds to wait on a socket connect to a jrun server>
        #JRunConfig RecvTimeout 300 <number of seconds to wait on a socket receive to a jrun server>
        #JRunConfig SendTimeout 15 <number of seconds to wait on a socket send to a jrun server>
        AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
    </IfModule>

    Ken Ford

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 26, 2009 12:30 PM   in reply to ievolve

    In your http.conf file you need to add index.cfm to the DirectoryIndex section. This tells apache to server up that page when it is just pointed to a directory. This should solve your problem.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 26, 2009 1:06 PM   in reply to John Sieber
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 26, 2009 1:14 PM   in reply to Adam Cameron.

    @900spg:

    But the default doc clearly is set to index.cfm: it's being served by Apache, it's just that Apache isn't first passing it to CF.

     

    I'm pretty sure I had this problem with my Railo/Apache setup on a WindowsXP box and it was the Directoryindex setting in my http.conf but I could be wrong. Worth checking at any rate.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 26, 2009 2:02 PM   in reply to John Sieber

    When I re-read the OP, it doesn't appear that index.cfm is set to be a default file served by Apache.

     

    I have newly installed coldfusion 9 on OSX SnowLeopard Server (10.6) sitting on the default Apache2.2 that comes bundled in osx server.

     

    If I go to:

    http://127.0.0.1/CFIDE/administrator/index.cfm

    >> I get the admin just fine, can browse around the admin etc.

     

     

    If I go to:

    http://127.0.0.1/CFIDE/administrator/

    >> I see the source code for index.cfm in plain text

     

    As you can see, index.cfm is set to be the default handler, it's just that unless coldfusion sees ".cfm" as the extension it will simple dump the page as plain text.

     

     

    I think there might be a bit of confusion centered on the OP's "As you can see" sentence. Because Apache is serving up CFML files does not mean that a default file is set to be served/accessed. Processing CFML only means that the JRun module is loaded by Apache and the appropriate file handlers for CFM, CFML, and CFC are added to the httpd.conf (as shown in Ken's post).

     

    If Apache is to serve up an index.cfm file (or whatever you want your default file called) without explicitly declaring it in the URL, there has to be a default document (DirectoryIndex) explicitly declared in the httpd.conf (or your httpd-vhosts.conf file, if you're using Virtual Hosts).

    # In httpd.conf, you need to at least make sure that you see this:
    <IfModule dir_module>
        DirectoryIndex index.html index.htm index.php index.cgi index.cfm
    </IfModule>
    
    # If you're using virtual hosts, I think it's advisable to make sure that 
    # index.cfm is declared in your VirtualHost tag
    <VirtualHost *:80>
    ServerName dev.vhost.cf
    ServerAlias dev.vhost.cf
    DirectoryIndex index.cfm index.html index.htm
    DocumentRoot /Users/yourpathtothe/Sites/site_folder
    </VirtualHost>
    

     

    From a re-read of the OP, I think @900spg has the right idea ... perhaps there's another issue lurking there but it seems that verifying index.cfm is specified in the DirectoryIndex declaration is a good step.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 26, 2009 2:20 PM   in reply to craigkaminsky

    craigkaminsky wrote:

     

    When I re-read the OP, it doesn't appear that index.cfm is set to be a default file served by Apache.

     

     

    If I go to:

    http://127.0.0.1/CFIDE/administrator/

    >> I see the source code for index.cfm in plain text

     

    Even when you read the bit (included above) in which they explicitly say that index.cfm is being served up as the default doc?

     

    Hmmm.  OK.

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 26, 2009 2:57 PM   in reply to Adam Cameron.

    Not to argue but I think it is serving up the source as it does not know what to do with the file. I had this happen to me and I'm pretty sure I resolved it by finxing the DirectoryIndex line in my http.conf.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 4, 2009 9:41 AM   in reply to ievolve

    Been having the same problem. I solved the problem by adding

    AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf

    to the bottom of the <IfModule mod_jrun22.c> directive at the bottom of /etc/apache2/httpd.conf

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points