Using the command-line interface

You can also run the Web Server Configuration Tool through a command-line interface.

Run the command-line interface

  1. Open a console window.

  2. Change to the cf_root/cfusion/runtime/bin (server configuration) directory.

  3. Execute the wsconfig.exe (Windows) or wsconfig (UNIX) command:

          wsconfig.exe [-options] 
          ./wsconfig [-options]

The following table describes the options:

Option

Description

-ws

Specifies the web server, as follows:

  • IIS

  • Apache

  • SunOne

  • iPlanet

  • NES

The web server name you supply is not case sensitive.

-dir

Specifies the path to the configuration directory (Apache conf or NES/iPlanet config).

-site

Specifies the IIS website name (case-sensitive). Specify All or 0 to configure the connector at a global level, which applies to all IIS websites.

-host

Specifies the ColdFusion server address. The default value is localhost.

-server

Specifies the ColdFusion server name.

-norestart

Specifies not to restart the web server.

-cluster

Specifies the Tomcat cluster name. Use this option to define a connection to a Tomcat cluster instead of a single server.

-l

Enables verbose logging for the connector.

-upgrade

Upgrades existing configured connectors with newer modules from a newer wsconfig.jar file.

-service

Specifies the Apache Windows service name. The default value is Apache.

-bin

Specifies the path to the Apache server binary file (apache.exe in Windows, httpd on UNIX).

-script

Specifies the path to the Apache UNIX control script file (apachectl, but slightly different with certain Apache variants, such as Stronghold).

-v

Enables verbose output from the Web Server Configuration Tool.

-list

Lists all configured web servers.

-list -host server-host

Lists all Tomcat servers on the specified host.

-remove

Removes a configuration. Requires the ‑ws and either the ‑dir or ‑site options.

-uninstall

Removes all configured connectors.

-h

Lists all parameters.

Using the batch files and shell scripts

The ColdFusion server configuration includes batch files and shell scripts that implement typical command-line connector configurations. These files are in the cf_root/bin/connectors directory. For example, the IIS_connector.bat file configures all sites in IIS to site 0, which establishes a globally defined connector so that all sites inherit the filter and mappings.

If you use Apache or Sun ONE Web Server, use these files as prototypes, editing, and saving them as appropriate for your site.

command-line interface examples

Examples of multiple use-cases for different web servers:

  1. Configure a specific IIS site:

    cf_root/runtime/bin/wsconfig.exe -server coldfusion -ws iis -site "web31" -coldfusion -v

    On systems where all sites run ColdFusion, there is generally no need to configure an individual site.

  2. Configure all existing IIS sites (ISPs):

    cf_root/runtime/bin/wsconfig.exe -server coldfusion -ws iis -site 0 -coldfusion ‑cfwebroot C:\Inetpub\wwwroot -v

    The ‑cfwebroot option allows all sites to share the ColdFusion Administrator that runs under C:\Inetpub\wwwroot. This example does not automatically configure newly added sites after the first -site 0 run, but you can rerun with -site 0 at a later time, and the Web Server Configuration Tool configures new sites only.

  3. Configure Apache on UNIX #1:

    cf_root/runtime/bin/wsconfig -server coldfusion -ws Apache -bin /opt/apache2/bin/httpd -script /opt/apache2/bin/apachectl -dir /opt/apache2/conf -coldfusion -v
  4. Configure Apache on UNIX #2:

    cf_root/runtime/bin/wsconfig -server coldfusion -ws Apache-bin /usr/bin/httpd -script /usr/bin/httpd -dir /etc/httpd/conf -coldfusion -v
  5. Configure Apache in Windows:

    cf_root/runtime/bin/wsconfig.exe -server coldfusion -ws apache -dir "c:\program files\apache group\apache2\conf" -coldfusion -v
  6. Configure Netscape on UNIX:

    cf_root/runtime/bin/wsconfig -server coldfusion -ws nes -dir [path to config] -coldfusion -v
  7. Configure Sun ONE Web Server on UNIX:

    cf_root/runtime/bin/wsconfig -server coldfusion -ws sunone -dir [path to config] -coldfusion -v