Creating a Web Site

This topic assumes the reader is familiar with Microsoft Internet Information Server (IIS) as well as web programming using HTML and Active Server Pages (ASP). Creating web sites with IIS is a straightforward process supported by a vast array of books and other educational resources. If you are not familiar with the operation of IIS, please get a good book on the subject and learn elementary IIS operation and administration before attempting work with Manifold IMS.

Manifold IMS is published for use in Windows Server 2003, Windows XP, Windows 2000 (Server or Professional running IIS) and NT 4.0 using IIS 5.0 or subsequent. Windows Server 2003, XP or 2000 are strongly recommended. Other operating systems may not be supported in the future. This documentation is written using Windows 2000 IIS examples.

There are three steps to using Manifold IMS to publish to the Internet:

Very Important: Before attempting to publish anything using Manifold IMS, please verify correct functionality of your IIS web server. An easy way to do this is to launch Internet Explorer and to load http://localhost/ into the URL address box. This will bring up the default page for your IIS installation or the Windows IIS help if no default page has been created. If you can't browse a page served by IIS on your machine, stop and get IIS operational before proceeding.

A further check to make sure IIS is serving pages from the directories you think it is using. Perform this check by creating a simple index.htm page and make sure your index.htm page as well as other pages in your web site can be correctly browsed from the machine you intend to use as a server. Please resolve any problems with your IIS installation before attempting to use the Manifold map server.

The Export Web Page dialog creates several files: config.txt, default.asp, default.css and one or more accessory .asp files such as default_admin.asp. It also creates an images directory that contains image files in .png format for toolbar buttons and other controls. We use these files created by the dialog in our web site.

To create a web page using the map server:

  1. Verify IIS is running on your machine.

  2. In Windows Explorer, Create a directory within C:\InetPub\wwwroot in which the created files are placed. This example assumes we create a directory called "mexico" to publish an exported web page showing a map of Mexico. The location of the new directory is thus C:\InetPub\wwwroot\mexico. This directory must be created at least with Read permissions (which it has by default when a new folder is created in Windows).

  3. We assume you have already created a Manifold project and have saved it as a .map file. Copy the .map file to the folder in which it will be stored for use by the web site.

  4. Launch Manifold and open the .map that will be used to create the web page.

  5. Open the component that is to be published. Choose File - Export - Web Page.

  6. In the Export Web Page dialog's Folder box, browse over to C:\InetPub\wwwroot\mexico. Specify the other boxes and checkboxes as desired and press OK. This creates the web site files within that directory.

  7. You can now browse the created map page by entering this URL into the Internet Explorer Address box: http://localhost/mexico/

  8. For performance and security reasons it is strongly recommended you create an IIS application for this web page as described below.

Note: once a .map has been used to export a web page, it cannot be moved without altering the .config file used by the web site that specifies the location of the .map that is to be used.

To create an IIS application:

  1. Open the Internet Information Services manager dialog in Windows [normally accessed from the Start button via Start - Programs - Administrative Tools - Internet Services Manager] and expand the Default Web Site.

  2. Within the Default Web Site will be the mexico folder. Right click on the folder and choose Properties.

  3. Push Create to create an application. Set execute permissions for Scripts only and High (Isolated) application protection. Press Apply.

  4. Press OK to exit the Properties dialog.

When a .map file is in use for one application (map server or Manifold) it cannot be used in another application. This is similar to how most Windows applications work. For information on publishing multiple pages using multiple .map files or using one .map file but publishing different components from the .map file, please see the Publishing Multiple Pages topic.

About IIS Applications

An IIS application is any file that is executed within a defined set of directories in a web site. Creating an application designates a particular directory in the web site as the starting point directory (also referred to as the application root). All files and directories under that starting point directory are considered part of that application until another starting point directory is encountered. See the About Applications topic in the IIS documentation.

By placing our Manifold map server files in a particular directory and then designating that directory as an IIS application, we set up IIS so that any processes launched as a result of executing the default.asp file or other files in that directory will be launched as a separate application.

Strictly speaking it is not absolutely necessary to create an IIS application using the directory in which the default.asp file executes. However, this is highly recommended for better performance, reliability and control.

Running the Web Site

Web sites created within Microsoft's Internet Information Server (IIS) can use .asp pages to dynamically create web pages served to browsers. .asp pages provide a sequence of instructions in an ActiveX scripting language that are used to dynamically create web pages on the fly. Based on the contents of the .asp page, IIS will create a stream of HTML content to feed to the requesting browser. Scripting commands embedded in the .asp file can be intermingled with ordinary HTML tags to create exactly the page desired. The default.asp and other .asp pages created by the Export Web Page dialog use javascript for scripting.

The examples above publish the generated web site immediately to the C:\InetPub\wwwroot folder that is the default publication directory for IIS. Browsers will be able to immediately view the web page if given the correct URL. Do not advertise the URL until an application has been created in Internet Information Services manager as noted above and the web site has been tested.

