Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make cfimage work with ColdFusion 10 on Apache?

I just upgraded from ColdFusion9 to ColdFusion10 on OS X running the included Apache web server. Now all of my images that I was writing to the browser using cfimage with the writeToBrowser option throw 404 errors.

Under CF9, I had previously set my web server up to use a few virtual directories with a self-signed cert to enable SSL. I don't think SSL is part of the problem, but the more you know, the better.

It looks like there is just a missing mapping of some sort that doesn't get made during the installation process (which I've done a few times with the same results).

I tried adding an alias to the CFFileServlet directory which changed my 404s to 403s, but I am unsure what to do to correct that since all of the filesystem properties show read for everybody.

Is there some guidance out there on how to set up the virtual directories to make the CFFileServlet location work in my websites?

If I look in the actual directory, the files are getting created there correctly.

Here is a sample of what's in my virtualHosts file:

    <VirtualHost *:80>
        DocumentRoot "/Library/WebServer/Documents/xxxxxxxxxx"
        ServerName xxxxxxxxxx.local
        DirectoryIndex index.cfm
        Options FollowSymLinks
        Alias /CFIDE /Library/WebServer/Documents/CFIDE
        Alias /mxunit /Library/WebServer/Documents/mxunit

        RewriteEngine On
        RewriteCond %{HTTPS} off

        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

    </VirtualHost>

    <VirtualHost *:443>
        SSLEngine on
        SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
        SSLCertificateFile /etc/apache2/ssl/xxxxxxxxxx.crt
        SSLCertificateKeyFile /etc/apache2/ssl/xxxxxxxxxx.key

        DocumentRoot "/Library/WebServer/Documents/xxxxxxxxxx"
        ServerName xxxxxxxxxx.local
        DirectoryIndex index.cfm
        Options FollowSymLinks
        Alias /CFIDE /Library/WebServer/Documents/CFIDE
        Alias /mxunit /Library/WebServer/Documents/mxunit
    </VirtualHost>

Thanks in advance.

like image 927
anopres Avatar asked Feb 21 '23 07:02

anopres


1 Answers

After much trial and error and looking at the post on Ben Nadel's site, I finally got this working. I decided to put this in the mod_jk.conf file that the CF10 install creates so I could keep all the cf specific stuff together. At the bottom of the file I added an alias and set the permissions on the location as so:

Alias /CFFileServlet "/Applications/ColdFusion10/cfusion/tmpCache/CFFileServlet"
<Directory "/Applications/ColdFusion10/cfusion/tmpCache/CFFileServlet">
  Options Indexes FollowSymLinks
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>

After doing that, all my images lit right up.

I'm going to mark this entry as the answer since it has the details about how to get this working, but I'll award the bounty to Kevin for pointing me in the right direction. Thanks Kevin!

like image 74
anopres Avatar answered Feb 22 '23 21:02

anopres