The Server Files

The Communication Server has a unique file structure that may be overwhelming at first sight. As you will learn, it is a solid and secure structure that enables the server to scale to your needs easily and securely.

Two main folder structures will be examined:

  • The flashcom applications folder

  • The server configuration folder

For this discussion, assume that [wwwroot] is the root of a Windows IIS web server running on Windows 2000 Server or Windows 2000 Professional.

Flash Communication Server MX is structured into adaptors, virtual hosts, and applications. Adaptors contain virtual hosts, which contain your Communication applications.

Greater detail on this structure will be presented in Chapter 14, "Server Administration." Being aware of this structure before you dive in will help you grasp what's going on. For now, assume that your server has one adaptor and one virtual host (the default virtual host). Multiple applications will be created inside the default virtual host.

The Flashcom Applications Folder

This folder contains the server-side components of your Communication applications (see Figure 2.1). If you opted for the developer install, this structure is located in your web server's default root folder (default: c:\inetpub\wwwroot\).

Figure 2.1. The default applications folder as seen inside Macromedia Dreamweaver MX. Each Communication application is declared as a folder under the applications folder.

graphics/02fig01.gif

The flashcom\applications folder stores the server-side resources used by your Communication application. Applications are defined on the server by the existence of this folder. The folder creates a server space for the resources your application will use. If this folder does not exist, your Communication application will not work.

Inside this folder a series of server-side files can exist:

  • ASC files. Contains server-side ActionScript (SSAS). Server-side ActionScript is exactly like Flash ActionScript and is also based on the ECMAScript-262 specification derived from JavaScript. All server-side ActionScript stems from one of two files: main.asc or a file with the same name as the application (myApplication.asc). Use SSAS to script in protected security or business logic for your application. SSAS has ultimate control over all resources used by an application and can reference external resources such as Application Servers using Flash Remoting MX for database access. You will be introduced to ASC files in Chapter 6, "STEP 6: ActionScript with NetConnection()," with full details in Chapter 11, "Server-Side ActionScript (SSAS)."

  • FLV and IDX files. Pre-recorded streams that include video, audio, or still images stored in the FLV format. FLV files are created from standard digital video formats (such as Apple QuickTime or Microsoft AVI) using Sorenson Squeeze. The Communication Server also creates them dynamically if your application is set to record video or images. FLV files are the source files used to stream pre-recorded media to the Flash clients. The index file (IDX) is used by the Communication Server to log and manage the FLV file. These files will be explored in detail in Chapter 7, "STEP 7: Streaming Video with NetStream()."

  • FSO files. Persistent SharedObjects used by Communication applications to exchange data across all clients. SharedObjects will be introduced in Chapter 8, "STEP 8: Collaboration with SharedObject()," with more details in Chapters 11 and 12, "Client-Side (Flash) ActionScript."

Note: These are not the only files required by the Communication Server. You will also need HTML, Flash MX (FLA), Flash movie (SWF), and possibly Flash MX Debugging (SWD) files. During the development process, it is recommended that these additional files be stored in the server applications folder. When you move the application to a production server, for security reasons (explained in Chapter 14, "Server Administration"), your front-end files (HTML and SWF) should not exist in this folder, but separately within your web server.

At this point, you may be getting confused over the files. Table 2.1 lists every file that can be used by Flash Communication applications, describes what application the file is accessed by, and how it is created.

Table 2.1. Matrix of files used by Flash Communication applications.

File

Used By

Type

Authoring

Description

.AS

Flash MX

Source

Dreamweaver MX

External Flash ActionScript source file

.ASC

Flash Communication Server

Source

Dreamweaver MX

Server-side ActionScript source file used by the Communication Server

.ASR

ColdFusion MX

Source

Dreamweaver MX

Server-side ActionScript source file used for Flash Remoting MX by ColdFusion MX

.FLA

Flash MX

Source

Flash MX

Flash MX authoring source file

.FLV

Flash Communication Server

Compiled

Flash MX, Communication Server MX, or Sorenson Squeeze

Recorded Flash video

.FSO

Flash Communication Server

Compiled

Flash Communication Server

Persistent SharedObject (on the server)

.HTML

WebServer

Source

Dreamweaver MX

HTML container

.SWF

WebServer

Compiled

Flash MX

Compiled Flash Player 6 movie

The flashcom\admin folder is the home for the Flash Communication Server control panel. There is nothing special about the HTML version of the administrator other than it is a convenient way to access the help and provides easy access to the two primary management tools.

The management tools that shipped with the Flash Communication Server include the Administration Console (admin.swf) and the App Inspector (app_inspector.swf). Being loyal to its technology, Macromedia has built the applications with Flash MX to help you manage and monitor the Communication Server. Being Flash-based, these tools will run anywhere Flash Player 6 can be installed. They do not need to be accessed from the server, but can be run locally outside the HTML console or included in a larger administration application that you may have.

There will be more detail on the these two applications in Chapter 5, "STEP 5: Monitoring and Managing the Server."

Tip

You can have direct access to these two applications from within Flash MX. Place the admin.swf file into the folder: [%FlashMX Install Path%]\FirstRun\WindowSWF\. Rename it to Communication Admin Console.swf.

The app_inspector.swf should already exist in this folder as Communication App Inspector.swf in the same folder; if not, copy the SWF file to the same folder. These applications will be available within Flash MX through the Window menu.


The Server Configuration Folder

This folder is very similar to a web server management console (see Figure 2.2). The configuration structure is located in the server-install folder (default: c:\Program Files\Macromedia\Flash Communication Server MX\conf\).

Figure 2.2. The Server Install folder (from C:\Program Files\) showing one adaptor with two virtual hosts.

graphics/02fig02.gif

This is meant only as a familiarization exercise; detailed explanation of this folder and how to use it is presented in Chapter 14, "Server Administration."

The folders below the conf folder represent server adaptors. Adaptors provide a security context to manage multiple Communication applications. By default, the server is installed with a single adaptor located in the _defaultRoot_folder. You can create additional adaptors by copying the _defaultRoot_ folder and editing the Server.xml file.

Warning

Create backups of the original XML files before you start editing them. These are important parts of the server, and if they become corrupt, you risk not being able to run your server. Editing these files should be done only by those familiar with XML. I also recommend that you review Chapter 14 before editing these files.


Within the adaptor folder (_defaultRoot_) are virtual host folders, which are declared in the Adaptor.xml file. In Figure 2.2, there are two virtual hosts defined in the root adaptor. Each virtual host must contain two configuration files: Application.xml and Vhost.xml. Like the Server.xml file, these files are very sensitive, and you should create backups before editing them.

The Flash Communication Server does not ship with any "console" way of managing this structure. You must edit these XML configuration files and folders "manually" using a text or XML editor. If you use Macromedia Dreamweaver MX, the XML configuration files will be color-coded with automatic code hints and code completion features to help you develop the files.



    Part I: 10 Quick Steps for Getting Started
     
    ASPTreeView.com
     
    Evaluation has ЕБААССЛГ¶expired.
    Info...