Running ColdFusion MX 7 on Linux and Unix

115
1 ColdFusion MX 7 on Unix and Linux Steven Erat Senior ColdFusion Support Engineer Macromedia December 21, 2004

description

Presented internally at Adobe as training material for the technical support team.

Transcript of Running ColdFusion MX 7 on Linux and Unix

Page 1: Running ColdFusion MX 7 on Linux and Unix

1

ColdFusion MX 7 on Unix and Linux

Steven EratSenior ColdFusion Support EngineerMacromedia

December 21, 2004

Page 2: Running ColdFusion MX 7 on Linux and Unix

2

Page 3: Running ColdFusion MX 7 on Linux and Unix

3

ColdFusion MX 7 on Unix & Linux - Overview

ColdFusion History on Unix & Linux

ColdFusion MX 7 Unix & Linux System Requirements

ColdFusion Version Migration Paths on Unix & Linux

New in ColdFusion MX 7

General ColdFusion Concerns on Unix & Linux

Multiserver Configuration Installation on Linux with Apache – Console

Server Configuration Installation on Linux with Apache – GUI

Settings and Migration Wizard

Server Configuration on Solaris with iPlanet – Console

Thread Dumps

Miscellaneous

ColdFusion IDEs Linux

Page 4: Running ColdFusion MX 7 on Linux and Unix

4

ColdFusion History on Unix & Linux

Page 5: Running ColdFusion MX 7 on Linux and Unix

5

ColdFusion History – Unix Support

Support for Solaris 2.5, 2.6, & 7 introduced in ColdFusion 4.0, November 1998

Support for HP-UX 10.20 introduced in ColdFusion 4.01, early 1999, and later support for HP-UX 11.0 in CF 4.5.1SP1, early 2000

Support for AIX 5.1 in CFMX 6.0 J2EE for IBM WebSphere

Support for Mac OSX 10.2 in CFMX 6.0 J2EE, Fall 2000

-ColdFusion Enterprise edition only, no Pro/Standard-Windows Registry Emulation via .windu process-“Advanced” Security introduced in 4.01-CFX_J for Java extensibility-Cluster Cats available only when using NES, not Apache-Unix Error 2, Unix Error 146-Crash stack trace available in server.log in CF4.5.1SP2-Crash stack trace available in crash.log in CF5

-No Cluster Cats Failover / Load Balancing-No “Advanced” Security-No PDF usage in Verity-Must use HP’s JVM for Java functionality

-Development only, not supported in production

Page 6: Running ColdFusion MX 7 on Linux and Unix

6

ColdFusion History – Linux Support

Support for Linux introduced with ColdFusion 4.5.0 in Fall 1999

-CF Enterprise & Professional-CF Express available in binary and RPM formats-No “Advanced” Security-No Spectra-No Verity (4.5.0)-No LDAP SSL-ODBC only, no Native Drivers-Often required editing start script-Unix 111 errors – CF not running-No crash log or stack trace-System library compatibility, glibc, libstdc++,...-Warning: Recompile with -DEAPI

Page 7: Running ColdFusion MX 7 on Linux and Unix

7

Low Points in ColdFusion MX

Linux ColdFusion Users Irate With MacromediaeWeek, December 2002

ColdFusion MX users who are running the rapid server-scripting environment on Unix or Linux said they feel they've been left out in the cold by developer Macromedia Inc. Problems with the San Francisco company's software on Linux have prompted hundreds of user complaints to the Macromedia Web site regarding server crashes and other anomalies. Macromedia officials blame the problems on incompatible distributions of Linux.

In a statement responding to eWeek, Macromedia said it is "committed to providing ColdFusion customers with superior performance and stability across all the platforms we support, including Windows, Linux, Solaris and HP-UX. Since we have not yet been able to reproduce the reported problems on the certified hardware platform and Linux versions that we have comprehensively tested, we believe that the anomalies may be due to nonstandard distributions of Linux. We continue to actively work to identify the problem," officials said.

The company recommends that users follow the systems requirements guidelines published for ColdFusion MX as closely as possible.

ColdFusion MX support on Linux and Unix with ApacheMacromedia Technote 18340

- Follow System Requirements- Changes to jrun.xml for mapCheck, thread values- MaxPermSize jvm arg for out of memory conditions- EAPI connector fixes numerous httpd CLOSE_WAITs- Hangs resolved by moving from Apache 1.3x to 2.0.x- VM Crash when HW/CPU overheated, broken fan

Page 8: Running ColdFusion MX 7 on Linux and Unix

8

ColdFusion MX 7.0 Unix & Linux System Requirements

Page 9: Running ColdFusion MX 7 on Linux and Unix

9

ColdFusion MX 7 Sys Reqs – Unix Platforms

Dropped Platforms:

- Solaris 7- HP-UX 11i

Mac OSX:- 10.3 Supported in Development only (change from 10.2)

Page 10: Running ColdFusion MX 7 on Linux and Unix

10

ColdFusion MX 7 Sys Reqs – Linux Distributions

Dropped Distributions:

- Red Hat 7.2, 7.3, 8, 9 - SuSE 7.2, 7.3, 8.x

Caveats:

- No Verity in SuSE, Turbo Linux

Page 11: Running ColdFusion MX 7 on Linux and Unix

11

Sys Reqs – Webservers

Page 12: Running ColdFusion MX 7 on Linux and Unix

12

Browser Support, CF Admin

Page 13: Running ColdFusion MX 7 on Linux and Unix

13

ColdFusion Version Migration Paths on Unix & Linux

Page 14: Running ColdFusion MX 7 on Linux and Unix

14

ColdFusion 5 To ColdFusion MX 7 Migration Path

ColdFusion 5: ColdFusion MX 7:

RedHat 6.2 and later (7.x?)

SuSE 7.0 and later (8.x?)

Cobalt RAQ

Solaris 6, 7, 8

HP 11i

RedHat Enterprise 2.1, 3.0

SuSE Enterprise 8

N/A

Solaris 8, 9, 10

N/A

Page 15: Running ColdFusion MX 7 on Linux and Unix

15

ColdFusion MX To ColdFusion MX 7 Migration Path

ColdFusion MX 6.1: ColdFusion MX 7:

RedHat 7.2, 7.3, 8, 9, Ent 2.1, 3.0

SuSE 7.2, 7.3, 8.x, Enterprise 8

Turbo Linux 8 (JP)

Solaris 7, 8, 9

HP 11i

RedHat Enterprise Ent 2.1, 3.0

SuSE Enterprise 8

Turbo Linux 8 (JP)

Solaris 8, 9, 10

N/A

Page 16: Running ColdFusion MX 7 on Linux and Unix

16

New in ColdFusion MX 7

Page 17: Running ColdFusion MX 7 on Linux and Unix

17

Banded Report Builder

For Windows only.Includes ColdFusion Report Builder, which lets you generate banded reports in PDF or FlashPaper formats.

ColdFusion Report Builder

Page 18: Running ColdFusion MX 7 on Linux and Unix

18

SMSClient.sh

Page 19: Running ColdFusion MX 7 on Linux and Unix

19

Code Considerations

CFFORM – Avoid Browser Issues by Using Flash Format

ColdFusion MX can deliver Forms to the client in Macromedia Flash SWF format. ColdFusion automatically generates the Flash binary from your CFML code and displays it on the client. Flash forms are browser-independent. Flash Player works in all commonly used browsers on Windows and Macintosh systems, and in Netscape and Mozilla on Linux.

cfNTauthenticate – New in ColdFusion MX 7, Windows Only

Use this function to authenticate a user against a Microsoft NT domain and optionally get the user's groups. This function does not work with the Microsoft Active Directory directory service, and does nothing on UNIX and Linux systems.

Page 20: Running ColdFusion MX 7 on Linux and Unix

20

Usual Concerns about ColdFusion on Unix & Linux

Page 21: Running ColdFusion MX 7 on Linux and Unix

21

General ColdFusion Considerations for Unix/Linux

Case Sensitivity

Filenames and directories – CFFILE, CFDIRECTORY, fileexists(), etc... (CFFILE mode=“nnn”)

Path delimiter “/” not “\”

CF Custom Tag search path, CFModule search path, and CFC search path are all case sensitive

First search is for all lower case match, second search is for exact case match.

How To Change CF Runtime User

• Backup, Uninstall, Reinstall while selecting the different user as the CF runtime user

• Do not just “chown –R {cfuser}” to recursively change ownership on files and directories

Registry

ColdFusion on *nix continues to use a vestigal {CF_HOME}/registry/cf.registry file to store client variables

Page 22: Running ColdFusion MX 7 on Linux and Unix

22

Performance Tuning on Unix and Linux

Unix platform-specific performance settingshttp://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_18229

This article is outdated and questionable.

• ColdFusion MX 7 Supported Versions of Solaris not listed

• HPUX settings now irrelevant

• Linux settings not accurate for contemporary distributions

Page 23: Running ColdFusion MX 7 on Linux and Unix

23

Multiserver Configuration Installation on Linux - Console

Page 24: Running ColdFusion MX 7 on Linux and Unix

24

Linux Console Installation – Multiserver (1/13)

[root@Vagrant coldfusionmx7]# chmod +x coldfusion-macr-linux.bin

[root@Vagrant coldfusionmx7]# ./coldfusion-macr-linux.bin

Preparing to install...Extracting the JRE from the installer archive...Unpacking the JRE...Extracting the installation resources from the installer archive...Configuring the installer for this system's environment...

Launching installer...

Preparing CONSOLE Mode Installation...

===============================================================================Choose Locale...----------------

->1- English

CHOOSE LOCALE BY NUMBER: 1=============================================================================== (created with InstallAnywhere by Zero G)-------------------------------------------------------------------------------

Page 25: Running ColdFusion MX 7 on Linux and Unix

25

Linux Console Installation – Multiserver (2/13)

===============================================================================Introduction------------

Welcome to the Install Wizard for Macromedia ColdFusion MX 7

