the app server, web server and everything in between
TRANSCRIPT
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Hari Krishna Kallae, Adobe
Immanuel Noel, Adobe
The App Server, Web Server and Everything in Between
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
ColdFusionAnd
Tomcat
Agenda
ColdFusion and Tomcat
Request flow in Built-in Webserver
Modifications to the Bundled Tomcat
ColdFusion updates
Configuration Tweaks
Web Servers and Connectors
Apache
IIS
Other Web Servers
2
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
ColdFusionAnd
Tomcat
Agenda
ColdFusion and Tomcat
Request flow in Built-in Webserver
Modifications to the Bundled Tomcat
ColdFusion updates
Configuration Tweaks
Web Servers and Connectors
Apache
IIS
Other Web Servers
3
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 44
ColdFusion 9 ColdFusion 10+
ColdFusion and Tomcat
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
ColdFusion
5
Request Flow in the Built-In WebServer
5
Request 1 Request 2
Tomcat – The Built in Web Server
Request 3
server.xml
web.xml
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Directory Structure
CGI scope variables support
SES (Search Engine Safe) URL support
Session replication in cluster
Multiple webroot support
Output buffer size
6
Modifications to the bundled Tomcat
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Modifications to the bundled Tomcat: Directory Structure
7
Directory structure matches earlier versions
Exceptions:
“Instance” replaces “Multi-Server”
Server.xml replaces jrun.xml
JRE isolated from instances, to enable common access across instances
Connector specific files isolated from the core server
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Modifications to the bundled Tomcat: CGI scope variables
8
Many CGI scopes were not supported as Tomcat did not had a way to query the webserver
CGI ScopeAUTH_PASSWORD
HTTP_CONNECTION
HTTP_COOKIE
HTTPS_SERVER_SUBJECT
SERVER_PORT
SERVER_NAME
AUTH_TYPE
CERT_COOKIE
CERT_FLAGS
HTTPS_SECRETKEYSIZE
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Modifications to the bundled Tomcat: SES URL Support
http://domain.com/index.cfm/about/contact/
ColdFusion Page: index.cfm
CGI.PATH_INFO: /about/contact/
9
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Modifications to the bundled Tomcat: Session Replication in Cluster
Sticky session
Session replication
10
Cluster
Instance 1
Instance 2
Instance 3
Session replication
Sti
cky s
ess
ion
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 11
Request 1 Request 2
Tomcat
Request 3
ColdFusion
Modifications to the bundled Tomcat: Multiple webroot support
File exists in CF
webroot
Yes
No External Web Server
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Modifications to the bundled Tomcat: Output buffer size
Vanilla Tomcat connector performance was low due to limitations in Output buffer size
Tomcat connector (AJP) was built to work with 8kb packet size data
In ColdFusion the Output buffer size was increased to
64kb in AJP which shown a 15% increase in the performance
12
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Update to ColdFusion in October 2014
13
ColdFusion 10Tomcat upgraded to
7.0.54Connector upgraded to
1.2.40Apache 2.4 Support
ColdFusion 9, 9.0.1, 9.0.2
Security fixes
ColdFusion 10JDK 8 Support, Security fixes, 60+
bug fixes
ColdFusion 11Security fixes
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 14
Configuration Tweaks
Server.xmlWeb.xmlLogging
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Server.xml: Web Server Configuration
15
<!-- internal webserver start -->
<Connector port="8500" protocol="HTTP/11"
connectionTimeout="20000"
redirectPort="8447" />
<!-- internal webserver end -->
<!-- begin connector -->
<Connector port="8014" protocol="AJP/13" redirectPort="8447" tomcatAuthentication="false" />
<!-- end connector -->
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Server.xml: Default Webroot
16
<Context path="/"
docBase="<cf_home>\wwwroot"
WorkDir="<cf_home>\runtime\conf\Catalina\localhost\tmp">
</Context>
Do not forget to copy CFIDE and WEB-INF folders present in <cf_home>\cfusion\wwwroot\ to the new webroot folder
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Server.xml: Virtual Directory
To add a virtual directory, uncomment context tag in server.xml
<Context path="/"
docBase="<cf_home>\wwwroot"
WorkDir="<cf_home>\runtime\conf\Catalina\localhost\tmp"
aliases="/myWebroot=C:\newwebroot\VD“ >
</Context>
Multiple virtual directories can be created with aliases aliases=“/aliasPath1=docBase1,/aliasPath2=docBase2”
Do not forget to copy WEB-INF folder present in <cf_home>\cfusion\wwwroot\ to the new webroot folder
17
Virtual Directory
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Web.xml: Directory Browsing
C:\ColdFusion11\cfusion\runtime\conf\web.xml
<servlet> <servlet-name>default</servlet-name> <servlet-class> org.apache.catalina.servlets.DefaultServlet </servlet-class> <init-param> <param-name>listings</param-name>
<param-value>false</param-value>
</init-param> <load-on-startup>1</load-on-startup></servlet>
18
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Logging
19
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
C:\ColdFusion11\cfusion\lib\Neo-logging.xml
maxOutLogSize – Log file size
maxOutFileBackup – Number of Archives
By default ColdFusion uses “MM/dd/yy” format If you wish to change it, you can do it by changing the columns and patterns to any standard date format
<var name='pattern'>
<string>"%p","%t",%d{"MM/dd/yy","HH:mm:ss"},%a,"%m%x"%n</string>
</var>
20
Logging
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Demo
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Summary
22
Modifications to the Tomcat Web Server
ColdFusion Updates
Configuration Tweaks
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Web Servers
AndConnectors
Revisiting the Agenda…
ColdFusion and Tomcat
Request flow in Built-in Webserver
Modifications to the Bundled Tomcat
ColdFusion Updates
Configuration Tweaks
Web Servers and Connectors
Apache
IIS
Other Web Servers
23
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 24
Web Servers & Connectors
ColdFusion + Tomcat
ApacheHTTPD
Web Server
InternetInformation
Services
Connector
Other Web Servers
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 25
Connector
ColdFusion + Tomcat
ApacheHTTPD
Web Server
InternetInformation
Services
Connector
Other Web Servers
A connection between the ColdFusion server and webserversBuilt separately for 14 different configurations
Source Available
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 26
WsConfig Tool
ColdFusion + Tomcat
ApacheHTTPD
Web Server
InternetInformation
Services
Connector (WSConfig tool)
Other Web Servers
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
The Web Server Configuration Tool
-ws apache
–dir <Apache>/conf/
-bin <Apache>/bin/httpd
–script <Apache>/bin/apachectl
27
cluster ColdFusion Cluster Name
host IP of the remote ColdFusion server
norestart Avoid restarting the web server
ws32 Configuring a 32bit webserver on a 64bit machine
Independent of the webserver
WsConfig Parameters:<cfusion>/runtime/bin/wsconfig
-ws iis
–site All / <Site Name>
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 28
Web Servers & Connectors
ColdFusion + Tomcat
ApacheHTTPD
Web Server
InternetInformation
Services
Connector (WSConfig tool)
Other Web Servers
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
The Apache Connector
Apache 2.4 support for CF 10
Demo
Setting up the Connector
Modified Apache Configurations
Connector Configurations
29
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
The Apache Connector: Ubuntu
Ubuntu distributes a customized version of Apache
And does a few things differently
./wsconfig –ws apache
–dir /etc/apache2
–bin /usr/sbin/apache2ctl
–script /usr/sbin/apache2ctl
./apache2ctl needs to be specified as the Apache Binary
30
Optional
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 31
Web Servers & Connectors
ColdFusion + Tomcat
ApacheHTTPD
Web Server
InternetInformation
Services
Connector (WSConfig tool)
Other Web Servers
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
The IIS Connector
Demo
Setting up the Connector
Modified IIS Configurations
Connector Configurations
32
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Configuring with IIS: Tuning
33
1. Connection Pool Size
2. Reuse Connections (max_reuse_connections)
3. Connection Pool Timeout
Values need to specified in server.xml, in addition to worker.properties
The Big
3worker.properties
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 34
Web Servers & Connectors
ColdFusion + Tomcat
ApacheHTTPD
Web Server
InternetInformation
Services
Connector
Other Web Servers
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Other Configuration Mechanisms
BoncodeAn IIS Connector, built by Bilal Soylu
NGinXA hack
Read: Not (yet) supported by Adobe
35
Web Server Market ShareSource: Netcraft
Apache IIS NginX
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Other Configuration Mechanisms: Boncode
36
An IIS Connector
Boncode or ColdFusion Connector - A matter of preference
Uses the AJP protocol, opposed to the ISAPI route that ColdFusion connector takes
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Other Configuration Mechanisms: NginX
NginX
37
ColdFusion
Source: Wikipedia
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
References
Connector Sourcehttp://helpx.adobe.com/coldfusion/kb/rhel-connector-configuration.html
IIS Connector Tuninghttp://blogs.coldfusion.com/post.cfm/coldfusion-11-iis-connector-tuning
Removing Connectors Manuallyhttp://blog.immanuelnoel.com/2014/07/17/coldfusion-11-manually-remove-connector-configuration/
IIS Boncode Connectorhttp://boncode.net/connector/webdocs/Tomcat_Connector.htm#_Toc399840617
NginX Reverse Proxyhttp://nginx.com/resources/admin-guide/reverse-proxy/
38
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Summary
Modifications to the Tomcat Web Server
Configuration Tweaks
Configuration Internals with Apache and IIS
Configuring with NginX and with Boncode
39
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
QUESTIONS ?Harikrishna Kallae
http://hkallae.wordpress.comTwitter: @hkallae
Immanuel Noel http://blog.immanuelnoel.com
Twitter: @ImmanuelNoel