article

Paul Toone avatar image
0 Likes"
Paul Toone posted

Using FlexSim Webserver with Apache or IIS   

flexsimserver.exe has an interface identical to the ISAPI extension webserver.dll, which is in the FlexSim7.x program directory. If Apache or IIS are configured to use webserver.dll, they can also manage instances of FlexSim and interact with FlexSim’s webserver interface. All interaction should be the same except for two major differences: visibility and threading. Apache and IIS are run in the background, so FlexSim instances will not be visible on the server. This makes it harder to debug any problems. Also, Apache and IIS use multiple threads to respond to requests in parallel, so the order of replying to requests could be different. This makes responding to queries to different instances of FlexSim on the same computer faster with the ISAPI extension than with flexsimserver.exe.

Apache and IIS require some additional configuration to work with FlexSim. The steps are outlined as follows:

Apache

  1. Move flexsim webserver configuration.txt to C:/Program Files/Apache Software Foundation/Apache2.2 or equivalent.
  2. Replace any %DOCUMENTS% or %PROGRAMFILESX86% macros in the directories in flexsim webserver configuration.txt with the full path of the directory.
  3. Copy webserver.dll from FlexSim7.x/program, and index.html and the entire flexsimweb folder (not just its contents) from C:/ProgramData/Flexsim/FlexSim7 to C:/Program Files/Apache Software Foundation/Apache2.2/htdocs or to wherever is specified as DocumentRoot in httpd.conf.
  4. Add lines similar to these to the end of httpd.conf:
    <IfModule isapi_module>  AddHandler isapi-handler .dll  <Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs">  Options ExecCGI  </Directory>  </IfModule>

IIS

Windows Server operating systems and 64 bit operating systems may have some additional complications. Here is an example of how to get the ISAPI extension working with IIS from a fresh install of Windows Server 2008.

  • Open the Server Manager.
  • Enable Web Server (IIS) as a new server role.
  • Enable ISAPI extensions in the Windows Features dialog. This dialog can be accessed from the left side of the Uninstall a Program dialog in the control panel. It should look something like this:
  • Make sure that FlexSim is installed in a directory that is accessible by IIS and your models are in a directory that is accessible by IIS (for example, not in C:/Users/...).
  • Copy flexsim webserver configuration.txt from the FlexSim program folder into C:/inetpub.
  • Replace any %DOCUMENTS% or %PROGRAMFILESX86% macros in the directories in flexsim webserver configuration.txt with the full path of the directory.
  • Copy webserver.dll from FlexSim7.x/program into C:/inetpub/wwwroot.
  • Copy index.html and the entire flexsimweb folder (not just its contents) from C:/ProgramData/Flexsim/FlexSim7 to C:/inetpub/wwwroot.
  • Open the IIS manager and open the ISAPI and CGI Restrictions window. Add a new restriction for C:/inetpub/wwwroot/webserver.dll and allow it to execute. This procedure differs for different version of IIS. The dialog box may look like this:
  • Go to the Advanced Settings of the DefaultAppPool, still in the IIS Manager, and click on Advanced Settings.
    • If you are running a 32-bit version of FlexSim, enable 32-bit Applications (otherwise leave this option set to FALSE).
    • Change the Application Pool Identity to ADMINISTRATOR. There will be many permissions issues avoided by doing this.
  • Under Sites/Default Web Site, double click on Handler Mappings.
  • Right click on ISAPI-dll, which is disabled by default, and click Edit Feature Permissions...
  • Allow the ISAPI-dll handler mapping to read, script, and execute. Click OK.
flexsim users manual
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Article

Contributors

paul.t contributed to this article

Navigation

FlexSim 2016.1