This wizard installs Macromedia ColdFusion MX 7 on your computer or produces an EAR or WAR file for deployment on your J2EE application server. Macromedia recommends that you exit from all running applications before proceeding.

Respond to each prompt to proceed to the next step in the installation. If youwant to change something on a previous step, type 'back'.

You may cancel this installation at any time by typing 'quit'.

WARNING: This program is protected by copyright laws and international treaties.

PRESS <ENTER> TO CONTINUE:

===============================================================================License Agreement-----------------

{many screens here}DO YOU ACCEPT THE TERMS OF THIS LICENSE AGREEMENT? (Y/N) : y

Page 26: Running ColdFusion MX 7 on Linux and Unix

26

Linux Console Installation – Multiserver (3/13)

===============================================================================Install Type------------

Enter a serial number for Macromedia ColdFusion MX 7. If you do not have a serial number, select either 30-day trial or Developer Edition.

->1- Install new version of ColdFusion MX 2- 30-day trial 3- Developer Edition

Installation Choice: 1

Serial Number: CED700-nnnnn-nnnnn-nnnnn

===============================================================================Installer Configuration-----------------------

What kind of installation do you want?

->1- Server configuration 2- Multiserver configuration 3- J2EE configuration (EAR file) 4- J2EE configuration (WAR file)

Please select one of the following options: 2

Page 27: Running ColdFusion MX 7 on Linux and Unix

27

Linux Console Installation – Multiserver (5/13)

===============================================================================Macromedia ColdFusion MX 7 (multiserver configuration) Installed-----------------------------------------------------------------

You cannot install the multiserver configuration of Macromedia ColdFusion MX 7 if it, or Macromedia JRun 4, is already installed on this computer.

Is there already a multiserver configuration of Macromedia ColdFusion MX 7, or Macromedia JRun 4, installed on this computer?

1- Yes ->2- No

ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT: : 2

Page 28: Running ColdFusion MX 7 on Linux and Unix

28

Linux Console Installation – Multiserver (6/13)

===============================================================================Sub-component installation--------------------------

The following options are available for installation.

An option with "[X]" in front will be installed and an option with "[ ]" will not. Choosing an option will toggle it on or off

[X] 1) Getting Started Experience, Tutorials, & Documentation[X] 2) ColdFusion MX 7 Search Services

3) Continue with installation

Select an option: 1

===============================================================================Sub-component installation

[ ] 1) Getting Started Experience, Tutorials, & Documentation[X] 2) ColdFusion MX 7 Search Services

3) Continue with installation

Select an option: 1

===============================================================================Sub-component installation

[X] 1) Getting Started Experience, Tutorials, & Documentation[X] 2) ColdFusion MX 7 Search Services

3) Continue with installation

Select an option: 3

Page 29: Running ColdFusion MX 7 on Linux and Unix

29

Linux Console Installation – Multiserver (7/13)

===============================================================================Choose Install Folder---------------------

The multiserver configuration runs on Macromedia JRun 4. Select the directory in which to install Macromedia JRun 4.Directory:

Default Install Folder: /opt/jrun4

ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT : /opt/jrun4

INSTALL FOLDER IS: /opt/jrun4 IS THIS CORRECT? (Y/N): y===============================================================================Existing ColdFusion Installation?---------------------------------

The installer could not determine if there was an earlier version of ColdFusion on this machine. If there is a previous version of ColdFusion installed your settings can be migrated.

Is there an earlier version of ColdFusion on this machine?

1- Yes ->2- No

ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT: 2

Page 30: Running ColdFusion MX 7 on Linux and Unix

30

Linux Console Installation – Multiserver (8/13)

===============================================================================Configure Web Servers---------------------

Please configure your web server(s). If you do not configure a web server the built-in web server will be used on port 8300 or the next available port.

1- Add Web Server Configuration ->2- Continue with installation

Choice: 1

****************************************************

->1- Apache 2- Sun ONE Web Server (iPlanet) 3- Cancel

What kind of Web Server are you configuring: 1What directory contains your Apache configuration file (httpd.conf)? (For example, on Red Hat Linux it could be located in the /etc/httpd/conf directory if you installed from an rpm.) Directory: /usr/local/apache2/conf

Page 31: Running ColdFusion MX 7 on Linux and Unix

31

Linux Console Installation – Multiserver (9/13)

****************************************************

Where is the Apache program binary file? (For example, on Red Hat Linux it could be located in the /usr/sbin/httpd directory if you installed from an rpm.) If you have more than one instance of Apache on your computer, enter the binary file location for the Apache web server that will use ColdFusion MX. (Note: this is not the Apache start and stop script.) File (DEFAULT: /usr/local/apache2/bin/httpd):

****************************************************

Where is the control file that you use to start and stop the Apache web server? (For example, this could be /etc/init.d/httpd on Red Hat Linux if you installed from an rpm and it could be /usr/local/apache/bin/apachectl on hand-compiled versions.) File (DEFAULT: /usr/local/apache2/bin/apachectl):

Page 32: Running ColdFusion MX 7 on Linux and Unix

32

Linux Console Installation – Multiserver (10/13)

****************************************************

Please configure your web server(s). If you do not configure a web server the built-in web server will be used on port 8300 or the next available port.

1- Add Web Server Configuration 2- Remove Web Server Configuration 3- Edit:Apache : /usr/local/apache2/conf ->4- Continue with installation

Choice: 4

===============================================================================Choose ColdFusion MX Administrator Location-------------------------------------------

Select the location of the web root for Macromedia ColdFusion MX 7. This is where the installer places the ColdFusion MX Administrator.

This directory must be the web root for one of the websites to be configured for use with ColdFusion MX.

Directory: (DEFAULT: /usr/local/apache2/htdocs): /var/www/html

Page 33: Running ColdFusion MX 7 on Linux and Unix

33

Linux Console Installation – Multiserver (11/13)

===============================================================================Runtime User------------

Enter the name of the runtime user. This user must exist already on the system.

User Name: (DEFAULT: nobody):

===============================================================================Administrator Password----------------------

Enter the password that you will use to control access to the ColdFusion MX Administrator.

This field is required.

Password: *** problem when using cshConfirm Password:

===============================================================================RDS Password------------

The ColdFusion Remote Development Service (RDS) lets developers using Macromedia tools remotely connect to this server for development purposes.

If this is a production server, Macromedia recommends that you disable RDS. Note, however, that disabling RDS also disables the directory browsing applets in the ColdFusion Administrator and some of the functionality in the Report Designer.

Enable RDS (required for Report Builder and DW Extensions) (Y/N) : y Password: Confirm Password:

Page 34: Running ColdFusion MX 7 on Linux and Unix

34

Linux Console Installation – Multiserver (12/13)

===============================================================================Installation Confirmation-------------------------

Installation Type: Multiserver configuration

Licensing: Fully Licensed Edition Serial Number: CED700-nnnnn-nnnnn-nnnnn

Installation Directories: Product: /opt/jrun4 Web root: /var/www/html

Server Information: JRun Server: cfusion Web Server: Apache (/usr/local/apache2/conf) Search Service: installed Sample Apps: installed RDS: enabled

Disk Space Information (for Installation Target): Required: 365,075,227 bytes Available: 2,486,521,856 bytes

PRESS <ENTER> TO CONTINUE:

Page 35: Running ColdFusion MX 7 on Linux and Unix

35

Linux Console Installation – Multiserver (13/13)

===============================================================================Installing...-------------

[==================|==================|==================|==================] [------------------|------------------|------------------|------------------]

===============================================================================Installation Complete---------------------

You have successfully completed the first step in installing Macromedia ColdFusion MX 7 with JRun 4.

To continue with your installation, go to /opt/jrun4/bin and type the command “./jrun -start cfusion” to start the CFusion server on JRun. To finish configuring yourweb server connectors you will also need to run cfmx_connectors.sh (also in the/opt/jrun4/bin directory) once the jrun server is up and running.

When the server is started and the connectors are configured log in to the Configuration Wizard at http://[machinename]/CFIDE/administrator/index.cfm

PRESS <ENTER> TO EXIT THE INSTALLER:

***

Page 36: Running ColdFusion MX 7 on Linux and Unix

36

WARNING: /tmp does not have enough disk space!

[root@Vagrant coldfusionmx7]# ./coldfusion-macr-linux.bin Preparing to install...WARNING: /tmp does not have enough disk space! Attempting to use /root for install base and tmp dir.

WARNING! The amount of /tmp disk space required to performthis installation is greater than what is available. Pleasefree up at least 149363 kilobytes in /tmp and attempt thisinstallation again. You may also set the IATEMPDIR environmentvariable to a directory on a disk partition with enough freedisk space. To set the variable enter one of the followingcommands at the UNIX command line prompt before running thisinstaller again:

- for Bourne shell (sh), ksh, bash and zsh:

$ IATEMPDIR=/your/free/space/directory $ export IATEMPDIR

- for C shell (csh) and tcsh:

$ setenv IATEMPDIR /your/free/space/directory

Page 37: Running ColdFusion MX 7 on Linux and Unix

37

Processes, Directories, Files

Starting ColdFusion

Manual Webserver Configuration

Examining Webserver Configuration

Monitoring Memory

Page 38: Running ColdFusion MX 7 on Linux and Unix

38

JRun Directory Contents – Multiserver Config

[root@Vagrant opt]# cd /opt/jrun4/[root@Vagrant jrun4]# ls -ltotal 72drwxrwxr-x 2 nobody root 4096 Dec 10 12:52 bindrwxrwxr-x 7 nobody root 4096 Dec 10 12:52 docsdrwxrwxr-x 8 nobody root 4096 Jul 1 16:30 jredrwxrwxr-x 3 nobody root 4096 Dec 10 12:52 lib-rwxrwxrwx 1 nobody root 10523 Apr 7 2004 license.txtdrwxrwxr-x 2 nobody root 4096 Dec 10 12:51 logs-rw-rw-r-- 1 root root 11081 Dec 10 14:20 Macromedia_ColdFusion_MX_7_InstallLog.logdrwxrwxr-x 7 nobody root 4096 Dec 10 12:52 pointbase-rwxrwxrwx 1 nobody root 7571 Nov 11 18:51 Readme.htm-rw-rw-r-- 1 nobody root 1137 Nov 5 11:38 relnotes.htmdrwxrwxr-x 6 nobody root 4096 Dec 10 12:52 serversdrwxrwxr-x 2 nobody root 4096 Dec 10 14:20 uninstalldrwxrwxr-x 7 nobody root 4096 Dec 10 12:50 verity

