Intranet/Hosting Toolkit [table of contents]

v1.15 Feb 24th 2001
CFX_IIS
COMMERCIAL
NT DLL for Cold Fusion 4.0.1 and up
Lewis A. Sellers
http://www.intrafoundation.com/intranethostingtoolkit.html
ihtk@intrafoundation.com

FOREWORD

This is an Allaire Cold Fusion Extension Tag (CFX). It is for use with Allaire Cold Fusion Servers 4.01 (and up) running on Microsoft NT. It was written by Lewis A. Sellers of Intrafoundation Software.

The purpose of CFX_IIS is to allow basic control over IIS ftp and web services ala the IIS Microsoft Management Console.

Please read the version history for current tag status before emailing questions.

C O N T E N T S

Foreword

General
Web
FTP
SMTP
Services

Version History

top

G E N E R A L

ABOUT

<CFX_IIS ACTION="ABOUT">

The tag itself returns a couple variables back no matter what you do (IISDescription, IISVersion and IISError). These are always available unless there is a catastrophic failure of the tag.

Additionally you can use the ABOUT function to return more detailed information on the tag. The fields returned are mostly only of interest for curiosity or in debugging a situation.

Note below that though the tag returns it's SerialNumber, it's not used currently, and hasn't been for a very long time, but probably will be again soon.

For the curious, it also proves the total number of lines of c/c++ that the current build was using. This includes the scant comments in the source code. For instance, this build of the tag has 6370 lines of code.

Description
The general product description.
Version
The version number of the software, ie 2.0.
Quality

The quality field will be one of the following four: "Alpha", "Beta", "Gamma" or "Omega". Quality relates the quality control status of the version of the tag you're currently using.

Alpha code is highly unstable and shouldn't be trusted for anything. Do not use on production machines.

Beta code is close to being finish and it is in a debugging phase. Do not use on production machines.

Gamma code is for use on production machines. As far as the beta testers have determined it works as it should.

When a product goes Omega that generally means it is long used Gamma code that is now no longer being maintained.

SubVersion
The subversion number of the software, ie 4 for "2.0beta4".
SerialNumber
Currently unused.
Lines
The total lines of c/c++ code in the software.
BuildDate
The ODBC DATETIME when the tag was last compiled (built).
Evaluation
Boolean field (0 or 1). 1 indicates the version of the tag you're using is a time-limited evaluation version. 0 is full commercial.
ExpirationDate
The ODBC DATETIME date when the tag will stop working.




top

W E B

Web, aka HTTP or HyperText Transfer Protocol. This is the standard protocol used to browse information on the internet.

The CFX tag CFX_IIS tries to emulate as closely as possible the general naming strategy of the IIS Manager GUI. So... if you're familiar it, then the purpose of the fields of the following functions should be fairly self-evident.


WEBSERVERS

<CFX_IIS ACTION="WEBSERVERS">

FIELDS
Serverstring
Statestring
Descriptionstring
Pathstring
AnonymousUsernamestring
AnonymousPasswordstring
Bindingsstring
SSLBindingsstring
MaxConnectionsnumeric
ConnectionTimeoutnumeric
DefaultLogonDomainstring
AccessReadboolean
AccessWriteboolean
AccessExecuteboolean
AccessScriptboolean
DirectoryBrowsingAllowedboolean
CustomErrors2level list
HTTPHeaders2level list
HTTPRedirectstring
EnableDefaultDocboolean
DefaultDocstring (csv)
EnableDocFooterboolean
DocFooterstring (csv)
ApplicationNamestring
ApplicationProtectionstring
EnableLoggingboolean
ActiveLogFormatstring
NCSA, W3C, ODBC
OPTIONAL
Computerstring
Querystring
REQUIRED
ActionWEBSERVERS
RETURNED VARIABLES
IISComputerstring

Bindings for the web are the same as for FTP. A very simple binding might be:

127.0.0.1:80:Localhost.

