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:
- Use Manifold to create a project containing the map or other component to be
published. The entire rest of this documentation describes the many
capabilities of Manifold at your disposal for creating cool maps.
- Create the files required for a map server web page using File - Export - Web Page. This step is described in the Map Server Overview topic.
- Create a web site using the map server web page files. The simplest way is to
give users a URL that jumps directly to the created site.
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:
Verify IIS is running on your machine.
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).
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.
Launch Manifold and open the .map that will be used to create the web page.
Open the component that is to be published. Choose File - Export - Web Page.
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.
You can now browse the created map page by entering this URL into the
Internet Explorer Address box: http://localhost/mexico/
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:
- 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.
Within the Default Web Site will be the mexico folder. Right click on the folder and choose Properties.
Push Create to create an application. Set execute permissions for Scripts only and High (Isolated) application protection. Press Apply.
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:
- Styles used in the default.asp and other .asp pages are kept in the default.css cascading style sheet file. Fonts and colors used may be easily changed by
editing the default.css style sheet file.
- Buttons and other images are stored in the images directory. These may be changed or replaced using other images. If the file
names are changed (for example, to use .gif images instead of .png images) then the .asp files that use the buttons must be edited to change the names of the images
as they are used in those files as well.
- The config.txt file specifies the size of the main map image and the location of the .map file used as well as the standard text used for title, subtitle and copyright
lines. We can change the location or name of the .map file to be used by editing the config.txt file.
- We can alter the appearance of the page by editing the .asp pages. The .asp files created by Manifold consists of two types of code: javascript and
ordinary HTML commands. The HTML code also may easily be changed to alter the
layout, to add additional text to the page and so forth. For example, changes in the
table that hosts the copyright text can be made to provide additional lines or
legal notices that may be required. Scripting code should not be changed
except by experts.
- We can utilize the created code within a frame set page that launches default.asp within one of the frames while using other frames for navigation,
explanations, custom title bars or other graphics that provide our web page with a
distinctive look and so on. It may be easier for novice webmasters to use frames to
provide a custom look while leaving the Manifold .asp files unmodified.
- We can write our own .asp pages that use the WebServer object for a fully custom Manifold IMS application.
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:
- Use Windows 2003, 2000 or XP. Windows XP configures IIS by default with more
security than does Windows 2000. Windows Server 2003 has the most default
security.
- Use NTFS file systems.
- Do not allow anyone to work interactively, to read mail or to browse web sites
on the machine that hosts your web site. If you must use the same machine
interactively, make sure that user logins you employ do not have Administrator privileges. If a user with Administrator privileges just
once opens a malevolent email attachment the web server itself could be
infected with a wide variety of "backdoor" viruses or Trojan Horse attacks. Never
read email or browse the web when logged in as Administrator.
- Install the latest Service Pack for Windows. Service packs include many
security patches.
- Very Important: If you create a default_admin.asp page for your IMS site, make sure to change access permissions on it so that ordinary Internet browsers cannot
use it. To do this, in Windows Explorer right click on the default_admin.asp file, choose Properties and choose the Security tab. Remove all entries for allowed user names except Administrator or whatever other login name you wish to allow access to the administration
page. Apply the settings and press OK.
- Install any supplemental security patches published by Microsoft after the
last Windows Service Pack. Microsoft now has tools that can scan your system to
determine if there are security patches published that have not yet been
installed. Visit Microsoft TechNet at http://www.microsoft.com/technet/default.asp and drill down to their Security pages for information on the latest security
tools and patches.
- Install anti-virus software. Keep your anti-virus software updated with
regular downloads from your vendor.
- Install Microsoft URLScan (a free download from Microsoft TechNet) or similar tool. URLScan is an
ISAPI filtering tool for IIS that rejects a wide variety of malformed URL requests
before they can hit IIS. It is very easy to use. It was published by Microsoft
in 2001 and is an absolutely essential tool to prevent many different types of
Denial of Service attacks. No doubt the functions provided by URLScan will
continue to be offered by Microsoft either as independent tools or built into
IIS. Manifold IMS works perfectly with URLScan.
- Apply Microsoft's IIS Lockdown Tool (a free download from Microsoft TechNet) using Advanced Lockdown. Uncheck the box that disables support for Active Server Pages (.asp) and otherwise accept all of the defaults suggested by Advanced Lockdown.
Manifold IMS works perfectly with Advanced Lockdown settings so long as Active
Server Pages are still enabled. This tool is also very easy to use. Some
recent editions of IIS may be shipped by Microsoft in lockdown mode by default.
- Do not run unnecessary services. If your server runs a web site only, do not
install or enable additional services such as FTP, NNTP or others. If such
services are already installed, use Internet Services Manager to stop them. Do not install any accessory software or Windows components that are
not required.
- Learn to use Advanced TCP/IP settings for the Internet Protocol in Network
properties for the network card in use. If your web site is intended only for
specific machines (such as those on an Intranet), use IP security to deny access to any unauthorized machines (IP addresses). If you are
connected to Internet, use TCP/IP filtering to permit only those TCP ports absolutely required to service your web site
(typically, port 80 for HTTP and port 443 for HTTPS). Strict IP filtering will
not allow services such as DNS (used if you are browsing from the web server)
so a truly secure regime will limit utilization of the system to a web serving
only.
- Install a firewall and learn to use it. Use a hardware firewall and/or software solution such
as Microsoft's Internet Security and Acceleration Server. Hardware firewalls
now cost well under $200. Configure your hardware firewall so that only those
ports required for serving web pages are enabled, with all other ports disabled.
- Install the latest updates for Manifold System from manifold.net.
- Get a good book on Windows and IIS security. Read it carefully and apply the
recommendations. Surf the web and read the many free resources on Windows and
IIS security.
- Participate in Manifold-L (email discussion list format) and georeference.org
(BBS format) discussion forums for Manifold System users. Ask questions of
your more experienced colleagues and as you gain expertise yourself give back to
the community by assisting newbies with security questions.
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