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

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

Guest
Oct 25, 2009 Oct 25, 2009

Copy link to clipboard

Copied

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.

Views

6.3K

Translate

Translate

Report

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
Community Beginner ,
Oct 25, 2009 Oct 25, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Community Beginner ,
Oct 25, 2009 Oct 25, 2009

Copy link to clipboard

Copied

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/

Votes

Translate

Translate

Report

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
Oct 25, 2009 Oct 25, 2009

Copy link to clipboard

Copied

I have been running CF9 without incident on snow leopard (built in apache) since it was released.  It works flawlessly.  The only difference is that now I am using snow leopard server and am seeing this behavior.  Must be something small.  Perhaps I missed something and 10.6 OSX server is not fully supported?  For some reason I find that hard to believe, particularly since no such disclaimer was there when I bought the product.

Votes

Translate

Translate

Report

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
LEGEND ,
Oct 25, 2009 Oct 25, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Oct 26, 2009 Oct 26, 2009

Copy link to clipboard

Copied

I guess the frustrating part for me is that this is literally a stock config.  Brand new osx server, default apache, default CF9 install.  No funky configurations or anything.

If I would have wanted to spend my weekend digging around conf files and starting and stopping system services trying to make stuff work, I would have saved myself the money and installed an open source OS and an open source CFML engine instead of paying for something commercial.

Votes

Translate

Translate

Report

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
Contributor ,
Oct 26, 2009 Oct 26, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Participant ,
Oct 26, 2009 Oct 26, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
LEGEND ,
Oct 26, 2009 Oct 26, 2009

Copy link to clipboard

Copied

@Ken:

Which part of that config specifically controls whether default document URLs are passed to CF, as opposed to file-based ones?  I can't see anything in there that would differentiate between the two.  According to the OP's first post, Apache is connecting to CF OK other than when it's the default document.

@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.

@ievolve

Can you confirm you're running the 64-bit version of 10.6.  I dunno if there are 32- and 64-bit versions, but the system requirements sheet specifically mentions 64-bit which implies to me that if there's a 32-bit version, it's not supported.

Did you check the behaviour in other virtual directories or the main webroot (as per my suggestion).

Also: I think you've got to come to grips with the fact that this isn't a perfect world, and sometimes things go wrong.

--

Adam

Votes

Translate

Translate

Report

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
Participant ,
Oct 26, 2009 Oct 26, 2009

Copy link to clipboard

Copied

@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.

Votes

Translate

Translate

Report

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
Advocate ,
Oct 26, 2009 Oct 26, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
LEGEND ,
Oct 26, 2009 Oct 26, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Participant ,
Oct 26, 2009 Oct 26, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
Oct 27, 2009 Oct 27, 2009

Copy link to clipboard

Copied

Thanks for all the suggestions guys.  I have returned my OSX server and am replacing with a standard snow leopard install.  I never got to the root of the issue.  It is likely due to an apache config issue, the apache configs are much different in osx and osx server.  But I ran out of patience trying to get it working.  Hopefully someone else can come along and solve this one.

Votes

Translate

Translate

Report

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 04, 2009 Nov 04, 2009

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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
Documentation