11.5. ASP File Locations

As a security precaution, ASP files can only be loaded from specific base URL locations. You can add more URL paths as necessary. By default, ASP pages can only be loaded from the following URL locations:

/
/PointList

These are URL paths, not file system paths. URL paths are determined relative to the document root path. In the DataHub program, there are in fact two document roots, the Web Server root and the user content root. The Web Server root contains files that are typically common to all DataHub instances, and the user content root contains user-generated content for a particular DataHub instance. If an identically named document exists in both roots, the document in the user content root will take precedence.

Web Server Document Root

The Web Server document root is defined in the DataHub Web Server properties dialog. This is normally the html folder within the DataHub installation folder. The files in this folder are not intended to be modified by the user. If you re-install the DataHub program, it will overwrite files in this folder.

The default Web Server root for 32-bit DataHub installations is:

C:\Program Files (x86)\Cogent\Cogent DataHub\plugin\WebServer\html\

The default Web Server root for 64-bit DataHub program installations is:

C:\Program Files\Cogent\Cogent DataHub\plugin\WebServer\html\

This default path can be reconfigured in the Properties window Web Server option, if desired.

The ASP file locations are folders named after one of the URL paths, appended to the document root. For example, in the 64-bit DataHub program, the installed ASP files are located relative to the Web Server document root:

C:\Program Files\Cogent\Cogent DataHub\plugin\WebServer\html\
C:\Program Files\Cogent\Cogent DataHub\plugin\WebServer\html\PointList

User Content Document Root

There is a second document root for user-created content. This root is the WebContent folder, located in the DataHub configuration folder, here by default:

C:\Users\UserName\AppData\Roaming\Cogent DataHub\WebContent\

User-created ASP files must go into one of the folders named after a URL path, appended to this root:

C:\Users\UserName\AppData\Roaming\Cogent DataHub\WebContent\
C:\Users\UserName\AppData\Roaming\Cogent DataHub\WebContent\PointList

You can change the default DataHub configuration folder using the -H command-line option, or by setting it through the DataHub Service Manager application. If you make that change, you must also move all user-created ASP files to correctly-named folders in the new configuration folder.

Adding ASP folders

You can add ASP folders by adding URL paths to the three in the list above. This is done by hand-editing the plugin_AspHandler.cfg file in your DataHub configuration folder. Just copy any UrlRule line and modify the BasePath to the path that you want to serve ASP pages from.

If you do not find the plugin_AspHandler.cfg file, you can create one, using this content as the starting point:

<?xml version="1.0" encoding="utf-8"?>
<AspHandlerSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <UrlRule BasePath="/" IncludeSubdirs="false" 
     ByOrganization="false" RuleResult="Allow" />
    <UrlRule BasePath="/PointList" IncludeSubdirs="false" 
     ByOrganization="false" RuleResult="Allow" />
</AspHandlerSettings>

When you add a new UrlRule to this file, it will allow ASP pages to be loaded from an identically named folder in either of the two roots: the Web Server document root, or the user content document root.