A binding is a grouping of an IP address, a port address and a host header seperated by colons. Additional bindings may be made up of multiple sets of these groups seperated by semi-colons. Thus you might see something like:

205.181.25.11:80:www.allaire.com;205.181.25.11:80:www.coldfusion.com.

The field "SSLBindings" is the bindings for an SSL connection, "Bindings" for the normal one.

HTTPErrors is a 2 level CSV similiar to bindings. It defines errors basic error messages such as "404 NOT FOUND" an so forth. It consists of four elements: the error number, the ordering number, the page type, the page url.

The page type can be either Default, FILE or URL. If you do not specify any message for an error, then Default is assumed. For example:

400,*,FILE,D:\WINNT\help\common\400.htm;401,1,FILE,D:\WINNT\help\common\401-1.htm;401,2,FILE,D:\WINNT\help\common\401-2.htm

Logging with "ODBC"
ODBCDataSourcestring
ODBCTablestring
ODBCUserNamestring
ODBCPasswordstring
Logging

EnableLogging is "1" if logging is enabled. Otherwise is "0". The type of the logging is specified with ActiveLogFormat: "NCSA", "ODBC" or "W3C"

When of type ODBC the relevant fields are: "ODBCDataSource", "ODBCTable", "ODBCUserName" and "ODBCPassword".


Logging with "NCSA"
NewLogTimePeriodstring
Hourly, Daily, Weekly, Monthly, Unlimited
MBnumeric
LogFileDirectorystring

When of type NCSA the relevant fields are: "NewLogTimePeriod", "MB" and "LogFileDirectory".


Logging with "W3C"
NewLogTimePeriodstring
Hourly, Daily, Weekly, Monthly, Unlimited
MBnumeric
LogFileDirectorystring
UseLocalTimeboolean

When of type W3C the relevant fields are: "NewLogTimePeriod", "MB", "LogFileDirectory" and "UseLocalTime".



WEBSERVER

<CFX_IIS ACTION="WEBSERVER">

This is exactly the same as the WEBSERVERS function documented above except that it takes a SERVER parameter as input. Thus you can selectively interrogate a single server.





WEBDIRECTORIES

<CFX_IIS ACTION="WEBDIRECTORIES">

FIELDS
Serverstring
DirectoryTypestring
Descriptionstring
AnonymousUsernamestring
AnonymousPasswordstring
AccessReadboolean
AccessWriteboolean
AccessExecuteboolean
AccessScriptboolean
AuthBasicboolean
AuthAnonymousboolean
AuthNTLMboolean
DirectoryBrowsingAllowedboolean
ContentIndexedboolean
Pathstring
DefaultLogonDomainstring
UNCUsernamestring
UNCPasswordstring
CustomErrors2level list
HTTPHeaders2level list
HTTPRedirectstring
EnableDefaultDocboolean
DefaultDocstring (csv)
EnableDocFooterboolean
DocFooterstring (csv)
OPTIONAL
Computerstring
Querystring
REQUIRED
ActionWEBDIRECTORIES
Servernumber
RETURNED VARIABLES
IISComputerstring
IISServerstring

Lists virtual directories assigned to a web server.





ADDWEBSERVER

<CFX_IIS ACTION="ADDWEBSERVER">

OPTIONAL
Computerstring
Serverstring
AnonymousUsernamestring
AnonymousPasswordstring
Bindingsstring
SSLBindingsstring
MaxConnectionsnumeric
ConnectionTimeoutnumeric
DefaultLogonDomainstring
AccessReadboolean
AccessWriteboolean
AccessExecuteboolean
AccessScriptboolean
DirectoryBrowsingAllowedboolean
CustomErrors2level list
HTTPHeaders2level list
HTTPRedirectstring
EnableDefaultDocboolean
DefaultDocstring (csv)
EnableDocFooterboolean
DocFooterstring (csv)
ApplicationNamestring
ApplicationProtectionstring
EnableLoggingboolean
ActiveLogFormatstring
IIS, NCSA, W3C, ODBC
REQUIRED
ActionADDWEBSERVER
Serverstring
Descriptionstring
Pathstring
RETURNED VARIABLES
IISDescriptionstring
IISPathstring
IISComputerstring
IISServerstring