[root@Vagrant jrun4]# cd bin[root@Vagrant bin]# ls -ltotal 3204-rwxr-xr-x 1 nobody root 1750 Dec 10 12:52 cfmx-connectors.sh-rwxrwxr-x 1 nobody root 54723 Dec 8 16:38 java2wsdl-rwxrwxr-x 1 nobody root 2709768 Dec 8 16:38 jikesw-rwxrwxr-x 1 nobody root 54723 Dec 8 16:38 jrun-rwxrwxr-x 1 nobody root 54723 Dec 8 16:38 jrunwizard-rwxr-xr-x 1 nobody root 54723 Dec 8 16:38 jspc-rw-rw-r-- 1 nobody root 1279 Dec 10 12:52 jvm.config-rwxr-xr-x 1 nobody root 54723 Dec 8 16:38 migrate-rwxrwxr-x 1 nobody root 54723 Dec 8 16:38 sniffer-rwxr-xr-x 1 nobody root 54723 Dec 8 16:38 wsconfig-rw-rw-r-- 1 nobody root 976 Dec 10 12:51 wsconfig_jvm.config-rwxrwxr-x 1 nobody root 54179 Dec 8 16:38 wsdl2java-rwxr-xr-x 1 nobody root 54723 Dec 8 16:38 xmlscript

Page 39: Running ColdFusion MX 7 on Linux and Unix

39

k2admin service starts immediately

[root@Leonid bin]# ps -ef | grep jruncfmx 7657 1 0 19:05 pts/2 /opt/jrun4/verity/k2/_ilnx21/bin/k2admincfmx 7774 7778 0 19:06 pts/2 /opt/jrun4/verity/k2/_ilnx21/bin/k2server -ualias ColdFusionK2_server1cfmx 7777 7778 0 19:06 pts/2 /opt/jrun4/verity/k2/_ilnx21/bin/k2index -ualias ColdFusionK2_indexserver1root 14453 31191 0 19:13 pts/2 grep jrun

[root@Leonid bin]# ps -ef | grep jruncfmx 7657 1 0 19:05 pts/2 /opt/jrun4/verity/k2/_ilnx21/bin/k2admincfmx 7774 7778 0 19:06 pts/2 /opt/jrun4/verity/k2/_ilnx21/bin/k2server -ualias ColdFusionK2_server1cfmx 7777 7778 0 19:06 pts/2 /opt/jrun4/verity/k2/_ilnx21/bin/k2index -ualias ColdFusionK2_indexserver1root 14455 6821 3 19:14 pts/1 ./jrun -start cfusionroot 14534 31191 0 19:16 pts/2 grep jrun[root@Leonid bin]#

Before starting ColdFusion server for the first time

After starting ColdFusion

Page 40: Running ColdFusion MX 7 on Linux and Unix

40

ColdFusion init Scripts on Multiserver Configuration

Multiserver configuration does not provide ColdFusion system init scripts

Experimental ColdFusion MX for JRun init scripts

http://www.talkingtree.com/blog/index.cfm/2005/7/15/CFLinuxBootScripts

Page 41: Running ColdFusion MX 7 on Linux and Unix

41

Verity vspider Utility

Verity vspider utility now available on Linux,making Verity support on Linux finally complete.

[root@Leonid ~]# ls -l `find /opt/coldfusionmx7/ -name vspider`-rwxrwxr-x 1 cfmx bin 938324 Sep 24 12:26 /opt/coldfusionmx7/verity/k2/_ilnx21/bin/vspider[root@Leonid ~]#

Page 42: Running ColdFusion MX 7 on Linux and Unix

42

Working with the k2admin Scripts

[root@Leonid jrun4]# pwd/opt/jrun4[root@Leonid jrun4]# find . -name k2admin./verity/k2/_ilnx21/bin/k2admin[root@Leonid jrun4]# ls -l verity/k2/_ilnx21/bin/ | grep k2-rwxrwxr-x 1 cfmx root 3778622 Sep 23 15:20 k2admin-rwxrwxrwx 1 cfmx cfmx 2837 Dec 14 19:05 k2adminstart-rwxrwxrwx 1 cfmx cfmx 1846 Dec 14 19:05 k2adminstop-rwxrwxr-x 1 cfmx root 2180802 Sep 24 16:08 k2index-rwxrwxr-x 1 cfmx root 1199602 May 24 2004 k2lmldap.so-rwxrwxr-x 1 cfmx root 10338 May 24 2004 k2lmtg.so-rwxrwxr-x 1 cfmx root 1224318 May 24 2004 k2lmunix.so-rwxrwxr-x 1 cfmx root 1311719 May 24 2004 k2psldap.so-rwxrwxr-x 1 cfmx root 1206974 May 24 2004 k2psmdm.so-rwxrwxr-x 1 cfmx root 4499749 Sep 24 16:03 k2server-rwxrwxr-x 1 cfmx root 605196 May 24 2004 rck2[root@Leonid jrun4]#[root@Leonid jrun4]# ./verity/k2/_ilnx21/bin/k2adminstartSUCCESS: Created with process ID: 14704 Please use the k2adminstop script to terminate process[root@Leonid jrun4]# [root@Leonid jrun4]# ./verity/k2/_ilnx21/bin/k2adminstop [root@Leonid jrun4]# pwd

Page 43: Running ColdFusion MX 7 on Linux and Unix

43

Starting ColdFusion - Multiserver

[root@Leonid bin]# ./jrun -start cfusionStarting Macromedia JRun 4 (Build 84683), cfusion server12/14 19:09:24 warning The Trial License evaluation period will expire in 59 days.12/14 19:09:27 info JRun Naming Service listening on *:290212/14 19:09:28 warning No sessionSecret has been specified in jrun.xml. Installing a self generated sessionSecret.12/14 19:09:28 info No JDBC data sources have been configured for this server (see jrun-resources.xml)12/14 19:09:29 info JRun Web Server listening on *:830012/14 19:09:29 info Deploying enterprise application "cfusion-ear" from: file:/opt/jrun4/servers/cfusion/cfusion-ear/12/14 19:09:30 info Deploying web application "Macromedia Coldfusion MX" from: file:/opt/jrun4/servers/cfusion/cfusion-ear/12/14 19:09:37 INFO License Service: Flex 1.5 CF Edition enabled12/14 19:09:37 INFO Starting Flex 1.5 CF Edition12/14 19:09:37 user JSPServlet: init12/14 19:09:39 user CFMxmlServlet: init12/14 19:09:39 user CFMxmlServlet: Macromedia Flex Build: 87315.13464612/14 19:09:39 INFO Macromedia Flex Build: 87315.13464612/14 19:09:44 user ColdFusionStartUpServlet: init12/14 19:09:44 user ColdFusionStartUpServlet: ColdFusion MX: Starting application services12/14 19:09:44 user ColdFusionStartUpServlet: ColdFusion MX: VM version = 1.4.2_05-b0412/14 19:09:45 Information [scheduler-9] - /opt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/logs/server.log initialized12/14 19:09:45 Information [scheduler-9] - Starting logging...12/14 19:09:45 Information [scheduler-9] - Starting crypto...12/14 19:09:48 Information [scheduler-9] - Starting license...12/14 19:09:48 Information [scheduler-9] - Starting License server ...12/14 19:10:00 Information [scheduler-9] - Starting scheduler...12/14 19:10:00 Information [scheduler-9] - Starting debugging...12/14 19:10:01 Information [scheduler-9] - Starting sql...12/14 19:10:01 Information [scheduler-9] - Starting mail...12/14 19:10:01 Information [scheduler-9] - CORBA Configuration not enabled

Page 44: Running ColdFusion MX 7 on Linux and Unix

44

Starting ColdFusion – Multiserver (cont’d)

12/14 19:10:01 Information [scheduler-9] - Starting cron...12/14 19:10:01 Information [scheduler-9] - Starting registry...12/14 19:10:01 Information [scheduler-9] - Starting client...12/14 19:10:02 Information [scheduler-9] - The metrics service is disabled for the J2EE edition12/14 19:10:02 Information [scheduler-9] - Starting xmlrpc...12/14 19:10:02 Information [scheduler-9] - Starting graphing...12/14 19:10:03 Information [scheduler-9] - Starting verity...12/14 19:10:03 Information [scheduler-9] - Starting archive...12/14 19:10:03 Information [scheduler-9] - Starting document...12/14 19:10:04 Information [scheduler-9] - Starting eventgateway...12/14 19:10:05 Information [scheduler-9] - /opt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/logs/eventgateway.log initialized12/14 19:10:05 Information [scheduler-9] - Starting Event Backend Handlers12/14 19:10:05 Information [scheduler-9] - Initialized EventRequestDispatcher with a Thread Pool size of 1012/14 19:10:05 Information [scheduler-9] - Initializing EventRequestHandler12/14 19:10:05 Information [scheduler-9] - Starting Event Gateways12/14 19:10:05 Information [scheduler-9] - ColdFusion started12/14 19:10:05 user ColdFusionStartUpServlet: ColdFusion MX: application services are now available12/14 19:10:05 user CFSwfServlet: init12/14 19:10:05 user CFCServlet: init12/14 19:10:07 user FlashGateway: init12/14 19:10:07 user CFFormGateway: init12/14 19:10:07 user CFInternalServlet: init12/14 19:10:07 info Deploying enterprise application "JRun 4.0 Internal J2EE Components" from: file:/opt/jrun4/lib/jrun-comp.ear12/14 19:10:08 info Deploying EJB "JRunSQLInvoker" from: file:/opt/jrun4/lib/jrun-comp.earServer cfusion ready (startup time: 49 seconds)

