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.
Wednesday, April 8, 2009
Friday, March 13, 2009
Forbidden 403 Error after installing phpMyAdmin
After I had installed phpMyAdmin (in my case centos, using YUM) I received a 403 forbidden error. By default phpmyadmin installed path is /usr/share/phpmyadmin and the apache configuration file is located in /etc/httpd/conf.d/phpmyadmin.conf.
To fix:
vi /etc/httpd/conf.d/phpmyadmin.conf
Remove or comment these lines
#Order Allow,Deny
#Deny from all
Allow from 127.0.0.1
Restart the apache server.
/etc/init.d/httpd restart
You should be able to see phpmyadmin working by going to http://ipaddress/phpmyadmin
To fix:
vi /etc/httpd/conf.d/phpmyadmin.conf
Remove or comment these lines
#Order Allow,Deny
#Deny from all
Allow from 127.0.0.1
Restart the apache server.
/etc/init.d/httpd restart
You should be able to see phpmyadmin working by going to http://ipaddress/phpmyadmin
Tuesday, March 10, 2009
Resizing a Amazon EBS Volume
I struggled to find the answer to resizing an existing Amazon Elastic Block Store Volume.
Here is how I resolved this
1. Created a snapshot of the existing volume (log into Amazons Console for this https://console.aws.amazon.com)
2. Create a new volume based on the snapshot
3. Attach this new volume to my Amazon Instance (after detaching the other volume)
4. SSH into my Amazon Instance
5. Enter the following, this checks the integrity of the disk 'e2fsck -f /dev/sdf'
6. Enter the following 'resize2fs /dev/sdf'
7. Mount the volume 'mount /dev/sdf /mnt/data-store'
Here is how I resolved this
1. Created a snapshot of the existing volume (log into Amazons Console for this https://console.aws.amazon.com)
2. Create a new volume based on the snapshot
3. Attach this new volume to my Amazon Instance (after detaching the other volume)
4. SSH into my Amazon Instance
5. Enter the following, this checks the integrity of the disk 'e2fsck -f /dev/sdf'
6. Enter the following 'resize2fs /dev/sdf'
7. Mount the volume 'mount /dev/sdf /mnt/data-store'
Friday, February 20, 2009
Arrow and delete keys not working in VMWare on Ubuntu
Browse to the hidden directory inside your home directory
.vmware
then create the following file
config
and copy the following info into the file
xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0x149 # Prior
xkeymap.keycode.117 = 0x151 # Next
xkeymap.keycode.78 = 0x46 # Scroll_Lock
xkeymap.keycode.127 = 0x100 # Pause
xkeymap.keycode.133 = 0x15b # Meta_L
xkeymap.keycode.134 = 0x15c # Meta_R
xkeymap.keycode.135 = 0x15d # Menu
.vmware
then create the following file
config
and copy the following info into the file
xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0x149 # Prior
xkeymap.keycode.117 = 0x151 # Next
xkeymap.keycode.78 = 0x46 # Scroll_Lock
xkeymap.keycode.127 = 0x100 # Pause
xkeymap.keycode.133 = 0x15b # Meta_L
xkeymap.keycode.134 = 0x15c # Meta_R
xkeymap.keycode.135 = 0x15d # Menu
Subclipse and Eclipse on Ubuntu
Install libsvn-java
The package libsvn-java contains JavaHL.
Install libsvn-java by typing the following into a command line:
sudo apt-get install libsvn-java
then make sure you add the following to your Eclipse launcher parameters (ie add it to the end of the shortcut to eclipse):
-vmargs -Djava.library.path=/usr/lib/jni
Restart Eclipse.
The package libsvn-java contains JavaHL.
Install libsvn-java by typing the following into a command line:
sudo apt-get install libsvn-java
then make sure you add the following to your Eclipse launcher parameters (ie add it to the end of the shortcut to eclipse):
-vmargs -Djava.library.path=/usr/lib/jni
Restart Eclipse.
Wednesday, April 16, 2008
Adding a Column to JSON using Coldfusion8
I use Spry to output a lot of queries that I use in my projects.
So I call my coldfusion function from Spry
There are a couple of things to note here, first of I am using Coldfusion 8's new returnFormat=json to return the query that resides in my function, as well as this I am also using queryFormat=column. Finally I have added on a date string to prevent browsers such as IE6 from caching the request.
So based on the above I can return my query as JSON, however I found that any dates were being returned in a fairly ugly way eg. March 21, 2008 00:00:00. I wanted to remove the dates and on consulting with a couple of people I came to the conclusion that doing this in Javascript would not be the best solution so I added the following after the query in my function.
This created an additional column in the JSON that was returned, and I could now display the date as I wanted to.
So I call my coldfusion function from Spry
var ts = new Date();
var spry_ContactList = new
Spry.Data.JSONDataSet("module_contacts.cfc?method=qry_ContactsList &returnFormat=json& queryFormat=column&TS=" + ts.toString(),{path:"DATA", pathIsObjectOfArrays:true});
There are a couple of things to note here, first of I am using Coldfusion 8's new returnFormat=json to return the query that resides in my function, as well as this I am also using queryFormat=column. Finally I have added on a date string to prevent browsers such as IE6 from caching the request.
So based on the above I can return my query as JSON, however I found that any dates were being returned in a fairly ugly way eg. March 21, 2008 00:00:00. I wanted to remove the dates and on consulting with a couple of people I came to the conclusion that doing this in Javascript would not be the best solution so I added the following after the query in my function.
<cfset tempArr = arrayNew(1) />
<cfloop query="qry_ContactsList">
<cfset arrayAppend(tempArr, "#DateFormat(qry_ContactsList.visitdate,'dd-mm-yyyy')#")/>
</cfloop>
<cfset qry_ContactsList.addColumn("PRETTYDATE", tempArr) />
This created an additional column in the JSON that was returned, and I could now display the date as I wanted to.
Tuesday, April 15, 2008
Change the Date and Timezone in Centos
Log into your server then retrieve the current date and timezone by typing in
all timezone information is stored at /usr/share/zoneinfo you can browse to this by typing
you should see a list of all the available timezones including folders for countries which have multiple time zones eg. America
so to change the time zone just enter the following
If you then want to manually set the time to 30/03/2008 09:57, the format to enter the date is 'mmddhhmmyyyy'
The following command will update your hardware clock
And now when you type in 'date' you should see an up to date clock
date
all timezone information is stored at /usr/share/zoneinfo you can browse to this by typing
cd /usr/share/zoneinfo
you should see a list of all the available timezones including folders for countries which have multiple time zones eg. America
so to change the time zone just enter the following
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
If you then want to manually set the time to 30/03/2008 09:57, the format to enter the date is 'mmddhhmmyyyy'
033009572008
The following command will update your hardware clock
hwclock --systohc
And now when you type in 'date' you should see an up to date clock
Subscribe to:
Posts (Atom)