Adds a web server.

By default ADDWEBSERVER automatically assigns the next free server number to an added server. However you can override this with the SERVER parameter and use whatever number you wish.

HTTPRedirect supplies the redirection url for incoming visitors. You can tag on any of the three phrases (seperated by commas) for further effects.

Ie, http://www.intrafoundation.com, EXACT_DESTINATION, CHILD_ONLY, PERMANENT .

HTTPHeaders, as you might guess, allows you to prepend any http headers to a page you wish. Unlike most every other list the headers are not semi-colon seperated. They use a comma. (That is, since semicolons are used in http headers, we have to use colons, which generall are not so as to avoid confusion.) Typical HTTPHeaders might be:

HTTP/1.0 200 OK
Content-type: text/html
Set-Cookie: mycookie=hasfleas; path=/; expires= Sat 28-Jul-2000 04:00:00 GMT
Server: Microsoft-IIS/5.0
Date: Wed, 28 Jul 2000 04:00:00 GMT
Connection: Keep-Alive
Content-Length: 2011
Content-Type: application/zip
Location: www.allaire.com

By default all webservers created do not support ISAPI. This means ASP and CF will not run under them. ApplicationName and ApplicationProtection may be used to enable ISAPI. Calling on any of them sets up the default ISAPI properities.

ApplicationName is generally "Default Application". ApplicationProtection can be either "Low", "Medium" or "High". By default "Medium" is used.

In short, if you want to enable cfm to run in the webserver, use

ApplicationName="Default Application"
ApplicationProtection="Medium"

A binding is a grouping of an IP address, a port address and a host header seperated by colons. See WEBSERVERS.

Multi-homed IPs. These are created by using bindings. For a site use the same IP and ports but different host headers. (You of course also have to set up your DNS (Domain Name Server) to map these as well. This can be done with pure cfm with some DNS servers. One day CFX_Domains might appear to handle this automatically no matter what brand of DNS you use.)

Host headers do not work with SSL. (That is, you can not multi-home HTTPS sites.)

Example: <CFX_IIS ACTION="ADDWEBSERVER" DESCRIPTION="Public Web Server" PATH="c:\wwwroot">


Logging
Logging with "ODBC"
ODBCDataSourcestring
ODBCTablestring
ODBCUserNamestring
ODBCPasswordstring

To turn off all logging use set EnableLogging to "0". Otherwise, to use logging set Enable logging to "1" and the type of logging with ActiveLogFormat. With web ActiveLogFormat may be: "NCSA", "W3C", or "ODBC".

When of type ODBC the relevant fields are: "ODBCDataSource", "ODBCTable", "ODBCUserName" and "ODBCPassword".

Logging with "NCSA"
NewLogTimePeriodstring
Hourly, Daily, Weekly, Monthly, Unlimited
MBnumeric
LogFileDirectorystring

When of type NCSA the relevant fields are: "NewLogTimePeriod", "MB" and "LogFileDirectory".

Logging with "W3C"
NewLogTimePeriodstring
Hourly, Daily, Weekly, Monthly, Unlimited
MBnumeric
LogFileDirectorystring
UseLocalTimeboolean

When of type W3C the relevant fields are: "NewLogTimePeriod", "MB", "LogFileDirectory" and "UseLocalTime".





ADDWEBDIRECTORY

<CFX_IIS ACTION="ADDWEBDIRECTORY">

