Mercurial HG en Windows Server

mercurial windows

Si utilizar Mercurial para versionar tu código, y querés tener tu servidor en Windows, seguí este paso a paso:

Pre-requisitos:

PASO 1 – Instalar Web Platform Installer

  1. Ingresar en http://www.microsoft.com/web/downloads/platform.aspx y hacer click en “”Free Download”
    image
  2. Abrir WPI, buscar “Python”, e instalar la versión 2.6
  3. Alternativamente, utilizar el sitio oficial para descargar la versión 2.6 desde http://www.python.org/download/releases/2.6/

PASO 2 – Configurar Windows Server

  1. Abrir el “Server Manager”
    image
  2. Hacer click en “Add roles and features”.
    image
  3. Luego en el botón “Next –>”
    image
  4. Seleccionar “Role-based or featured-based installation”, y hacer click en el botón “Next –>”
    image
  5. Elegir el equipo al que se aplicara el rol, y luego el botón “Next –>”
    image
  6. Seleccionar “Web Server (IIS)”, y luego el botón “Next –>”
    image
  7. Avanzar hacia “Roles Services”, clickeando en “Next –>” con las opciones que vienen por defecto.
    image
  8. Seleccionar las siguientes opciones dentro de “Roles services”
    1. Common HTTP Features
      1. HTTP Redirection
    2. Health and Diagnostics
      1. Loggin tools
    3. Performance
      1. Dynamic Content Compression
    4. Security
      1. Basic Authentication
      2. IP and Domain Restrictions
      3. URL Authorization
    5. Application Development
      1. CGI
    6. Management Tools
      1. IIS Management Scripts and Toolimage
  9. Confirmamos e instalamos.
    image

PASO 3 – Instalar Mercurial

  1. Ingresar en https://bitbucket.org/tortoisehg/thg-winbuild/downloads y descargar el instalador de la versión deseada que termine en “win-amd64-py2.6.exe” (Mercurial with Python) por ejemplo: “mercurial-2.2.2.win-amd64-py2.6.exe
  2. Instalar Mercurial
    image

PASO 4 – Mercurial como Web Application

  1. Verificar que IIS funcione correctamente, abriendo un navegador y accediendo a http://localhost
    image
  2. Crear una nueva carpeta en c:/inetpub/wwwroot
    image
  3. Ingresar en IIS Manager, y convertir la carpeta recien creada en una Application
    image
  4. Hacemos click en la nueva aplicación (hg), y luego en “Handler Mappings”
    image
  5. Agregar un “Script Map” con la siguiente info:
    1. Request path: *.cgi
    2. Executable: C:\Python26\python.exe -u “%s”
    3. Name: Python
      imageimage

PASO 5 – Probar Python

  1. Crear un archivo “test.cgi” dentro de la carpeta “hg” que creamos como aplicacion en IIS, con el siguiente contenido:

    print ‘Status: 200 OK’
    print ‘Content-Type: text/html’
    print
    print ‘<html><body><h1>It Works!</h1></body></html>’

    image

  2. Ingresar al archivo desde http://localhost/hg/test.cgi
    image
  3. Borrar el archivo, solo sirve para probar que funcione Python.

PASO 6 – Configuraciones finales

    1. Instalar desde Web Platform Installer “URL Rewrite 2.0”
    2. Abrir una consola (Windows + R, CMD, Enter) y ejecutar los siguientes comandos:
%windir%\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/security/authentication/anonymousAuthentication
%windir%\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/security/authentication/basicAuthentication
[Facebook] [Google] [LinkedIn] [Twitter] [Windows Live] [Email]
Tagged with: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*