40
© 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

The app server, web server and everything in between

Embed Size (px)

Citation preview

Page 1: The app server, web server and everything in between

© 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

Page 2: 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

Page 3: 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

3

Page 4: The app server, web server and everything in between

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 44

ColdFusion 9 ColdFusion 10+

ColdFusion and Tomcat

Page 5: The app server, web server and everything in between

© 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

Page 6: The app server, web server and everything in between

© 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

Page 7: The app server, web server and everything in between

© 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

Page 8: The app server, web server and everything in between

© 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

Page 9: The app server, web server and everything in between

© 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

Page 10: The app server, web server and everything in between

© 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

Page 11: The app server, web server and everything in between

© 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

Page 12: The app server, web server and everything in between

© 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

Page 13: The app server, web server and everything in between

© 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

Page 14: The app server, web server and everything in between

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 14

Configuration Tweaks

Server.xmlWeb.xmlLogging

Page 15: The app server, web server and everything in between

© 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 -->

Page 16: The app server, web server and everything in between

© 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

Page 17: The app server, web server and everything in between

© 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

Page 18: The app server, web server and everything in between

© 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

Page 19: The app server, web server and everything in between

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Logging

19

Page 20: The app server, web server and everything in between

© 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

Page 21: The app server, web server and everything in between

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Demo

Page 22: The app server, web server and everything in between

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Summary

22

Modifications to the Tomcat Web Server

ColdFusion Updates

Configuration Tweaks

Page 23: The app server, web server and everything in between

© 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

Page 24: The app server, web server and everything in between

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 24

Web Servers & Connectors

ColdFusion + Tomcat

ApacheHTTPD

Web Server

InternetInformation

Services

Connector

Other Web Servers

Page 25: The app server, web server and everything in between

© 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

Page 26: The app server, web server and everything in between

© 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

Page 27: The app server, web server and everything in between

© 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>

Page 28: The app server, web server and everything in between

© 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

Page 29: The app server, web server and everything in between

© 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

Page 30: The app server, web server and everything in between

© 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

Page 31: The app server, web server and everything in between

© 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

Page 32: The app server, web server and everything in between

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

The IIS Connector

Demo

Setting up the Connector

Modified IIS Configurations

Connector Configurations

32

Page 33: The app server, web server and everything in between

© 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

Page 34: The app server, web server and everything in between

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 34

Web Servers & Connectors

ColdFusion + Tomcat

ApacheHTTPD

Web Server

InternetInformation

Services

Connector

Other Web Servers

Page 35: The app server, web server and everything in between

© 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

Page 36: The app server, web server and everything in between

© 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

Page 37: The app server, web server and everything in between

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Other Configuration Mechanisms: NginX

NginX

37

ColdFusion

Source: Wikipedia

Page 38: The app server, web server and everything in between

© 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

Page 39: The app server, web server and everything in between

© 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

Page 40: The app server, web server and everything in between

© 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