OPTIONAL
Computerstring
AnonymousUsernamestring
AnonymousPasswordstring
AccessReadboolean
AccessWriteboolean
AccessExecuteboolean
AccessScriptboolean
AuthBasicboolean
AuthAnonymousboolean
AuthNTLMboolean
DirectoryBrowsingAllowedboolean
ContentIndexedboolean
Pathstring
DefaultLogonDomainstring
UNCUsernamestring
UNCPasswordstring
CustomErrors2level list
HTTPHeaders2level list
HTTPRedirectstring
EnableDefaultDocboolean
DefaultDocstring (csv)
EnableDocFooterboolean
DocFooterstring (csv)
REQUIRED
ActionADDWEBDIRECTORY
Serverstring
Directorystring
Pathstring
RETURNED VARIABLES
IISDescriptionstring
IISPathstring
IISComputerstring
IISServerstring

Adds a virtual directory to a web server.

Example: <CFX_IIS ACTION="ADDWEBDIRECTORY" SERVER="1" DIRECTORY="test" PATH="c:\test">





DELETEWEBSERVER

<CFX_IIS ACTION="DELETEWEBSERVER">
OPTIONAL
Computerstring
REQUIRED
ActionDELETEWEBSERVER
Serverstring
RETURNED VARIABLES
IISComputerstring
IISServerstring

Deletes a web server.

Example: <CFX_IIS ACTION="DELETEWEBSERVER" SERVER="1">





DELETEWEBDIRECTORY

<CFX_IIS ACTION="DELETEWEBDIRECTORY">
OPTIONAL
Computerstring
REQUIRED
ActionDELETEWEBDIRECTORY
Serverstring
Directorystring

Deletes a virtual web server directory.

Example: <CFX_IIS ACTION="DELETEWEBDIRECTORY" SERVER="1" DIRECTORY="public">






top

F T P

File Transfer Protocol. FTP. This is the standard protocol uses to transfer files across the internet.


FTPSERVERS

<CFX_IIS ACTION="FTPSERVERS">

FIELDS
Serverstring
Statestring
Descriptionstring
Pathstring
AnonymousUsernamestring
AnonymousPasswordstring
AnonymousPasswordSyncboolean
Bindings2level list
MaxConnectionsnumeric
ConnectionTimeoutnumeric
DefaultLogonDomainstring
AccessReadboolean
AccessWriteboolean
LogAccessboolean
DirectoryBrowsingAllowedboolean
ExitMessagestring
GreetingMessagestring
MaxClientsMessagestring
AnonymousOnlyboolean
AllowAnonymousboolean
EnableLoggingboolean
ActiveLogFormatstring
IIS, W3C, ODBC
OPTIONAL
Computerstring
Querystring
REQUIRED
ActionFTPSERVERS
RETURNED VARIABLES
IISComputerstring

Lists all FTP servers on the local computer, or the computer specified.

Of all the fields, bindings needs the most explaination. However, a very simple binding might be:

127.0.0.1:21:Localhost.

A binding is a grouping of an IP address, a port address and a subdomain seperated by colons. Additional bindings may be made up of multiple sets of these groups seperated by semi-colons. Thus you might see something like:

205.181.25.11:21:ftp.allaire.com;205.181.25.11:21:ftp.coldfusion.com.

The state field return text of: Starting, Started, Stopping, Stopped, Pausing, Paused or Continuing.


Logging with "ODBC"
ODBCDataSourcestring
ODBCTablestring
ODBCUserNamestring
ODBCPasswordstring
Logging

EnableLogging is "1" if logging is enabled. Otherwise is "0". The type of the logging is specified with ActiveLogFormat: "IIS", "ODBC" or "W3C"

When of type ODBC the relevant fields are: "ODBCDataSource", "ODBCTable", "ODBCUserName" and "ODBCPassword".


Logging with "IIS"
NewLogTimePeriodstring
Hourly, Daily, Weekly, Monthly, Unlimited
MBnumeric
LogFileDirectorystring

When of type IIS the relevant fields are: "NewLogTimePeriod", "MB" and "LogFileDirectory".


Logging with "W3C"
NewLogTimePeriodstring
Hourly, Daily, Weekly, Monthly, Unlimited
MBnumeric
LogFileDirectorystring
UseLocalTimeboolean

When of type W3C the relevant fields are: "NewLogTimePeriod", "MB", "LogFileDirectory" and "UseLocalTime".



