Oğuz Demirkapı Sr. Application Developer, TeraTech 1.

Post on 20-Jan-2016

232 views 0 download

Tags:

Transcript of Oğuz Demirkapı Sr. Application Developer, TeraTech 1.

Oğuz DemirkapıSr. Application Developer, TeraTech

1

TeraTechTeraTech

Sr. Application Developer at TeraTech Coding since ‘85, CGI Programming since ’94 CF Developer since ’97 Founder and Manager (prev) of CFUG for Turkey Interested in ColdFusion, Flex, Ajax, Frameworks,

i18N, L10N, g13N Have big interest in epistemology

2

TeraTechTeraTech

What is goal? History ColdFusion Code Deployment Methods Code Deployment Details Sample Code

3

TeraTechTeraTech

Code deployment may needs different scenarios and we will consider a sourceless code deployment in an easy way.

We also want to resolve misunderstanding points on code deployment techniques.

Pre compiled code advantages would be interesting specially for commercial organizations.

4

TeraTechTeraTech

CFEncode and encrypted code ColdFusion Archives (CAR files) Pre-compiling◦ColdFusion MX 7

Souceless Deployment◦CFCompile◦ColdFusion MX 7 and up◦BlueDragon 6.1 and up

5

TeraTechTeraTech

Direct Source Code (common usage) Encyrpted Code (CFEncode) CAR (ColdFusion Archive) EAR/WAR Packaging◦Only in ColdFusion MX 7 Enterprise Edition

Pre-compiled and Sourceless Deployment◦In all version of ColdFusion MX 7

6

TeraTechTeraTech

Can be found at ◦“cf_root/bin” (ColdFusion MX) ◦“cf_webapp_root/WEB-INF/cfusion/bin” (JRun)

ColdFusion code encryption Good for basic encryption and still using by lots of

companies to protect code Easy to decode

(http://downloads.securityfocus.com/vulnerabilities/exploits/cfdecrypt.c)

Not secure enough

7

TeraTechTeraTech

Allaire Cold Fusion TemplateHeader Size: New Version.ȆüVHE5:�[‰ø„ñ.hqؤä8X°É¿Ìò©‰P^qv.ßNÊÒ‡ùF.Íû'ÉÊE´Žå¿ˆpcw..*¬Ó¦N47Â{{c;.û=Ò“š.ü.ù>eÐ×åR—˜î¥¡’¡è‡rB^T.½¸6ÛºÀE’)ñf{.âÑôÚ<Üû¶.Y%ŽQÄmBœ4.H.P’.�„÷ီ¯»~"ß<"©:¥ºmZLìBXIÂÕ¿|°ÍãˆÁ6wÜX..zeA]¸ó ‡[ªŒ‹.×:Oñ.å.ç.f×.¾w\Œ·.Ê󕻢ȳ‚)8...®Ü—ã\÷.*ÝÐ1Ì4&—ÜÓ¸!®.0¸‰.næ‘YU& .½ÿõ¨.5Öû].¥ ›ÎA/¼¸.Þö‚›í1.Ù’ÈŒ v½Äš�×¢Ñ!Lê«ÚAÁH¬„

8

TeraTechTeraTech

Basically J2EE Package Deployment Includes ColdFusion runtime Deploy to J2EE Servers such as JRun, TomCat, WebLogic,

WebSpere etc. The J2EE packaged deployment can be sourceless (optional)

and can also omit the CF Administrator (optional). Create at any ColdFusion Server but deploy only Enterprise

edition Need separate license for ColdFusion runtime (otherwise

works a developer edition)

9

TeraTechTeraTech

Compile Source Code (CFM,CFC, and CFR) to create Java byte code

The byte code is processed by the JVM - it is not interpreted by the CF runtime

But still needs ColdFusion MX 7 to run compiled code and not compatible with old ColdFusion MX versions

Deploy into any ColdFusion MX 7 server No need for any extra license

10

TeraTechTeraTech

Can be found at ◦“cf_root/bin” (ColdFusion MX) ◦“cf_webapp_root/WEB-INF/cfusion/bin” (JRun)

Can be run also for directories Default action is recursively on defined directory Default compile directory is ◦“cf_webapp_root/WEB-INF/ cfclasses”

11

TeraTechTeraTech

Easy compile: ◦ cfcompile webroot [directory-to-compile]◦ C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\bin\

cfcompile.bat C:\SERVER\Domains\sourceless C:\SERVER\Domains\sourceless\codedir

C:\SERVER\Domains\sourceless\codedir\sample.cfm... successful 1

total 1

elapsed 2.453 sec

Sourceless Compile: ◦ cfcompile -deploy webroot directory-to-compile output-directory◦ C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\bin\

cfcompile.bat -deploy C:\SERVER\Domains\sourceless C:\SERVER\Domains\sourceless\codedir

12

TeraTechTeraTech

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Sample Code</title></head>

<body><cfloop index="loopid" from="1" to="10000">

<cfoutput>#loopid#: #Now()#</cfoutput></cfloop></body></html>

13

TeraTechTeraTech

-SourceFile/C:\SERVER\Domains\sourceless\codedir\sample.cfmcfsample2ecfm354487559coldfusion/

runtime/CFPage<init>()VthisLcfsample2ecfm354487559;LocalVariableTableCodebindPageVariablesD(Lcoldfusion/runtime/VariableScope;Lcoldfusion/runtime/LocalScope;)Vcoldfusion/runtime/CfJspPage

LOOPIDLcoldfusion/runtime/Variable;bindPageVariabler(Ljava/lang/String;Lcoldfusion/runtime/VariableScope;Lcoldfusion/runtime/LocalScope;)Lcoldfusion/runtime/Variable;com.macromedia.SourceModTimem+pageContext#Lcoldfusion/runtime/NeoPageContext;!" #getOut()Ljavax/servlet/jsp/JspWriter;%&javax/servlet/jsp/PageContext

14

TeraTechTeraTech

ColdFusion MX 7 and Up◦ Both Standard and Enterprise Editions

BlueDragon Standard Edition (Server JX)◦ Not in BlueDragon (free) Server◦ Starting from version 6.1 (2004)

15

TeraTechTeraTech

Let us check some sample code and usage …

16

TeraTechTeraTech

Macromedia LiveDocs (http://livedocs.adobe.com/coldfusion/7/htmldocs/00001762.htm)

Designing ColdFusion Applications for Deployment as EAR Files (http://www.adobe.com/devnet/coldfusion/articles/ear.html)

Protecting Applications with WAR and EAR Packaging and Sourceless Deployment (http://www.adobe.com/devnet/coldfusion/articles/clustering_06.html)

Deploying Applications with ColdFusion MX 7 (http://coldfusion.sys-con.com/read/48654.htm)

Sourceless / J2EE Deployment (http://corfield.org/blog/index.cfm/do/blog.entry/entry/Sourceless__J2EE_Deployment)

17

TeraTechTeraTech

?oguz.demirkapi@teratech.com

18