In order to call a FoxWeb script, the Web server must first invoke the FoxWeb CGI or ISAPI modules (foxweb.exe and foxweb.dll respectively). These programs, are installed by the FoxWeb setup program in the directory that you specify during installation of the software.
Virtually all Web servers available today support CGI, while a few, including Microsoft Internet Information Server (IIS) also support ISAPI.
By default most Web servers are installed with at least one directory already set up for CGI/ISAPI operation. These directories are usually set up, so that if the server receives a URL pointing to a program contained there, the server automatically runs that program and passes information about the request to it. When the program is finished executing, it passes information such as HTML content, back to the server for display by the browser. In the case of FoxWeb, the programs being called are either foxweb.exe or foxweb.dll. These two programs do not actually do much, other than transfer information back and forth between the Web server and the FoxWeb channels, which actually run FoxWeb scripts.
There are two ways to call the FoxWeb CGI/ISAPI module:
The preferred way to call FoxWeb scripts is to associate the FWX file extension with the CGI or ISAPI modules. When a properly configured server encounters this extension in the URL it will automatically call the CGI/ISAPI module. This technique is called script mapping and even though it may by somewhat harder to set up, it can make your URLs much shorter and simpler. It can also make it a lot simpler to mix static content, such as HTML pages and images, with your FoxWeb scripts. Here's a sample URL that utilizes script mapping:
Another way is to directly reference it in the URL. This method will work with any server and does not require much configuration. All you need to do is make sure that the CGI and ISAPI modules are installed in a directory that is configured for program execution. Following are examples of requesting the FoxWeb program contact.fwx, by directly calling the two modules:
- or -
The rest of this page provides pointers on how to set up your Web server. Obviously we cannot be experts on all servers available today and we may be unable to help you with your particular server. Your Web server's documentation will probably be your best resource.
In order for the FoxWeb setup program to be able to automatically configure IIS for FoxWeb, you must ensure that a number of required IIS features are installed properly, before running the FoxWeb setup program. If you happen to install FoxWeb before enabling these features, you will need to uninstall/reinstall FoxWeb, or run the setup program and select the Repair option.
In Windows 7 (and other recent desktop versions of Windows) the required features must be enabled in the "Turn Windows features on or off" dialog. To access this dialog click on the link with the same name in the left pane of the Programs and Features dialog, or simply open the Start menu and type "Turn Windows features on or off".
In Windows 2008 Server (and other recent Server versions of Windows) the required features are "Role Services" of the "Web Server (IIS)" role. They can be enabled in Server Manager (open the Start menu and type "Server Manager"). First install the "Web Server (IIS) role" and then enable the role services listed below.
The following features (or role services) are required:
The above role services are required to run FoxWeb with script-mapped URLs (recommended). If you are trying to install a legacy FoxWeb application with internal links directly referencing foxweb.dll or foxweb.exe, then you also need to enable ISAPI and/or CGI in the Handler Mappings section of the Internet Information Services configuration.
The user account that FoxWeb is running under must have certain permissions for proper operation. If running FoxWeb as a service, this account is configured in the Windows "Services" setup. Locate the FoxWeb service and set a Log On account.
The FoxWeb user account must have Full Control rights in the hkey_local_machine\software\Aegis Group (hkey_local_machine\software\Wow6432Node\Aegis Group for 64-bit versions of Windows).
In addition, the account must have modify permissions (Modify, Read & Execute, List folder contents, Read, Write) in the following locations:
64-Bit Versions of Windows
In addition to the steps outlined above, 64-bit versions of Windows require additional configuration. The FoxWeb ISAPI dll is a 32-bit unmanaged module. By default IIS is not configured to run 32-bit modules. This can be changed in the Application Pool settings. To enable support for 32-bit modules:
The FoxWeb setup program attempts to configure IIS for proper FoxWeb operation, but there are a few rare cases where this step fails. Also, it is possible that you will want to configure your server in a different manner. For this reason, we are providing detailed instructions on how to configure IIS to work with FoxWeb.
If you want to call FoxWeb scripts by calling foxweb.dll, or foxweb.exe directly, you will need to configure a CGI/ISAPI directory, pointing to the location where you installed these files (or you can install FoxWeb, so that the files are copied to an existing CGI/ISAPI directory). By default IIS creates a virtual directory, called Scripts, which points to
If you want to call FoxWeb scripts by including the .fwx extension you URLs, then you will need to configure script mapping for the .fwx extension. The FoxWeb setup program attempts to create a script map that associates fwx files with the ISAPI module, but in some cases it may fail. In order to manually configure IIS for script mapping you will need to use the Internet Services Manager. Select your server (not a particular Web site, but the whole server right below Internet Information Services), right click on it, and bring up its property page. Under Master Properties select WWW Service and select Edit. In the Home Directory page select Configuration. In the App Mappings page look for the .fwx extension. If it does not exist click on the Add button, otherwise select it and click on the Edit button. Make sure that the Executable box points to foxweb.dll (or foxweb.exe) in your Scripts directory. Next you will need to select the HTTP methods that will be used in this mapping. In IIS 4 this box is titled Exclusions and requires that you list all the verbs you want to exclude. If you are running IIS 4 enter "PUT,DELETE". IIS 5 and above requires that you enter the verbs you want to allow in the Verbs box. In this case enter "GET,HEAD,POST". Enable the "Script Engine" option. You should only enable the "Check that File Exists" option if you have enabled the Use Web Server's Directory Mappings FoxWeb setting, and you want to use the Web server's native security mechanism. Note that in this case you will not be able to call PRG files with the .fwx script mapping -- you will need to create another script mapping for the .prg extension.
Enabling Script Access for Script Mapping
You will also need to enable Script access in all the directories where your Web server "thinks" your FoxWeb scripts reside. We say "thinks", because if you have not enabled the Use Web Server's Directory Mappings FoxWeb setting, FoxWeb scripts will not reside in the Web tree, but your server has no way of knowing this. For the purposes of the following example assume that your Web root is
Enabling FoxWeb to run on Windows 2003
IIS 6 on Windows 2003 has some additional security features that make it much more secure than previous incarnations. As a result, in addition to the configuration steps outlined above, you will need to add an entry for FoxWeb in the Web Service Extension list in order to run FoxWeb scripts. Once you create the FoxWeb entry, you will need to associate it with FoxWeb's CGI and ISAPI modules. The following image illustrates how to do this:
The Apache Web server is highly configurable and there are several ways to configure FoxWeb to work with it. Apache is configured by editing the file httpd.conf.
Apache is installed with a default CGI directory with the alias "cgi-bin". Httpd.conf directives such as the following are responsible for this behavior:
Allow from all
For details on the meaning of each directive refer to the Apache documentation. If you wish you can create other CGI directories by using the above lines as templates.
Script mapping can be achieved by adding the following two lines in the httpd.conf file:
Action foxweb-script /cgi-bin/FoxWeb.exe
Enabling Script Access for Script Mapping
Apache requires that the directories specified in a script mapped URL exist under the Web root. To do so you have two options:
Each server has different method of configuring a directory for CGI access. Most modern servers provide a graphical user interface for this purpose, but there are still some servers, which must be configured by manually editing configuration files. For information on how to set up a CGI directory on your particular server, please refer to your server's documentation.
Most Web servers require that the script-mapped document being requested be present in the web tree before they pass the information to the CGI program. For this reason, it may be necessary that you enable the Use Web Server's Directory Mappings option. Note that enabling this option requires that you take extra steps to secure your server. For information on how to set up configure script mapping on your particular server, please refer to its documentation.