By Rupert
Posts tagged coldfusion
Installing CFMX7 on CentOS5
Jul 24th
1. You need to install libXpm beforehand to save time in the Graphing Service Error Problems.
rpm -ivh libXpm-3.5.5-3.i386.rpm
2. Modify the installer.
cat coldfusion-702-linux.bin.backup | sed “s/export LD_ASSUME/#xport LD_ASSUME/” > coldfusion-702-linux.bin
Reference: http://www.billmitchell.org/coldfusion/centos5/mx7_apache.php
POST-INSTALL
1. Disable Verity search if you don’t use it.
chkconfig cfmx7search off
ColdFusion Threads, Memory, etc
Jun 21st
Why is there a lot of CF threads when i do a `ps`?
From Adobe’s Technote..
Due to the way Linux handles processes, the kernel spawns several processes for each of the Java Virtual Machine (JVM or JRE) worker threads. Since ColdFusion MX is calling/controlling the JVM, these processes are owned by ColdFusion MX. It is normal, for example, to see 35 processes after ColdFusion MX startup using ‘pstree’. Under load, this number could be 100 or more.
How do I completely monitor the memory usage of CF?
Pete wrote a short cfm script to access the java memory.. Here is the sample output:
% of Free Allocated Memory: 14%
% of Available Memory Allocated: 11%
Free Allocated Memory: 15mb
Total Memory Allocated: 107mb
Max Memory Available to JVM: 986mb
Once the Total Memory reaches the Max Memory, then the jvm has allocated all of its allocateable memory. Here’s a demo.
Hiding and protecting CFM
Jun 8th
With recent client developments, I fiddled my way on how to protect IPR of my cfc/cfm source codes. Two tasks in mind was to hide the cfm extension from Apache and precompile the CF source files (cfm/cfc).
Hiding the cfm extension courtesy of PeterBell
1. Add the desired extension in httpd.conf
# JRun Settings
LoadModule jrun_module "D:/CFusionMX7/runtime/lib/wsconfig/1/mod_jrun22.so"
<ifmodule>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ssl false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore "D:/CFusionMX7/runtime/lib/wsconfig/1/jrunserver.store"
JRunConfig Bootstrap 127.0.0.1:51011
#JRunConfig Errorurl <optionally>
#JRunConfig ProxyRetryInterval 600
#JRunConfig ConnectTimeout 15
#JRunConfig RecvTimeout 300
#JRunConfig SendTimeout 15
AddHandler jrun-handler .cfm .cfml .cfc .cfr .cfswf .rup
</optionally>
</ifmodule>2. In C:\CFusionMX7\wwwroot\WEB-INF\web.xml
<servlet -mapping id="macromedia_mapping_14"> </servlet><servlet -name>CfmServlet</servlet> <url -pattern>*.rup</url>
3. Restart Apache and ColdFusion.
Re-compile templates for sourceless deployment..
1. Applications can now be distributed without the underlying source code. Run cfcompile as follows…
cfcompile -deploy webroot directory-to-compile output-directory
2. Compiled CF code goes into [cfusionmx]\wwwroot\WEB-INF\cfclasses. CFMX compiles and runs the code from this cfclasses directory, regardless of the location of the source file.
3. To see the generated Java code, Edit the file [cfusionmx]\wwwroot\WEB-INF\web.xml. Change “coldfusion.compiler.saveJava” from false to true. Restart the CF server.
4. Bottomline enable trusted cache on CFADMIN for production environments.
Main Reference:
Compilation and Precompilation in CFMX Templates By Charlie Arehart
Deploying Applications with ColdFusion MX 7 By Dave Carabetta
Future readings include EAR/WAR Deployment…
Transparent Overlays in TileCache
Mar 31st
From the tilecache mailing list….
Hi Everyone,
Really appreciate all the replies…
1. Installed Imaging-1.1.6.tar.gz (PIL).
[root@rupert-linux ~]# python Python 2.3.4 (#1, Mar 10 2006, 06:12:09) [GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> print sys.path ['', '/usr/lib/python23.zip', '/usr/lib/python2.3', '/usr/lib/python2.3/plat-linux2', '/usr/lib/python2.3/lib-tk', '/usr/lib/python2.3/lib-dynload', '/usr/lib/python2.3/site-packages', '/usr/lib/python2.3/site-packages/PIL', '/usr/lib/python2.3/site-packages/gtk-2.0'] >>>
2. Modified test1.cfm
41 var options = {
42 controls: [new OpenLayers.Control.MouseDefaults()]
43 };
44
45 map = new OpenLayers.Map( $('map'), options);
46
47 var layer_base = new OpenLayers.Layer.WMS(
48 "Base Layer",
49 "#request.mapserv_tile#",
50 {
51 map: '/home/map/beijing/new/wms.map',
52 layers: '#request.basemap_tile#',
53 format: 'image/png', 'transparent': 'false'
54 }
55 );
56
57 var layer_road = new OpenLayers.Layer.WMS(
58 "Road Layer",
59 "#request.mapserv_tile#",
60 {
61 map: '/home/map/beijing/new/wms.map',
62 layers: '#request.roads_tile#',
63 format: 'image/png', 'transparent': 'true'
64 },
65 {
66 reproject: false
67 }
68 );
69
70 map.addLayer(layer_base);
71 layer_base.setIsBaseLayer(true);
72
73 layer_road.setIsBaseLayer(false);
74 map.addLayer(layer_road);3. tilecache.cfg. Commented metaTile=true http://222.128.19.19/tilecache/tilecache.cfg
47 [basemap] 48 type=WMSLayer 49 url=http://127.0.0.1/cgi-bin/mapserv?map=/home/map/beijing/new/wms.map 50 layers=district,greens,major_river,minor_river 51 #bbox=-180,-90,180,90 52 #metaTile=true 53 extension=png 54 55 [roads] 56 type=WMSLayer 57 url=http://127.0.0.1/cgi-bin/mapserv?map=/home/map/beijing/new/wms.map 58 #layers=road4,road4label,road3,road3label,road2,road2label,road1,road1label,road11,road11label 59 #bbox=116.1737,39.8211,116.5640,40.0799 60 #maxresolution=1.40625 61 #bbox=-180,-90,180,90 62 layers=road1,road1label,road11,road11label 63 extension=png 64 #metaTile=true
4. Modified wms.map http://222.128.19.19/tilecache/wms.map
OUTPUTFORMAT
NAME png
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "INTERLACE=OFF"
END5. Checked access_log. “transparent=true” exists…
192.168.1.150 - - [30/Mar/2007:13:46:26 +0800] "GET /tilecache/tilecache.py?MAP=%2Fhome%2Fmap%2Fbeijing%2Fnew%2Fwms.map&LAYERS=r
oads&FORMAT=image%2Fpng&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=G
etMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BB
OX=116.334229%2C39.891357%
2C116.345215%2C39.902344&WIDTH=256&HEIGHT=256 HTTP/1.1" 200 14580
Now, this is really weird. I have “transparent”: true in test1.cfm all the time. That didn’t worked.
For every test iteration i made, I always tried clearing the cache, removing the python compiled scripts, then restarting Apache just to get a clean state..
rm -Rf /usr/local/apache2/htdocs/tmp/*
rm /wwwroot/tilecache/TileCache/*.pyc
/etc/init.d/httpd restart
Then I tried appending “transparent=true” to tilecache.cfg based on Eric’s suggestion…
That worked. Now I wonder why… Nevertheless, its working now. Again many thanks to everyone…
Rupert
On Fri, Mar 30, 2007 at 01:57:43PM +0800, Rupert de Guzman Jr wrote:
> Hi Everyone,
>
> Really appreciate all the replies…
> Then I tried appending “transparent=true” to tilecache.cfg based on
> Eric’s suggestion…
> That worked. Now I wonder why… Nevertheless, its working now. Again
> many thanks to everyone…
TileCache pays almost no attention to the URL: Only the BBOX and the layername matter. Anything else is simply ignored: so your transparency being set in OpenLayers actually has 0 affect.
The reason for this is that TileCache can only store one copy of an image. If the URL parameters modified the content, you could get an inconsistent cache.
This is ‘by design’, insofar as there is no obvious solution (other than to complain more loudly when TC Gets parameters it isn’t expecting, which is an outstanding FIXME in the code). The lack of error message is not by design, and I’m sorry you got bit by the poorly documented behavior.
Regards,
–
Christopher Schmidt
MetaCarta

Comments