The URL to the new web page follows the usual IIS rules. Suppose we export the web page to C:\InetPub\wwwroot\mexico. Suppose further our web site is associated via DNS with a domain name called manifold.net. Our web site will be viewable at:

http://www.manifold.net/mexico/default.asp

Suppose we have an IIS server running on a Windows machine that is hooked up to the Internet via a cable modem or a DSL link so that it has a fixed IP address. Suppose also we don't have a domain name or DNS but we do have an IP address for the machine such as 192.201.44.168 (even if we have DNS we may not want to hassle with DNS and might prefer to simply used hardwired IP addresses for faster response). In that case we could tell users to browse our web site by referring to:

http://192.201.44.168/mexico/default.asp

Because Microsoft IIS is set up by default to launch a web page called default.asp or index.htm when browsing to a directory, we can also browse our web site using a URL such as

http://www.manifold.net/mexico or

http://192.201.44.168/mexico

The shorter form of the URL (with the default.asp implied) may be more convenient to provide to users.

Windows Server 2003

For enhanced security, Microsoft's Windows Server 2003 product comes with Internet Information Server configured so that .asp pages are not enabled. .asp pages must be turned on within IIS for Manifold IMS to function correctly.

Customization

We can alter the appearance of a Manifold IMS web page by editing the files that create it:

Note: Changes to config.txt or the .asp files will not take effect until the web application is unloaded. To unload the web application, launch a command prompt window and type iisreset to reset IIS. Changes in the .map file will not be acknowledged until the map server is forced to Reload the .map file, either using the Reload method of the MapServer object programmatically or using the Reload button in the administrative default_admin.asp page.

See the IMS Config.txt Options topic for a list of options that may be used when configuring the config.txt file. Some of these options are not created through the Export Web Page dialog but must be manually entered into the config.txt file.

Maintenance

The .map file used by the map server cannot be changed while it is in use for publishing the web page. The simplest way of changing it is to stop IIS, execute an iisreset command in a Windows Command Prompt window, launch Manifold, change the .map file, close Manifold and then restart IIS. The iisreset command unloads the map server as part of resetting IIS so that Manifold can execute in interactive mode.

It is also possible to change the .map file without restarting IIS. To do this, edit a copy of the .map file and save it under a similar name. For example, if we are using myfile.map with the map server we could edit a copy and save it under the name myfile2.map. Next, change the config.txt file to use myfile2.map instead of myfile.map and then in the Microsoft Internet Information Services manager dialog unload the web page application. Do this by right clicking on the application, choosing Properties and then clicking the Unload button (or, by using iisreset from the command prompt).

Note: After unloading a map server application that uses a large .map file the webmaster should browse the site and choose Zoom to Fit with all layers turned on. The first time a large .map file is loaded entirely into RAM the response of the server will be much slower as the entire .map file is loaded. Thereafter, server response will be faster.

Refreshing Linked Drawings and Tables

Standard templates will refresh linked components as specified in the Refresh linked components option when creating the web page. However, for customized web sites .asp programmers may wish to utilize the properties and methods of the Drawing and Table objects.

The IsLinked method returns True if the component is linked and False otherwise. The LastRefreshed property returns the date and time of the last refresh for linked components and current date and time for non-linked components. The Refresh method refreshes linked components and does nothing for non-linked components. In the case of linked components the method returns True if it has succeeded and False otherwise. Refreshing a table bound to a linked drawing refreshes the drawing and vice-versa. Refreshing a linked table will update formatting based on the table's columns. The RefreshAfter method does a Refresh if the component has not been refreshed for more than the given number of seconds.

These properties and methods allow programming a website that can force a refresh of a linked drawing or table when it is required by the logic of other parts of the website.

Server Argument is Optional

When writing custom .asp pages, programmers should note that the Server argument within the WebServer.Create method is optional. Creating a WebServer object without a reference to an ASP Server (or a reference to an ASP-like wrapper for ASP.NET) puts IMS into a reduced functionality mode where it can render pictures, respond to zoom in, zoom out, center and other commands but cannot generate HTML reports. This allows the restricted use of Manifold IMS in ColdFusion and other non-ASP environments that are able to instantiate COM objects but are unable to simulate native ASP objects and are unable to utilize .NET.

Disk Requirements

Manifold IMS creates an image to serve to browsers. Each different view by any browser generates a different image. The image files used are created in the web page's directory as temporary files in .png format. Manifold will cache these images and will delete them after a twenty-minute time out period.

Although the image files served by the map server are small (depending on the size and content usually below 100KB in size), the size of temp files accumulated for a popular site can grow to tens of megabytes. Webmasters should make sure to have adequate free space for temporary files on the disk drives hosting the web pages in use. In an era of large and inexpensive disk drives it is not normally a problem to be sure to have a few tens of megabytes free space available.