Page 45: Running ColdFusion MX 7 on Linux and Unix

45

Running cfmx-connectors.sh

[root@Leonid bin]# pwd/opt/jrun4/bin[root@Leonid bin]# ls -ltotal 3256-rwxr-xr-x 1 cfmx root 1716 Dec 14 19:07 cfmx-connectors.sh-rwxrwxr-x 1 cfmx root 54723 Nov 30 21:13 java2wsdl-rwxrwxr-x 1 cfmx root 2709768 Nov 30 21:13 jikesw-rwxrwxr-x 1 cfmx root 54723 Nov 30 21:13 jrun-rwxrwxr-x 1 cfmx root 54723 Nov 30 21:13 jrunwizard-rwxr-xr-x 1 cfmx root 54723 Nov 30 21:13 jspc-rw-rw-r-- 1 cfmx root 1279 Dec 14 19:07 jvm.config-rwxr-xr-x 1 cfmx root 54723 Nov 30 21:13 migrate-rwxrwxr-x 1 cfmx root 54723 Nov 30 21:13 sniffer-rwxr-xr-x 1 cfmx root 54723 Nov 30 21:13 wsconfig-rw-rw-r-- 1 cfmx root 976 Dec 14 19:06 wsconfig_jvm.config-rwxrwxr-x 1 cfmx root 54179 Nov 30 21:13 wsdl2java-rwxr-xr-x 1 cfmx root 54723 Nov 30 21:13 xmlscript[root@Leonid bin]# [root@Leonid bin]# ./cfmx-connectors.sh Configuring the web server connector for ColdFusion MX 7 (multiserver)Running apache connector wizard...Connector installation succeeded for apache[root@Leonid bin]#

Page 46: Running ColdFusion MX 7 on Linux and Unix

46

Examining connector installation

[root@Leonid wsconfig]# pwd/opt/jrun4/lib/wsconfig[root@Leonid wsconfig]# cat wsconfig.log # Created by JRun on 12/14 19:26:1112/14 19:26:11 info Macromedia JRun 4 (Build 84683)12/14 19:26:12 debug Found JRun server cfusion at 127.0.0.1:290212/14 19:26:16 debug Fedora Core release 3 (Heidelberg)12/14 19:26:16 debug Detected Red Hat Linux release 312/14 19:26:16 debug Using Apache binary /usr/sbin/httpd12/14 19:26:16 info Server version: Apache/2.0.5212/14 19:26:16 debug Using Apache control script /usr/sbin/apachectl12/14 19:26:16 debug Parsing Apache configuration file /etc/httpd/conf/httpd.conf12/14 19:26:16 debug Exec'ing chmod 777 /opt/jrun4/lib/wsconfig/112/14 19:26:16 debug Set permission to 777 on /opt/jrun4/lib/wsconfig/112/14 19:26:16 debug Exec'ing chmod +x /opt/jrun4/lib/wsconfig/1/mod_jrun20.so12/14 19:26:16 debug Set permission to execute on /opt/jrun4/lib/wsconfig/1/mod_jrun20.so12/14 19:26:16 debug Created file /opt/jrun4/lib/wsconfig/1/mod_jrun20.so12/14 19:26:16 debug Wrote file /etc/httpd/conf/httpd.conf12/14 19:26:16 debug Added JRun configuration to Apache configuration file /etc/httpd/conf/httpd.conf12/14 19:26:16 debug Created file /opt/jrun4/lib/wsconfig/1/README.txt12/14 19:26:16 debug Wrote file /opt/jrun4/lib/wsconfig/wsconfig.properties12/14 19:26:16 debug Exec'ing /usr/sbin/apachectl restart12/14 19:26:16 info Restarted Apache server[root@Leonid wsconfig]# ls -ltotal 24drwxrwxrwx 2 root root 4096 Dec 14 19:26 1-rw-r--r-- 1 root root 1312 Dec 14 19:26 wsconfig.log-rw-r--r-- 1 root root 189 Dec 14 19:26 wsconfig.properties[root@Leonid wsconfig]# ls -l 1/total 92-rwxr-xr-x 1 root root 74768 Sep 2 07:14 mod_jrun20.so-rw-r--r-- 1 root root 272 Dec 14 19:26 README.txt[root@Leonid wsconfig]#

Page 47: Running ColdFusion MX 7 on Linux and Unix

47

Examining JRun Container in Apache httpd.conf

[root@Leonid bin]# tail -133 /etc/httpd/conf/httpd.conf | head -16# JRun SettingsLoadModule jrun_module /opt/jrun4/lib/wsconfig/1/mod_jrun20.so<IfModule mod_jrun20.c> JRunConfig Verbose false JRunConfig Apialloc false JRunConfig Ssl false JRunConfig Ignoresuffixmap false JRunConfig Serverstore /opt/jrun4/lib/wsconfig/1/jrunserver.store JRunConfig Bootstrap 127.0.0.1:51020 #JRunConfig Errorurl <optionally redirect to this URL on errors> #JRunConfig ProxyRetryInterval <number of seconds to wait before trying to reconnect to unreachable clustered server> #JRunConfig ConnectTimeout 15 #JRunConfig RecvTimeout 300 #JRunConfig SendTimeout 15 AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf</IfModule>[root@Leonid bin]#

** Be aware of the“Pull the plug bug”

Page 48: Running ColdFusion MX 7 on Linux and Unix

48

Monitoring Memory on Linux with top

[root@Leonid bin]# topTasks: 102 total, 1 running, 101 sleeping, 0 stopped, 0 zombieCpu(s): 2.0% us, 1.0% sy, 0.0% ni, 97.1% id, 0.0% wa, 0.0% hi, 0.0% siMem: 775588k total, 574240k used, 201348k free, 47532k buffersSwap: 1052216k total, 8k used, 1052208k free, 330668k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 14455 root 21 0 843m 81m 99m S 0.0 10.8 0:06.30 jrun 3010 root 15 0 80536 24m 61m S 0.0 3.2 13:30.00 X 6794 root 15 0 17828 9.9m 11m S 0.0 1.3 0:01.10 httpd 7774 cfmx 15 0 46840 9.9m 11m S 0.0 1.3 0:00.69 k2server 7657 cfmx 15 0 42236 6532 12m S 0.0 0.8 0:00.10 k2admin 7777 cfmx 15 0 47492 5888 10m S 0.0 0.8 0:00.03 k2index

The difference among VIRT, RES, and SHR in top outputhttp://gentoo-wiki.com/Linux_Memory_Management