FTPSERVER

<CFX_IIS ACTION="FTPSERVER">

This is exactly the same as the FTPSERVERS function documented above except that it takes a SERVER parameter as input. Thus you can selectively interrogate a single server.





FTPDIRECTORIES

<CFX_IIS ACTION="FTPDIRECTORIES">

FIELDS
Serverstring
Namestring
Pathstring
AccessReadboolean
AccessWriteboolean
LogAccessboolean
UNCUsernamestring
UNCPasswordstring
OPTIONAL
Computerstring
Querystring
REQUIRED
ActionFTPDIRECTORIES
Servernumber
RETURNED VARIABLES
IISComputerstring
IISServerstring

Lists the directories assigned to a FTP server on the local or specified computer.





ADDFTPSERVER

<CFX_IIS ACTION="ADDFTPSERVER">

OPTIONAL
Computerstring
Serverstring
AnonymousUsernamestring
AnoymousPasswordstring
AnonymousPasswordSyncboolean
Bindings2level list
MaxConnectionsnumeric
ConnectionTimeoutnumeric
DefaultLogonDomainstring
AccessReadboolean
AccessWriteboolean
LogAccessboolean
DirectoryBrowsingAllowedboolean
ExitMessagestring
GreetingMessagestring
MaxClientsMessagestring
AnonymousOnlyboolean
AllowAnonymousboolean
REQUIRED
ActionADDFTPSERVER
Descriptionstring
Pathstring
RETURNED VARIABLES
IISComputerstring
IISServerstring
IISPathstring
IISDescriptionstring

Adds a new FTP server to IIS.

By default ADDFTPSERVER automatically assigns the next free server number to an added server. However you can override this with the SERVER parameter and use whatever number you wish.

Example: <CFX_IIS ACTION="ADDFTPSERVER" DESCRIPTION="Public FTP Server" PATH="c:\public\">


Logging
Logging with "ODBC"
ODBCDataSourcestring
ODBCTablestring
ODBCUserNamestring
ODBCPasswordstring

To turn off all logging use set EnableLogging to "0". Otherwise, to use logging set Enable logging to "1" and the type of logging with ActiveLogFormat. With ftp ActiveLogFormat may be: "IIS", "W3C", or "ODBC".

When of type ODBC the relevant fields are: "ODBCDataSource", "ODBCTable", "ODBCUserName" and "ODBCPassword".

Logging with "IIS"
NewLogTimePeriodstring
Hourly, Daily, Weekly, Monthly, Unlimited
MBnumeric
LogFileDirectorystring

When of type IIS the relevant fields are: "NewLogTimePeriod", "MB" and "LogFileDirectory".

Logging with "W3C"
NewLogTimePeriodstring
Hourly, Daily, Weekly, Monthly, Unlimited
MBnumeric
LogFileDirectorystring
UseLocalTimeboolean

When of type W3C the relevant fields are: "NewLogTimePeriod", "MB", "LogFileDirectory" and "UseLocalTime".





ADDFTPDIRECTORY

<CFX_IIS ACTION="ADDFTPDIRECTORY">

OPTIONAL
Computerstring
AccessReadboolean
AccessWriteboolean
LogAccessboolean
UNCUsernamestring
UNCPasswordstring
REQUIRED
ActionADDFTPDIRECTORY
Servernumber
Directorystring
Pathstring
RETURNED VARIABLES
IISComputerstring
IISServerstring
IISPathstring
IISDirectorystring

Adds a virtual directory to a FTP server.





DELETEFTPSERVER

<CFX_IIS ACTION="DELETEFTPSERVER">

OPTIONAL
Computerstring
REQUIRED
ActionDELETEFTPSERVRE
Serverstring
RETURNED VARIABLES
IISComputerstring
IISServerstring

Deletes an FTP server from IIS.

Example: <CFX_IIS ACTION="DELETEFTPSERVER" SERVER="1">





DELETEFTPDIRECTORY

