How To: Construir un servidor web con IIS7.5 Server Core (II)

Habilitando ASP.NET y PHP en el servidor web

Una vez que tenemos habilitado los servicios de IIS en Windows Server 2008 R2 Server Core (puedes verlo en el post anterior How To: Construir un servidor web con IIS7.5 Server Core (I)), comenzamos a habilitar las tecnologías de desarroll0 y scripting que queremos que soporte nuestro servidor web. Para esta entrega, veremos cómo configurar ASP.NET y PHP.

Antes de comenzar, debemos descargar los paquetes correspondientes a PHP y colocarlos en un directorio en el equipo o máquina virtual donde estamos configurando el servidor.

Configurando ASP.NET

Para habilitar ASP.NET primero debemos configurar algunos componentes asociados como el .NET Framework, filtros y extensiones ISAPI. La ejecución de comandos quedaría de la siguiente forma:

dism /online /enable-feature /featurename:NetFx2-ServerCore
dism /online /enable-feature /featurename:NetFx3-ServerCore
dism /online /enable-feature /featurename:IIS-ISAPIFilter
dism /online /enable-feature /featurename:IIS-ISAPIExtensions
dism /online /enable-feature /featurename:IIS-NetFxExtensibility
dism /online /enable-feature /featurename:IIS-ASPNET

Configurando PHP

Para habilitar PHP debemos validar primero que esté habilitado el component IIS-CGI . Descargamos PHP (al momento de escribir este artículo hice la prueba con la versión 5.2.12) y lo copiamos en el servidor que estamos trabajando, luego ejecutamos 2 comandos donde el primero registra PHP en el ambiente de ejecución de FastCGI y el segundo configura la extension. Navegamos hasta el directorio C:\Windows\System32\inetsrv y ejecutamos lo siguiente:

appcmd set config /section:system.webServer/fastCGI /+[fullPath='C:\php\php-cgi.exe']
appcmd set config /section:system.webServer/handlers /+[name='PHP-FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='C:\php\php-cgi.exe',resourceType='Either']

Podemos probar el funcionamiento de PHP creando un script sencillo y colocandolo en c:\inetpub\wwwroot . Podemos utilizar el siguiente script para el test:

<?php
phpinfo();
?>

Otras entregas relacionadas:

Entrega I: Habilitando los servicios de Internet Information Services (IIS)

Entrega III: Habilitando funciones de cache en el servidor web y para PHP

Saludos,

Share and Enjoy:
  • Print
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • FriendFeed
  • Live
  • Technorati

Tags: , , , , ,

Leave a Reply

Spam Protection by WP-SpamFree