VIRT stands for the virtual size of a process, which is the sum of memory it is actually using, memory it has mapped into itself (for instance the video card's RAM for the X server), files on disk that have been mapped into it (most notably shared libraries), and memory shared with other processes. VIRT represents how much memory the program is able to access at the present moment.

RES stands for the resident size, which is an accurate representation of how much actual physical memory a process is consuming. (This also corresponds directly to the %MEM column.) This will virtually always be less than the VIRT size, since most programs depend on the C library.

SHR indicates how much of the VIRT size is actually sharable (memory or libraries). In the case of libraries, it does not necessarily mean that the entire library is resident. For example, if a program only uses a few functions in a library, the whole library is mapped and will be counted in VIRT and SHR, but only the parts of the library file containing the functions being used will actually be loaded in and be counted under RES.

Page 49: Running ColdFusion MX 7 on Linux and Unix

49

Server Configuration Installation on Linux – GUI

Page 50: Running ColdFusion MX 7 on Linux and Unix

50

GUI Install Options

Page 51: Running ColdFusion MX 7 on Linux and Unix

51

GUI Installation – Server Configuration (1/19)

Page 52: Running ColdFusion MX 7 on Linux and Unix

52

GUI Installation – Server Configuration (2/19)

Page 53: Running ColdFusion MX 7 on Linux and Unix

53

GUI Installation – Server Configuration (3/19)

Page 54: Running ColdFusion MX 7 on Linux and Unix

54

GUI Installation – Server Configuration (5/19)

Page 55: Running ColdFusion MX 7 on Linux and Unix

55

GUI Installation – Server Configuration (6/19)

Note to self: log bug for “Sserver configuration”

Page 56: Running ColdFusion MX 7 on Linux and Unix

56

GUI Installation – Server Configuration (7/19)

• ODBC not available• Option to install init scripts

Page 57: Running ColdFusion MX 7 on Linux and Unix

57

GUI Installation – Server Configuration (8/19)

Page 58: Running ColdFusion MX 7 on Linux and Unix

58

GUI Installation – Server Configuration (9/19)

Page 59: Running ColdFusion MX 7 on Linux and Unix

59

GUI Installation – Server Configuration (10/19)

Page 60: Running ColdFusion MX 7 on Linux and Unix

60

GUI Installation – Server Configuration (11/19)

Page 61: Running ColdFusion MX 7 on Linux and Unix

61

GUI Installation – Server Configuration (12/19)

Page 62: Running ColdFusion MX 7 on Linux and Unix

62

GUI Installation – Server Configuration (13/19)

Page 63: Running ColdFusion MX 7 on Linux and Unix

63

GUI Installation – Server Configuration (14/19)

Page 64: Running ColdFusion MX 7 on Linux and Unix

64

GUI Installation – Server Configuration (15/19)

Page 65: Running ColdFusion MX 7 on Linux and Unix

65

GUI Installation – Server Configuration (16/19)

Page 66: Running ColdFusion MX 7 on Linux and Unix

66

GUI Installation – Server Configuration (17/19)

Page 67: Running ColdFusion MX 7 on Linux and Unix

67

GUI Installation – Server Configuration (18/19)

Page 68: Running ColdFusion MX 7 on Linux and Unix

68

GUI Installation – Server Configuration (19/19)

Page 69: Running ColdFusion MX 7 on Linux and Unix

69

Processes, Directories, Files, Init Scripts

Starting ColdFusion

“Auto” Webserver Configuration

Page 70: Running ColdFusion MX 7 on Linux and Unix

70

Server Configuration – Directory Contents

[root@Leonid bin]# pwd/opt/coldfusionmx7/bin[root@Leonid bin]# ls -ltotal 2280-rwxr-xr-x 1 cfmx bin 5639 Dec 14 20:50 cfcompile.sh-rwxr-xr-x 1 cfmx bin 1501420 May 23 2001 cfencode.exe-rwxr-xr-x 1 cfmx bin 110264 Mar 12 2002 cfencode.linux-rwxr-xr-x 1 cfmx bin 527624 Mar 12 2002 cfencode.solaris-rwxr-xr-x 1 cfmx bin 254 Dec 14 20:50 cfinfo-rwxr-xr-x 1 cfmx bin 54723 Dec 14 20:50 cfmx7-rwxr-xr-x 1 cfmx bin 1749 Dec 14 20:50 cfmx-connectors.sh-rwxr-xr-x 1 cfmx bin 4866 Dec 14 20:50 cfmx-init.sh-rwxr-xr-x 1 cfmx bin 1412 Dec 14 20:50 cfmx7search-rwxr-xr-x 1 cfmx bin 416 Dec 14 20:50 cfscan.sh-rwxr-xr-x 1 cfmx bin 431 Dec 14 20:50 cfstat-rwxr-xr-x 1 cfmx bin 7126 Dec 14 20:50 coldfusiondrwxrwxr-x 2 cfmx bin 4096 Dec 14 20:50 connectors-rwxr-xr-x 1 cfmx bin 860 Dec 14 20:50 findjava.sh-rwxr-xr-x 1 cfmx bin 377 Dec 14 20:50 SMSClient.sh

[root@Leonid bin]# ls -l /etc/init.d/ | grep mx-rwxr-xr-x 1 root root 1412 Dec 14 20:50 cfmx7search-rwxr-xr-x 1 root root 7126 Dec 14 20:50 coldfusionmx7

Page 71: Running ColdFusion MX 7 on Linux and Unix

71

k2admin Processes Running

[root@Leonid bin]# ps -ef | grep coldcfmx 16311 1 0 20:49 pts/3 /opt/coldfusionmx7/verity/k2/_ilnx21/bin/k2admincfmx 16471 16475 0 20:50 pts/3 /opt/coldfusionmx7/verity/k2/_ilnx21/bin/k2server -ualias ColdFusionK2_server1cfmx 16474 16475 0 20:50 pts/3 /opt/coldfusionmx7/verity/k2/_ilnx21/bin/k2index –ualias ColdFusionK2_indexserver1

Page 72: Running ColdFusion MX 7 on Linux and Unix

72

Starting k2 on Red Hat Linux

[root@Leonid bin]# ls -l /etc/init.d/ | grep mx-rwxr-xr-x 1 root root 1412 Dec 14 20:50 cfmx7search-rwxr-xr-x 1 root root 7126 Dec 14 20:50 coldfusionmx7[root@Leonid bin]# service cfmx7search stop[root@Leonid bin]# service cfmx7search startSUCCESS: Created with process ID: 19307 Please use the k2adminstop script to terminate process[root@Leonid bin]#

Page 73: Running ColdFusion MX 7 on Linux and Unix

73

Starting the Server Configuration

[root@Leonid bin]# ls -l /etc/init.d/ | grep mx-rwxr-xr-x 1 root root 1412 Dec 14 20:50 cfmx7search-rwxr-xr-x 1 root root 7126 Dec 14 20:50 coldfusionmx7

[root@Leonid bin]# pwd/opt/coldfusionmx7/bin

[root@Leonid bin]# service coldfusionmx7 startStarting ColdFusion MX 7...The ColdFusion MX 7 server is starting up and will be available shortly.======================================================================Running the ColdFusion MX 7 connector wizard======================================================================Configuring the web server connector (Launched on the first run of the ColdFusion MX 7 start script)Running apache connector wizard...ColdFusion MX 7 not started, will retry connector 12 more time(s)Connector installation succeeded for apache======================================================================ColdFusion MX 7 has been started.ColdFusion MX 7 will write logs to /opt/coldfusionmx7/logs/cfserver.log======================================================================[root@Leonid bin]#

Page 74: Running ColdFusion MX 7 on Linux and Unix

74

Turning off/on ColdFusion init scripts on Linux

[root@Leonid ~]# cd /etc/init.d/[root@Leonid init.d]# ls -l | grep mx-rwxr-xr-x 1 root root 1412 Dec 14 20:50 cfmx7search-rwxr-xr-x 1 root root 7126 Dec 14 20:50 coldfusionmx7

[root@Leonid init.d]# chkconfigchkconfig version 1.3.11.1 - Copyright (C) 1997-2000 Red Hat, Inc.This may be freely redistributed under the terms of the GNU Public License.

usage: chkconfig --list [name] chkconfig --add <name> chkconfig --del <name> chkconfig [--level <levels>] <name> <on|off|reset>

[root@Leonid init.d]# chkconfig cfmx7search off[root@Leonid init.d]# chkconfig --list cfmx7searchcfmx7search 0:off 1:off 2:off 3:off 4:off 5:off 6:off

[root@Leonid init.d]# chkconfig cfmx7search on[root@Leonid init.d]# chkconfig --list cfmx7searchcfmx7search 0:off 1:off 2:on 3:on 4:on 5:on 6:off[root@Leonid init.d]#

Page 75: Running ColdFusion MX 7 on Linux and Unix

75

Server Configuration – $CFHOME/runtime/servers

[root@Leonid ~]# ls -l /opt/coldfusionmx7/runtime/servers/total 16drwxrwxr-x 3 cfmx bin 4096 Dec 14 20:50 coldfusiondrwxrwxr-x 2 cfmx bin 4096 Dec 14 20:50 lib[root@Leonid ~]#

ColdFusion MX 6.x used server named “default”

ColdFusion MX 7 uses server named “coldfusion”

A $cfhome/runtime/servers/lib directory is provided by default

Page 76: Running ColdFusion MX 7 on Linux and Unix

76

Settings and Migration Wizard

Page 77: Running ColdFusion MX 7 on Linux and Unix

77

Settings & Migration Wizard

Page 78: Running ColdFusion MX 7 on Linux and Unix

78

Settings & Migration Wizard

Page 79: Running ColdFusion MX 7 on Linux and Unix

79

Settings & Migration Wizard

Page 80: Running ColdFusion MX 7 on Linux and Unix

80

Settings & Migration Wizard

Page 81: Running ColdFusion MX 7 on Linux and Unix

81

Settings & Migration Wizard

Page 82: Running ColdFusion MX 7 on Linux and Unix

82

ColdFusion MX 7 Administrator

Page 83: Running ColdFusion MX 7 on Linux and Unix

83

Server Configuration on Solaris with iPlanet

Directories, Files, Startup, Processes

Examining the Webserver Configuration

Uninstalling ColdFusion

Page 84: Running ColdFusion MX 7 on Linux and Unix

84

The $CFHOME/bin Directory

bash-2.03# pwd/opt/coldfusionmx7/bin

bash-2.03# ls -ltotal 4586-rwxr-xr-x 1 nobody other 538 Dec 15 13:46 SMSClient.sh-rwxr-xr-x 1 nobody other 5768 Dec 15 13:45 cfcompile.sh-rwxr-xr-x 1 nobody other 1501420 May 23 2001 cfencode.exe-rwxr-xr-x 1 nobody other 110264 Mar 12 2002 cfencode.linux-rwxr-xr-x 1 nobody other 527624 Mar 12 2002 cfencode.solaris-rwxr-xr-x 1 nobody other 254 Dec 15 13:45 cfinfo-rwxr-xr-x 1 nobody other 1736 Dec 15 13:46 cfmx-connectors-run.sh-rwxr-xr-x 1 nobody other 4923 Dec 15 13:45 cfmx-init.sh-rwxr-xr-x 1 nobody other 127080 Dec 15 13:46 cfmx7-rwxr-xr-x 1 nobody other 1416 Dec 15 13:45 cfmx7search-rwxr-xr-x 1 nobody other 483 Dec 15 13:46 cfscan.sh-rwxr-xr-x 1 nobody other 431 Dec 15 13:45 cfstat-rwxr-xr-x 1 nobody other 7142 Dec 15 13:45 coldfusiondrwxrwxr-x 2 nobody other 512 Dec 15 13:46 connectors-rwxr-xr-x 1 nobody other 860 Dec 15 13:46 findjava.shlrwxrwxrwx 1 root other 41 Dec 15 14:40 jvm.config -> /opt/coldfusionmx7/runtime/bin/jvm.config

Page 85: Running ColdFusion MX 7 on Linux and Unix

85

Using the cfmx-init.sh Script on Solaris

Init scripts option during ColdFusion MX 7 installation

bash-2.03# ./cfmx-init.sh installUse this script to install System 5 start scripts for CF to start on boot

bash-2.03# ./cfmx-init.sh -hUsage:./cfmx-init.sh (install|uninstall|install-verity|uninstall-verity)

bash-2.03# ./cfmx-init.sh installCreating the Coldfusion MX 7 start script /etc/init.d/coldfusionmx7Adding ColdFusion MX 7 start/kill linksInstall completebash-2.03#

bash-2.03# ./cfmx-init.sh uninstallRemoving the CFMX Search start script /etc/init.d/cfmx7searchRemoving CFMX Search start/kill linksRemoving /etc/rc3.d/S25coldfusionmx7Removing /etc/rc1.d/K19coldfusionmx7Removing /etc/init.d/coldfusionmx7Uninstall complete

Running cfmx-init.sh to install start scripts

Removing the start scripts

Usage

Page 86: Running ColdFusion MX 7 on Linux and Unix

86

Starting ColdFusion on Solaris

bash-2.03# ./coldfusion startStarting ColdFusion MX 7...The ColdFusion MX 7 server is starting up and will be available shortly.======================================================================Running the ColdFusion MX 7 connector wizard======================================================================Configuring the web server connector (Launched on the first run of the ColdFusion MX 7 start script)Running iPlanet connector wizard...ColdFusion MX 7 not started, will retry connector 12 more time(s)ColdFusion MX 7 not started, will retry connector 11 more time(s)Connector installation succeeded for iPlanet======================================================================ColdFusion MX 7 has been started.ColdFusion MX 7 will write logs to /opt/coldfusionmx7/logs/cfserver.log======================================================================bash-2.03#

bash-2.03# ps -ef | grep cfmx7 nobody 6706 1 0 pts/4 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -autorestart -start coldfusion nobody 6708 6706 0 pts/4 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusion nobody 4164 4105 0 pts/4 /opt/coldfusionmx7/verity/k2/_ssol26/bin/k2server -ualias ColdFusionK2_server1 nobody 4165 4105 0 pts/4 /opt/coldfusionmx7/verity/k2/_ssol26/bin/k2index -ualias ColdFusionK2_indexserv nobody 4105 1 0 pts/4 /opt/coldfusionmx7/verity/k2/_ssol26/bin/k2adminbash-2.03#

Page 87: Running ColdFusion MX 7 on Linux and Unix

87

The wsconfig.log File

bash-2.03# cat wsconfig.log# Created by JRun on 12/15 14:40:3712/15 14:41:04 info Macromedia JRun 4 (Build 84683)12/15 14:41:11 debug Found JRun server default at 127.0.0.1:290112/15 14:41:11 debug Found JRun server coldfusion at 127.0.0.1:292012/15 14:41:16 debug Parsing Sun ONE Web Server (iPlanet) configuration file /opt/sunone6/servers/https-blackstone/config/magnus.conf12/15 14:41:16 debug Parsing Sun ONE Web Server (iPlanet) configuration file /opt/sunone6/servers/https-blackstone/config/obj.conf12/15 14:41:16 debug Exec'ing chmod 777 /opt/coldfusionmx7/runtime/lib/wsconfig/112/15 14:41:17 debug Set permission to 777 on /opt/coldfusionmx7/runtime/lib/wsconfig/112/15 14:41:17 debug Exec'ing chmod +x /opt/coldfusionmx7/runtime/lib/wsconfig/1/libjrun_nsapi.so12/15 14:41:17 debug Set permission to execute on /opt/coldfusionmx7/runtime/lib/wsconfig/1/libjrun_nsapi.so12/15 14:41:17 debug Created file /opt/coldfusionmx7/runtime/lib/wsconfig/1/libjrun_nsapi.so12/15 14:41:17 debug Wrote file /opt/sunone6/servers/https-blackstone/config/magnus.conf12/15 14:41:17 debug Added JRun configuration to Sun ONE Web Server (iPlanet) configuration file /opt/sunone6/servers/https-blackstone/config/magnus.conf12/15 14:41:17 debug Wrote file /opt/sunone6/servers/https-blackstone/config/obj.conf12/15 14:41:17 debug Added JRun configuration to Sun ONE Web Server (iPlanet) configuration file /opt/sunone6/servers/https-blackstone/config/obj.conf12/15 14:41:17 debug Created file /opt/coldfusionmx7/runtime/lib/wsconfig/1/README.txt12/15 14:41:17 debug Wrote file /opt/coldfusionmx7/runtime/lib/wsconfig/wsconfig.properties12/15 14:41:17 debug Parsing Sun ONE Web Server (iPlanet) configuration file /opt/sunone6/servers/https-blackstone/config/mime.types12/15 14:41:17 debug Exec'ing /opt/sunone6/servers/https-blackstone/stop12/15 14:41:19 info Stopped Sun ONE Web Server (iPlanet) server12/15 14:41:19 debug Exec'ing /opt/sunone6/servers/https-blackstone/start12/15 14:41:26 info Started Sun ONE Web Server (iPlanet) server

Page 88: Running ColdFusion MX 7 on Linux and Unix

88

What Changed in iPlanet Config?

bash-2.03# diff backup/obj.conf obj.conf4c4< NameTrans fn="pfx2dir" from="/servlet" dir="$docroot/servlet" name="ServletByExt"---> #JRun NameTrans fn="pfx2dir" from="/servlet" dir="$docroot/servlet" name="ServletByExt"11c11,19< PathCheck fn=find-index index-names="index.html,home.html"---> PathCheck fn=find-index index-names="index.html,home.html,index.cfm"> PathCheck fn="jrunfilter"> ObjectType fn=type-by-exp exp=*.jsp type="jrun-internal/ext"> ObjectType fn=type-by-exp exp=*.jws type="jrun-internal/ext"> ObjectType fn=type-by-exp exp=*.cfm type="jrun-internal/ext"> ObjectType fn=type-by-exp exp=*.cfml type="jrun-internal/ext"> ObjectType fn=type-by-exp exp=*.cfc type="jrun-internal/ext"> ObjectType fn=type-by-exp exp=*.cfr type="jrun-internal/ext"> ObjectType fn=type-by-exp exp=*.cfswf type="jrun-internal/ext"13a22> Service method=(GET|HEAD|POST) type="jrun-internal/*" fn="jrunservice"--------------------------------------------------------------------bash-2.03# diff backup/magnus.conf magnus.conf22a23,24> Init fn="load-modules" shlib="/opt/coldfusionmx7/runtime/lib/wsconfig/1/libjrun_nsapi.so" funcs="jruninit,jrunfilter,jrunservice"> Init fn="jruninit" serverstore="/opt/coldfusionmx7/runtime/lib/wsconfig/1/jrunserver.store" bootstrap="127.0.0.1:51011" verbose="false" apialloc="false" ssl="="<optionally redirect to this URL on errors>" connecttimeout="15" recvtimeout="300" sendtimeout="15"

Page 89: Running ColdFusion MX 7 on Linux and Unix

89

Uninstalling ColdFusion on Solaris

bash-2.03# /opt/coldfusionmx7/uninstall/uninstallPreparing CONSOLE Mode Installation...=============================================================================== (created with InstallAnywhere by Zero G)===============================================================================Uninstall Macromedia ColdFusion MX 7------------------------------------About to uninstall...Macromedia ColdFusion MX 7

This removes features installed by the ColdFusion installer. It does not removefiles and folders that you created after the installation.

===============================================================================Uninstalling...---------------...*****************************************************************************************************...**===============================================================================Uninstall Complete------------------All items were successfully uninstalled.

bash-2.03# ls -l coldfusionmx7total 354drwxrwxr-x 2 nobody other 512 Dec 15 16:06 logs-rw-r--r-- 1 root other 167316 Dec 15 16:04 truss.out

Page 90: Running ColdFusion MX 7 on Linux and Unix

90

Thread Dumps

Page 91: Running ColdFusion MX 7 on Linux and Unix

91

Generating Thread Dumps on Linux

[root@Leonid init.d]# pstree -p | grep cfmx7cfmx7(2596)--cfmx7(2598)--cfmx7(2603)---|--cfmx7(2604) |--cfmx7(2605) |--cfmx7(2606)

Technote 18339 indicates “pstree –p | grep cfusion” to generate process tree. This does not work with ColdFusion MX 7. May catch CFMX 6.1 if also running.

Linux: Use “pstree –p | grep cfmx7 | head -3”, identify the second PID from left

[root@Leonid coldfusionmx7]# ls -l logs/cfserver.log -rw-rw-r-- 1 cfmx bin 8065 Dec 15 11:03 logs/cfserver.log

[root@Leonid coldfusionmx7]# kill -3 2598

[root@Leonid coldfusionmx7]# ls -l logs/cfserver.log -rw-rw-r-- 1 cfmx bin 27814 Dec 15 11:55 logs/cfserver.log[root@Leonid coldfusionmx7]#

Page 92: Running ColdFusion MX 7 on Linux and Unix

92

Generating Thread Dumps on Solaris

Solaris: Use “ps -ef | grep cfmx7”, then identify the second (the highest) process id

# ps -ef | grep cfmx7 nobody 6706 1 0 14:40:16 pts/4 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -autorestart -start coldfusion nobody 6708 6706 0 14:40:16 pts/4 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusion

# pwd/opt/coldfusionmx7

# ls -l logs/cfserver.log-rw-rw-r-- 1 nobody other 3303 Dec 15 15:48 logs/cfserver.log

# kill -3 6708

# ls -l logs/cfserver.log-rw-rw-r-- 1 nobody other 21206 Dec 15 15:58 logs/cfserver.log

Page 93: Running ColdFusion MX 7 on Linux and Unix

93

Adding Timestamp to Thread Dump

[root@Leonid coldfusionmx7]# dateWed Dec 15 11:59:07 EST 2004

[root@Leonid coldfusionmx7]# echo "Taking thread dump now: `date`"Taking thread dump now: Wed Dec 15 11:59:39 EST 2004

[root@Leonid coldfusionmx7]# echo "Taking thread dump now: `date`" >> logs/cfserver.log

[root@Leonid coldfusionmx7]# kill -3 2598

[root@Leonid coldfusionmx7]# echo "Finished thread dump now: `date`" >> logs/cfserver.log

Append date and time stamp to log file as delimters of thread dump

Use “{command} >> {log file}”

Using the “date” command

Page 94: Running ColdFusion MX 7 on Linux and Unix

94

Miscellaneous

Page 95: Running ColdFusion MX 7 on Linux and Unix

95

Installation Debugging Options

LAX_DEBUG=trueSet the debug enviroment variable LAX_DEBUG=true from the active shell before running installer to output to the console, mixing with the usual install text.

[root@Leonid ~]# export LAX_DEBUG=true [root@Leonid ~]# ./coldfusionmx-macr-linux.bin

–DSAVE_DEBUG_OUTPUT=trueStart the installer with the argument –DSAVE_DEBUG_OUTPUT=true to output debug info to {cfroot}/install_debug.txt

[root@Leonid ~]# ./coldfusionmx-macr-linux.bin –DSAVE_DEBUG_OUTPUT=true

Use Both TogetherUse both the above together to get debug info at the console and install_debug.txt log file.

Page 96: Running ColdFusion MX 7 on Linux and Unix

96

The wsconfig Utility Fails

Found port 2901 on host localhostcould not connect to port 2901 on host 127.0.0.1javax.naming.ServiceUnavailableException: The connection to the remoteJNDI server on host 127.0.0.1 at port 2901 has failed (as have allbackup hosts listed, if any) - please verify that the server is runningand the NamingService is available [Root exception is java.net.ConnectException: Connection refused]<snip> { java stack trace here } </snip>

Could not connect to any JRun/ColdFusion servers on host localhost.Possible causes:o Server not running-Start Macromedia JRun4 or ColdFusion MX servero Server running-JNDI listen port in jndi.properties blocked by TCP/IP filtering or firewall on server-host restriction in security.properties blocking communication with server

Is there a firewall on local system?Red Hat: Use lokkit to disable local firewall

Is there a problem with the Network configuration on the system?Red Hat: check /etc/hosts and /etc/sysconfig/network SuSE: check /etc/hosts and /etc/HOSTNAME

Page 97: Running ColdFusion MX 7 on Linux and Unix

97

Turning off firewall on Red Hat Linux with lokkit

Page 98: Running ColdFusion MX 7 on Linux and Unix

98

SELinux

Security Enhanced Linux – Coming to a Linux Distribution Near You!

National Security Agency (NSA), with the help of Linux community, has developed an access control architecture to confine processes to only the files they need to complete their actions. This architecture is called security-enhanced Linux, or SELinux for short. SELinux, is a Mandatory Access Control (MAC) security system for Linux based on the domain-type model. It was written by the NSA and is comprised of a kernel module (included in all 2.6 kernels), patches to certain security related applications, and a security policy.

http://www.nsa.gov/selinux/http://www.redhat.com/magazine/001nov04/features/selinux/http://fedora.redhat.com/docs/selinux-faq-fc3/index.html

Red Hat Enterprise Linux 4 (and FC3) includes SELinux (targeted policy in enforcing mode)

http://www.eweek.com/article2/0,1759,1707481,00.asphttp://www.linuxcompatible.org/story36797.html

Two Security Policy Types - Permissive – Provides limited MAC in warning mode - Enforcing – Provides and enforces a comprehensive, strict MAC.

Page 99: Running ColdFusion MX 7 on Linux and Unix

99

SELinux

Q: How do I turn enforcing on/off at boot?A: You can specify the SELinux mode using the configuration file

/etc/sysconfig/selinux # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. # SELINUX=permissive SELINUX=enforcing # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted

[root@Aneto wsconfig]# service httpd restartStopping httpd: [ OK ]Starting httpd: Syntax error on line 907 of /etc/httpd/conf/httpd.conf: Cannot load /opt/coldfusionmx7/runtime/lib/wsconfig/1/mod_jrun20.so into server: /opt/coldfusionmx7/runtime/lib/wsconfig/1/mod_jrun20.so: failed to map segment from shared object: Permission denied[FAILED]

Starting Apache when SELinux in enforcing mode and configured for CFMX

Page 100: Running ColdFusion MX 7 on Linux and Unix

100

Building Connector From Source

[root@Aneto ~]# cd /tmp/[root@Aneto tmp]# mkdir cfmx7connector; cd cfmx7connector/[root@Aneto cfmx7connector]# cp /opt/coldfusionmx7/runtime/lib/wsconfig.jar .[root@Aneto cfmx7connector]# lswsconfig.jar[root@Aneto cfmx7connector]# jar -xf wsconfig.jar [root@Aneto cfmx7connector]# ls -ltotal 2420drwxr-xr-x 7 root root 4096 Mar 10 11:22 connectorsdrwxr-xr-x 3 root root 4096 Mar 10 11:22 javaxdrwxr-xr-x 6 root root 4096 Mar 10 11:22 jrundrwxr-xr-x 12 root root 4096 Mar 10 11:22 jrunxdrwxr-xr-x 2 root root 4096 Mar 10 11:22 META-INFdrwxr-xr-x 3 root root 4096 Mar 10 11:22 org-rwxr-xr-x 1 root root 2417853 Mar 10 11:21 wsconfig.jar[root@Aneto cfmx7connector]# find . -name ApacheBuild*.txt./connectors/src/ApacheBuildInstructions.txt[root@Aneto cfmx7connector]#

Connector source not extracted in ColdFusion MX 7

Page 101: Running ColdFusion MX 7 on Linux and Unix

101

Building Connector From Source

When to recompile connector:

- To eliminate the EAPI warning with Apache 1.3.x - If you built Apache 2 from source rather than use the default Apache RPM - If Apache seems to not respond for CFM or HTML when configured for CF

ApacheBuildInstructions.txt provides instructions, although rather tedious

- Bug 59013 open to provide easy mechanism for rebuilding connector - http://www.talkingtree.com/downloads/index.cfm?item=make_connector_from_source_apache2.tar.gz

Page 102: Running ColdFusion MX 7 on Linux and Unix

102

ColdFusion on a “Headless” System

TechNote 18747 Error: This graphics environment can be used only in the software emulation mode

•Modify the jvm.config file as follows•Stop the ColdFusion process: /cf_root/bin/coldfusion stop •Open the file /cf_root/runtime/bin/jvm.config in a text editor.

•For cfchart and cfgraph issues, modify the graphics argument so it reads as indicated: java.args=-DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Xbootclasspath/a:{application.home}/lib/webchartsJava2D.jar-Djava.awt.graphicsenv=com.gp.java2d.ExHeadlessGraphicsEnvironment -Xmx512m

•If you have problems with other graphics objects, add the following argument instead: java.args=-DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Xmx512m -Djava.awt.headless=true

Note: Using this option will disable cfchart functionality.

•Save the changes to jvm.config. •Start the ColdFusion process: /cf_root/bin/coldfusion start

Many environments do not have a display, keyboard, or mouse. Such an environment is called a "headless" graphics environment. Headless support is enabled in version 1.4.1 and higher of the Java 2 SDK. New Java 1.4 methods indicate whether a display, keyboard, and mouse can be supported in a graphics environment. Due to this new area of functionality, changes need to be made to the JVM arguments used by ColdFusion MX in order for cfchart, cfgraph, and other graphical objects to function correctly.

Page 103: Running ColdFusion MX 7 on Linux and Unix

103

Collecting System Information on Linux

[root@Leonid ~]# uname -aLinux Leonid 2.6.9-1.667 #1 Tue Nov 2 14:41:25 EST 2004 i686 i686 i386 GNU/Linux

[root@Leonid ~]# cat /etc/redhat-releaseFedora Core release 3 (Heidelberg)

ps-shiraz:~ # cat /etc/SuSE-releaseSuSE Linux 8.2 (i586)VERSION = 8.2

[root@Leonid ~]# cat /proc/cpuinfoprocessor : 0vendor_id : GenuineIntelcpu family : 6model : 13model name : Intel(R) Pentium(R) M processor 1.50GHzcpu MHz : 599.612...

[root@Leonid ~]# cat /proc/meminfo MemTotal: 775588 kBMemFree: 194180 kBBuffers: 97988 kBCached: 189164 kBSwapCached: 0 kBActive: 253884 kBInactive: 203880 kBHighTotal: 0 kBHighFree: 0 kB...[root@Leonid opt]#

Page 104: Running ColdFusion MX 7 on Linux and Unix

104

Using The Debugging Tool strace

[root@Leonid bin]# strace ./coldfusion startexecve("./coldfusion", ["./coldfusion", "start"], [/* 19 vars */]) = 0uname({sys="Linux", node="Leonid", ...}) = 0brk(0) = 0x9701000access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)...close(3) = 0open("/proc/meminfo", O_RDONLY) = 3fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6df1000read(3, "MemTotal: 775588 kB\nMemFre"..., 1024) = 644close(3) ...open("/opt/coldfusionmx7/logs/cfserver.log", O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666) = 3fcntl64(1, F_GETFD) = 0...dup2(3, 1) = 1close(3) .....stat64("/opt/coldfusionmx7/bin/cfmx-connectors.sh", 0xfee44090) = -1 ENOENT 71======================================================================) = 71write(1, "ColdFusion MX 7 has been started"..., 34ColdFusion MX 7 has been started.) = 34

strace

strace is a useful diagnostic, instructional, and debugging tool. System administrators, diagnosticians and trouble-shooters will find it invaluable for solving problems with programs for which the source is not readily available since they do not need to be recompiled in order to trace them. Students, hackers and the overly-curious will find that a great deal can be learned about a system and its system calls by tracing even ordinary programs.

Using strace

Page 105: Running ColdFusion MX 7 on Linux and Unix

105

Using The Debugging Tool truss

bash-2.03# ps -ef | grep cfmx7 nobody 6706 1 0 14:40:16 pts/4 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -autorestart -start coldfusion nobody 6708 6706 0 14:40:16 pts/4 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusion

bash-2.03# truss -o truss.out -p 6708^Cbash-2.03#

bash-2.03# ls -l | grep truss-rw-r--r-- 1 root other 167316 Dec 15 16:04 truss.out

lwp_cond_wait(0x006CABF0, 0x006CABD8, 0xCB481460) Err#62 ETIMElwp_cond_wait(0x006C9228, 0x006C9210, 0xCDA01460) Err#62 ETIMEopen64("/opt/coldfusionmx7/Mail/Spool", O_RDONLY|O_NDELAY) = 14fcntl(14, F_SETFD, 0x00000001) = 0fstat64(14, 0xCB481418) = 0getdents64(14, 0x00725318, 1048) = 48getdents64(14, 0x00725318, 1048) = 0close(14) = 0stat64(“/opt/coldfusionmx7/runtime/servers/lib/jrun/servlet/jrpp/JrppInputStream.class", 0xCF0FF4D0) Err#2 ENOENTstat64("/opt/coldfusionmx7/runtime/lib/jrun/servlet/jrpp/JrppInputStream.class", 0xCF0FF4D0) Err#2 ENOENTopen(“/opt/coldfusionmx7/logs/application.log", O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666) = 23stat64("/opt/coldfusionmx7/logs/application.log", 0xCEF000D0) = 0resolvepath("/opt/coldfusionmx7/logs/application.log", "/opt/coldfusionmx7/logs/application.log", 1024) = 39stat64("/opt/coldfusionmx7/logs/application.log", 0xCEEFF628) = 0stat64("/opt/coldfusionmx7/logs/application.log", 0xCEF001E8) = 0stat64("/opt/coldfusionmx7/logs/exception.log", 0xCEF001D0) = 0

truss

Using truss

truss output

The truss utility executes the specified command and produces a trace of the system calls it performs, the signals it receives, and the machine faults it incurs. Each line of the trace output reports either the fault or signal name or the system call name with its arguments and return value(s). System call arguments are displayed symbolically when possible using ....

Page 106: Running ColdFusion MX 7 on Linux and Unix

106

JRun Metrics

<attribute name="metricsFormat">Web threads (busy/total): {jrpp.busyTh}/{jrpp.totalTh} Sessions: {sessions} Total Memory={totalMemory} Free={freeMemory}</attribute>

Technote 19120http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19120

Metrics Service in jrun.xml are still not appropriate for ColdFusion server configuration.

Must remove any “jrpp.” prefixes before metric parameters.

Page 107: Running ColdFusion MX 7 on Linux and Unix

107

JRun Proxy Service Settings

<service class="jrun.servlet.jrpp.JRunProxyService" name="ProxyService"> <attribute name="activeHandlerThreads">8</attribute> <attribute name="minHandlerThreads">1</attribute> <attribute name="maxHandlerThreads">1000</attribute> <attribute name="mapCheck">0</attribute> <attribute name="threadWaitTimeout">20</attribute> <attribute name="backlog">500</attribute> <attribute name="deactivated">false</attribute> <attribute name="interface">*</attribute> <attribute name="port">51011</attribute> <attribute name="timeout">300</attribute> <!-- set this to false for multi-hosted sites --> <attribute name="cacheRealPath">false</attribute> ...</service>

Server Configuration in jrun.xml

<service class="jrun.servlet.jrpp.JRunProxyService" name="ProxyService"> <attribute name="activeHandlerThreads">25</attribute> <attribute name="backlog">500</attribute> <attribute name="deactivated">false</attribute> <attribute name="interface">*</attribute> <attribute name="maxHandlerThreads">1000</attribute> <attribute name="minHandlerThreads">1</attribute> <attribute name="port">51020</attribute> <attribute name="threadWaitTimeout">300</attribute> <attribute name="timeout">300</attribute> <!-- if 0, web server connector loads mappings once at startup --> <!-- if not specified, default is every 10 seonds --> <attribute name="mapcheck">0</attribute> <!-- set this to false for multi-hosted sites --> <attribute name="cacheRealPath">false</attribute> ...</service>

Multi-Server Configuration in jrun.xml

Page 108: Running ColdFusion MX 7 on Linux and Unix

108

Process List

[root@Aneto ~]# ps -ef | grep cfmx7nobody 5902 1 0 11:00 pts/3 00:00:00 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -autorestart -start coldfusionnobody 5904 5902 0 11:00 pts/3 00:00:11 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5905 5904 0 11:00 pts/3 00:00:00 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5906 5905 0 11:00 pts/3 00:00:00 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5907 5905 0 11:00 pts/3 00:01:09 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5908 5905 0 11:00 pts/3 00:00:00 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5909 5905 0 11:00 pts/3 00:00:00 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5910 5905 0 11:00 pts/3 00:00:00 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5911 5905 0 11:00 pts/3 00:00:00 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5912 5905 0 11:00 pts/3 00:00:00 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5913 5905 0 11:00 pts/3 00:00:05 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5914 5905 0 11:00 pts/3 00:00:03 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5915 5905 0 11:00 pts/3 00:00:00 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5916 5905 0 11:00 pts/3 00:00:00 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusionnobody 5917 5905 0 11:00 pts/3 00:00:00 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusion(40+ more when server is just idle ...)

Why are there so many ColdFusion processes on Linux?

# ps -ef | grep cfmx7 nobody 6706 1 0 14:40:16 pts/4 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -autorestart -start coldfusion nobody 6708 6706 0 14:40:16 pts/4 /opt/coldfusionmx7/bin/cfmx7 -jar cfusion.jar -start coldfusion

Linux

Solaris

Linux - A process listing on Linux will show operating system threads that run inside a process.

Solaris – A process listing shows only processes, not threads. Solaris hides lwps and threads.

Page 109: Running ColdFusion MX 7 on Linux and Unix

109

unable to create new native thread

In tests that were done a couple years ago with ColdFusion MX and Red Hat 7.2, it was found that there is an upper limit on the number of Linux operating system threads that can be open by one process, not to be confused with the number of file handle descriptors. When that limit is reached, the "java.lang.OutOfMemoryError: unable to create new native thread" error is thrown.

Given that for the JVM process under ColdFusion/JRun there is at least one operating system thread open for every JVM thread, plus other operating system threads that are not tied to a JVM thread, it is very likely that this error will occur if the activeHandlerThreads and maxHandlerThreads size in jrun.xml are set above 400 or so, perhaps a bit more in current versions of Linux.

For example, if the activeHandlerThreads was set to 500 (Simultaneous Requests)

<service class="jrun.servlet.jrpp.JRunProxyService" name="ProxyService"> <attribute name="activeHandlerThreads">500</attribute>

The 500 value is way out of line with an expected value for this setting. The default is 8 on CFMX server configuration, with the expectation of 2 cpus for a production machine. If you have done careful load testing and found that your application is query intensive, not cpu intensive, then you may have discovered that this value can be increased somewhat. Even so, you probably should not set this more than 50-100 for a 2 cpu machine, less for 1 cpu, even with a query intensive application.

Not only will the "unable to create new native thread" error occur due to the OS thread limit, but the amount of thread management, or context switching, for 500 jrpp threads will be enormous. This means that the OS spends more time trying to manage a long list of OS threads and figuring out which thread gets to run, for how long, and on which cpu, that in the end far less CPU is available for just executing the code in the application.

The recommendation is to significantly decrease the activeHandlerThreads (Simultaneous Requests) to a normal range (3-5 per cpu) unless you have very specific information indicating that a higher value showed better performance.

Solaris showed a similar limit of about 1000-2000 OS threads per process, and Windows showed a limit of about 3000. Current tests may be somewhat different.

java.lang.OutOfMemoryError: unable to create new native thread

Page 110: Running ColdFusion MX 7 on Linux and Unix

110

Integrated Development Environments

Page 111: Running ColdFusion MX 7 on Linux and Unix

111

ColdFusion IDEs Available on Linux

Dreamweaver MX

Supported by Code Weavers (Makers of Professional version of WINE)Certified by MacromediaSilver Certification – most features work, some bugs remainhttp://www.codeweavers.com/

HomeSite+ 5.0

Not supported, use at your own riskMay uns on free version of WINE (Wine Is Not an Emulator)Most features work including RDS & Database tabhttp://www.winehq.org/site/download

Eclipse 3.0 and CFEclipse Plug-in

Free!Eclipse originally developed by IBM, then opensourced. Very stable and fast.CFEclipse Plug-in provides code-hinting, custom toolbar, cfms and cfcshttp://www.eclipse.org/ , http://cfeclipse.tigris.org/

He3Still in beta(?); Commercial productBuilt on top of Eclipse and CFEclipse.From Rich Palette (Matt Liotta and Guy Rish)HTML, Java, CSS, XML, SQL, and RegEx,ColdFusion frameworks FuseBox and Mach-IIhttp://www.richpalette.com/he3Overview.html

Page 112: Running ColdFusion MX 7 on Linux and Unix

112

Dreamweaver MX

Dreamweaver MX is supported at the Silver level by Code Weavers, and certified by Macromedia

Page 113: Running ColdFusion MX 7 on Linux and Unix

113

Homesite+ 5.5

HomeSite is NOT supported on Linux by Code Weavers, but runs on WINE

Page 114: Running ColdFusion MX 7 on Linux and Unix

114

Eclipse with CFEclipse Plug-in

The Eclipse IDE and the CFEclipse plug-in are open source, and free

Page 115: Running ColdFusion MX 7 on Linux and Unix

115

PLATFORM SERVER MARKET SHARE

2004 2008 Unix 39.6% 31.9% -7.7 %Windows 32.2% 38.4% +6.2 %IBM OS/390 10.6% ? (<14.9) - (?)Linux 8.4% 14.9% +6.5 %

CNET News, December 2004http://news.com.com/IDC+Linux+server+sales+to+hit+9.1+billion+in+2008/2100-1010_3-5479681.html

• "Sales of servers using Linux will grow faster than the overall market at least through 2008"

• "Revenue from Linux servers is expected to grow annually at 22.8 percent, compared to 3.8 percent for the overall server market"

• "Linux is used on about half of blade servers today, compared to 20 percent of rack-mounted servers and 11 percent of free-standing servers.“

Server Watch, November 2004http://www.serverwatch.com/news/article.php/3439721

• "The operating system [Unix] that powers the lion's share of servers is losing ground to Windows and Linux. Unix is losing so much ground that IT research firm IDC is predicting Windows will take over as the dominant server operating system by the year 2008."

• "IDC predicts a flat growth rate for Unix servers shipped through 2008."

• “... Unix is going the way of the dinosaur"

• "Linux servers posted their eighth consecutive quarter of double-digit growth..."

"Worldwide Server Customer Revenue, 2004 vs. 2008".

htt

p://w

ww

.verg

enet.net/

~co

nra

d/lin

ux/c

art

oons/

images/

roare

d.jpg

"Worldwide Server Customer Revenue, 2004 vs. 2008, by Operating System“, IDC third-quarter results 11/2004