Wednesday, April 8, 2009

Changing the user of Coldfusion on Linux

I made the mistake of setting up Coldfusion 8 on a linux system (centOS) with the user set as 'nobody'. This proved to be a big mistake when it came to using tags like cffile to write to the filesystem. I had a hunt around for some info on how to do this with Adobe suggesting a reinstall of coldfusion

To change the user running coldfusion to the same as the owner of the web directory I completed the following steps.

1. vi /etc/init.d/coldfusion_8 then change the runtime user to the same as the user of your web folder
2. vi /etc/init.d/cfsearch8 then change the runtime user to the same as the user of your web folder
3. vi /opt/coldfusion8/bin/coldfusion then change the runtime user to the same as the user of your web folder
4. chown -R /opt/coldfusion8 name_of_new_runtimeuser

This allowed me to then use cffile to copy files to my server, however I was still running into a minor problem with the image functions of Coldfusion. Thanks to Ben Nadal who has a note on installing a hot fix to solve this problem.