RAD Studio |  |

Deploying On Apache Servers
Enabling modules | CGI applications | See Also
Collapse All

WebBroker supports Apache version 1.3.9 and later for DLLs and CGI applications.

Modules and applications are enabled and configured by modifying Apache's httpd.conf file (normally located in your Apache installation's \conf directory).

Enabling modules

Your DLLs should be physically located in the Apache Modules subdirectory.

Two modifications to httpd.conf are required to enable a module.

The first modification is to add a LoadModule entry to let Apache locate and load your DLL. For example:

Copy Code

    LoadModule MyApache_module modules/Project1.dll

Replace MyApache_module with the exported module name from your DLL. To find the module name, in your project source, look for the exports line. For example:

Copy Code

    exports
      apache_module name 'MyApache_module';

The second modification is to add a resource locator entry (may be added anywhere in httpd.conf after the LoadModule entry). For example:

Copy Code

    # Sample location specification for a project named project1.
    <Location /project1>
    SetHandler project1-handler
    </Location>

This allows all requests to http://www.somedomain.com/project1 to be passed on to the Apache module.

The SetHandler directive specifies the Web server application that handles the request. The SetHandler argument should be set to the value of the ContentType global variable.

CGI applications

When creating CGI applications, the physical directory (specified in the Directory directive of the httpd.conf file) must have the ExecCGI option and the SetHandler clause set to allow execution of programs so the CGI script can be executed. To ensure that permissions are set up properly, use the Alias directive with both Options ExecCGI and SetHandler enabled.

Note: An alternative approach is to use the ScriptAlias directive (without Options ExecCGI), but using this approach can prevent your CGI application from reading any files in the ScriptAlias directory.
The following httpd.conf line is an example of using the Alias directive to create a virtual directory on your server and mark the exact location of your CGI script:
Copy Code

    Alias/MyWeb/"c:/httpd/docs/MyWeb/"

This would allow requests such as /MyWeb/mycgi.exe to be satisfied by running the script c:\httpd\docs\MyWeb\mycgi.exe.

You can also set Options to All or to ExecCGI using the Directory directive in httpd.conf. The Options directive controls which server features are available in a particular directory.

Directory directives are used to enclose a set of directives that apply to the named directory and its subdirectories. An example of the Directory directive is shown below:

Copy Code

    <Directory "c:/httpd/docs/MyWeb">
    AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
    AddHandler cgi-script exe cgi
    </Directory>

In this example, Options is set to ExecCGI permitting execution of CGI scripts in the directory MyWeb. The AddHandler clause lets Apache know that files with extensions such as exe and cgi are CGI scripts (executables).

Note: Apache executes locally on the server within the account specified in the User directive in the httpd.conf file. Make sure that the user has the appropriate rights to access the resources needed by the application.
See the Apache LICENSE file, included with your Apache distribution, for additional deployment information. For additional Apache configuration information, see http://www.apache.org.
See Also

Deploying General Applications

Deploying Database Applications

Programming for Varying Host Environments

Software License Requirements

Deploying Packages

Creating Internet Server Applications

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!