<CFX_IIS ACTION="DELETEFTPDIRECTORY">

OPTIONAL
Computerstring
REQUIRED
ActionDELETEFTPDIRECTORY
Serverstring
Directorystring
RETURNED VARIABLES
IISComputerstring
IISServerstring
IISDirectorystring

Removes a virtual FTP directory from an IIS FTP server.

Example: <CFX_IIS ACTION="DELETEFTPDIRECTORY" SERVER="1" DIRECTORY="public">






top

S M T P

Simple Mail Transfer Protocol. The backbone of all mail transports on the internet.

SMTPSERVERS

<CFX_IIS ACTION="SMTPSERVERS">
FIELDS
Serverstring
Statestring
Descriptionstring
Bindingsstring
Versionnumeric
MessagesizeLimitnumeric
SessionSizeLimitnumeric
RecipientsPerMessageLimitnumeric
BadMailDirectorystring
NonDeliveryMailTostring
BadMailTostring
RetryIntervalnumeric
DelayNotificationnumeric
ExpirationTimeoutnumeric
HopCountnumeric
MasqueradeDomainstring
FullyQualifiedDomainNamestring
SmartHoststring
EnableReverseDnsLookupboolean
REQUIRED
ActionSMTPSERVERS
RETURNED VARIABLES
IISComputerstring

Lists all SMTP servers.

Bindings for the web are the same as for FTP. A very simple binding might be:

127.0.0.1:25:Localhost.

A binding is a grouping of an IP address, a port address and a subdomain seperated by colons. Additional bindings may be made up of multiple sets of these groups seperated by semi-colons. Thus you might see something like:

205.181.25.11:25:smtp.allaire.com;205.181.25.11:80:smtp2.coldfusion.com.





top

SITE SERVICES

IIS allows you to selectively start or stop virtual sites, be they ftp or web. Through the CFX_IIS START and STOP functions you can access this ability. These functions only work if the site is properly functioning (the path exists, the bindings are valid, etc). Otherwise there will be a services delay of up to several seconds.

If you do not specify a SERVICETYPE of either "Web" or "FTP" it currently defaults to "Web".

START

<CFX_IIS ACTION="START"">
OPTIONAL
Computerstring
REQUIRED
ActionSTART
Servernumber
Servicetypestring
RETURNED VARIABLES
IISServerstring
IISServiceTypestring

Starts a virtual site, ftp or web. Servicetype can be either "FTP" or "Web".

Example: <CFX_IIS ACTION="START" SERVER="1" SERVICETYPE="FTP">





STOP

<CFX_IIS ACTION="STOP">
OPTIONAL
Computerstring
REQUIRED
ActionSTOP
Servernumber
Servicetypestring
RETURNED VARIABLES
IISServerstring
IISServiceTypestring

Stops a virtual site, ftp or web. Servicetype can be either "FTP" or "Web".

Example: <CFX_IIS ACTION="STOP" SERVER="1" SERVICETYPE="FTP">





PAUSE

<CFX_IIS ACTION="PAUSE">
OPTIONAL
Computerstring
REQUIRED
ActionPAUSE
Servernumber
Servicetypestring
RETURNED VARIABLES
IISServerstring
IISServiceTypestring

Pauses a virtual site, ftp or web. Servicetype can be either "FTP" or "Web".

Example: <CFX_IIS ACTION="PAUSE" SERVER="1" SERVICETYPE="FTP">





CONTINUE

<CFX_IIS ACTION="CONTINUE">
OPTIONAL
Computerstring
REQUIRED
ActionCONTINUE
Servernumber
Servicetypestring
RETURNED VARIABLES
IISServerstring
IISServiceTypestring

Continues a paused virtual site, ftp or web. Servicetype can be either "FTP" or "Web".

Example: <CFX_IIS ACTION="CONTINUE" SERVER="1" SERVICETYPE="FTP">






top

VERSION HISTORY





top
f i n i
-{ts '2001-03-02 15:33:02'} /IIS/docs/index.cfm-