Other Windows Versions

The map server has been observed to work using the personal Internet server in Windows 98 and Me; however, these operating systems are not supported for use with the Manifold map server. Performance with 98 or Me (if it works at all) will be greatly reduced as compared to Windows Server 2003, 2000 or XP.

Security Tips

Microsoft IIS is a secure and highly reliable web server when correctly configured by the system administrator. Nonetheless, the many options made available within IIS to support the needs of experts can result in security problems if administered improperly. Because an IIS web server connected to Internet can be attacked by any Internet user from anywhere in the world, a few general IIS security measures should be applied to any web server connected to the Internet. These measures are not specific to Manifold IMS: they should be applied to every web server.

We recommend the following elementary steps:

Very important: Although Manifold IMS can work with Microsoft security tools for IIS such as URLScan and the IIS Lockdown Tool, it is possible that other IIS applications installed on your system cannot work with these tools or require modifications to the default settings of these tools. It is critically important to read the documentation for these security tools.

When establishing security policies it is critically important to keep in mind the need for the IUSR_ Internet browser account to have read permissions for all files involved in the web site, including the .map file used as well as any database files used for linked drawings or linked tables. If a .mdb file is used, the IUSR_ account must also have read and write permissions for the folder in which the .mdb file is located, so that the map server process can create a lock file as is required when working with .mdb.

The idea of giving the IUSR_ account such permissions may worry novice webmasters. However, giving the IUSR_ account read permission and knowledge of the path to the .map file (which may be discovered by examining the config.txt file if a visitor knows enough about Manifold System) does not necessarily give the IUSR_ the ability to download the .map file. For example, the .map file could be located in a folder outside the InetPub hierarchy and so not be accessible for download. Likewise, if the folder containing any database files used is located outside the InetPub hierarchy these files cannot be downloaded either.

For novices, a workable approach until more can be learned about Windows security and IIS security is to create a folder, such as C:\ImsMaps, to place the .map file and any database files used in that folder and to grant IUSR_ read/write/execute permission on the folder and read permission for all files within the folder. Adjust the config.txt file in the actual web site (located somewhere in the InetPub hierarchy) so that the path to the .map file in use correctly notes the location in C:\ImsMaps.

Note that permissions as discussed above are set using Windows Explorer. Right click onto the folder or file, choose Properties and then click on the Security tab.

Troubleshooting

See the troubleshooting topic Problems with the Internet Map Server for detailed checklists of what might be wrong.

The number one problem with IMS reported to tech support is that users neglect to add the IUSR_ account with access permissions to the .map file in use. Using Windows Explorer (do not just depend on the IIS management console or other server management console), right click on the .map file, choose Properties and verify in the Security that the IUSR_ account for the system has necessary read and execute permissions.

About ASP .NET

ASP .NET is a new technology introduced by Microsoft in Windows .NET servers. Microsoft ASP.NET is more than just the next generation of Active Server Pages (ASP). It provides a new programming model for creating network applications.

A key aspect of ASP.NET is that while just about any given task can be implemented in either ASP or ASP.NET, ASP.NET is overall easier to use, much faster, much more robust and much more flexible. Another key thing is that although in earlier editions of Manifold System we could use IMS with ASP.NET by creating a mixed ASP / ASP.NET application with the IMS portion handled by ASP, because IMS is now designed to function directly within ASP .NET environments we now can avoid using ASP at all and have our entire web application written in ASP.NET.

Of course, to use ASP .NET we must be running the Microsoft products that support it.

Dependent DLLs in ASP .NET

ASP .NET allows use of dependent DLLs, which if the system is misconfigured will lead to error messages such as "A dynamic link library(DLL) initialization routine failed."

The most likely reason one or more DLLs are not getting initialized when loaded in an ASP.NET environment is that the system can not locate the dependent DLL modules to which it is linked. To work around this, include the path to the Manifold installation folder into the system PATH variable. That is, go to Control Panel - System - Advanced - Environment Variables and append the path for the Manifold installation folder (typically, C:\Program Files\Manifold System) to the system (not user!) PATH variable. Then restart IIS, or, better yet, reboot the machine. This should get rid of the problem.

ASPNET Permissions in ASP .NET

Web pages operating in an ASP.NET environment may require different permission settings than those operating in an ASP environment. For example, the default login used by ASP.NET is ASPNET, while the default login used by ASP is IUSR_xxx, where xxx is the machine name. The .map file and all other data being accessed from the ASP.NET environment must be readable by the ASPNET user account. Use Windows Explorer to check the security settings for all files involved in your web site to make sure that ASPNET can read them or execute them (in the case of executables such as manifold.exe). See the analogous discussion for the IUSR_ account.

See Also

Map Server Overview

IMS Config.txt Options

IMS Queries

Publishing Multiple Pages

Optimizing Performance

Back to Manifold Home Page