segunda-feira, 6 de fevereiro de 2017

Configurar IIS para Mapguide Open Source

Instalar MapGuide 2.4 on IIS

Instruções passo a passo para instalar MapGuide 2.4 no IIS.

Estas instruções devem também trabalhar com MapGuide 2.5 / 2.6. Renomeie ocorrências de "2.4" e "24", com o correspondente MapGuide versão.

Prerequisite: Microsoft .NET Framework 4

If Microsoft .NET Framework 4 or 4.5 is not installed, install ​Microsoft .NET Framework 4 (Web Installer).

Pré-requisitos: IIS

Windows Server 2008

  1. Open Start -> Server Manager -> Roles
  2. Roles Summary -> If "Web Server (IIS)" is not installed, Add Role
  3. Web Server (IIS) -> Add Role Services
  4. Install
    • Web Server (IIS) -> Application Development Features -> ASP.NET, which also installs .NET Extensibility, ISAPI Extensions and ISAPI Filters
    • Web Server (IIS) -> Application Development Features -> CGI, which also enables FastCGI in IIS7 and above
      clip_image001[7]

Windows 7 e 10

  1. Open Start -> Control Panel -> Programs -> Programs and Features -> Turn Windows features on or off
  2. Install
    • Internet Information Services, which also installs several default features
    • Internet Information Services -> World Wide Web Services -> Application Development Features -> ASP.NET, which also installs .NET Extensibility, ISAPI Extensions and ISAPI Filters
    • Internet Information Services -> World Wide Web Services -> Application Development Features -> CGI, which also enables FastCGI in IIS7 and above
      clip_image002[6]

Manual configuration: IIS

If MapGuide has been installed with a manual configuration, IIS will need to be manually configured.

  1. For Windows 7, open Start -> Control Panel -> System and Security -> Administrative Tools -> Internet Information Services (IIS) Manager
  2. Open [root]\Application Pools -> Actions -> Add Application Pool...
    • Name: MapGuide24AppPool
    • .NET Framework version: .NET Framework v4.0.30319
    • Managed pipeline mode: Integrated
  3. Tb podemos ter em alternativa para Mapguide 2.0
    • .NET Framework version: .NET Framework v2.0.50727
    • Managed pipeline mode: classic
    • Start application pool immediately: True
      clip_image003[6] clip_image005[6]
  1. IMPORTANTE……MUITO IMPORTANTE

Se não abrigarmos a corrermos o aplicativo em 32bits poderemos ter erros como no caso do fgci

clip_image007[6]

Mais à frente vamos configurar no passo 6 vamos configurar o módulo ISAPI para correr mapagent\isapi_MapAgent.dll

Ao criarmos este módulo ele adiciona ao webconfig a primitiva preCondition="bitness32". Ou seja, o IIS só corre o módulo ISAPi caso corra em 32 bits.

Como está a correr a 64 bits ele ignora a configuração e tenta correr a aplicação como se de um ficheiro estático se tratasse.

Para ultrapassar isso devemos forçar a aplicação criada MapGuide24AppPool, a correr a 32bits.

clip_image009[6]clip_image011[6]

  1. Open [root] -> FastCGI Settings (If there is no FastCGI Settings (ie. Windows Server 2008), install ​IIS 7.0 Administration Pack) -> Actions -> Add Application...
    • Full Path: C:\Program Files\OSGeo\MapGuide\Web\Php\php-cgi.exe
    • FastCGI Properties:
      • Max Instances: 0
      • Activity Timeout: 70

clip_image012[6]

  1. Open [root] -> ISAPI and CGI Restrictions -> Actions -> Add...
    • ISAPI or CGI path: C:\Program Files\OSGeo\MapGuide\Web\www\mapagent\isapi_MapAgent.dll
    • Description: MapGuide 2.4 MapAgent? ISAPI handle
    • Allow extension path to execute: True
      clip_image013[6]
  2. Open [root] -> MIME Types -> Actions -> Add...
    • File name extension: .json
    • MIME type: application/json
      clip_image014[6]
  3. Open [root]\Sites\Default Web Site -> Actions -> View Applications -> Actions -> Add Application...
    • Alias: mapguide
    • Application pool: MapGuide24AppPool (or MapGuide25AppPool)
    • Physical path: C:\Program Files\OSGeo\MapGuide\Web\www
      clip_image015[6]
  4. Open [root]\Sites\Default Web Site\mapguide -> Error Pages -> Select "401" -> Actions -> Remove
    • Are you sure that you want to remove the selected custom error page? Yes
  5. Open [root]\Sites\Default Web Site\mapguide -> Handler Mappings -> Actions -> Add Module Mapping...
    • Request path: *.php
    • Module: FastCgiModule?
    • Executable (optional): C:\Program Files\OSGeo\MapGuide\Web\Php\php-cgi.exe
    • Name: MapGuide_2.4_PHP_via_FastCGI
      clip_image016[6]
    • Do you want to create a FastCGI application for this executable? Yes
  6. Right-click [root]\Sites\Default Web Site\mapguide\mapagent -> Convert to Application
    • Alias: mapagent
    • Application pool: MapGuide24AppPool
    • Physical path: C:\Program Files\OSGeo\MapGuide\Web\www\mapagent
      clip_image017[6]
  7. Open [root]\Sites\Default Web Site\mapguide\mapagent -> Handler Mappings -> Select "CGI-exe" -> Actions -> Edit Feature Permissions...
    • Read: True
    • Write: True
    • Execute: True
      clip_image018[6]
  8. Open [root]\Sites\Default Web Site\mapguide\mapagent -> Handler Mappings -> Actions -> Add Script Map...
    • Request path: mapagent.fcgi
    • Executable: C:\Program Files\OSGeo\MapGuide\Web\www\mapagent\isapi_MapAgent.dll
    • Name: MapGuide 2.4 MapAgent? ISAPI handler
      clip_image019[6]
    • Open Request Restrictions...
      • Mappings -> Invoke handler only if request is mapped to: False
        clip_image020[6]
    • Do you want to allow this ISAPI extension? Yes
  9. Right-click [root]\Sites\Default Web Site\mapguide\mapviewernet -> Convert to Application
    • Alias: mapviewernet
    • Application pool: MapGuide24AppPool (or MapGuide25AppPool)
    • Physical path: C:\Program Files\OSGeo\MapGuide\Web\www\mapviewernet
      clip_image021[6]
  10. For .NET API: Right-click [root]\Sites\Default Web Site\mapguide -> Add Application...
    • Alias: mapviewerajax
    • Application pool: MapGuide24AppPool
    • Physical path: C:\Program Files\OSGeo\MapGuide\Web\www\mapviewernet
      clip_image022[6]
  11. For .NET API: Open [root]\Sites\Default Web Site\mapguide\mapviewerajax -> Default Document -> Add...
    • Name: ajaxviewer.aspx

Test

  1. http://192.168.1.14/mapguide/mapagent/mapagent.fcgi
  1. Open http:
    localhost\mapguide\mapagent\index.html -> Other -> Create Session -> Submit
    • Username: Administrator
    • Password: admin

0 comentários :

Enviar um comentário