Asp.net/Asp.net 2.0 en Apache + Windows

Si es posible correr paginas aspx en nuestro servidor Apache y en windows, y es muy facil.Solo hay que seguir estos pasos:

1)Instalar Apache

2)Install Mod_AspDotNet

3)Agregar las siguientes lineas al final del archivo httpd.conf (por defecto en C:\Archivos de Programa\Apache Group\Apache2\conf\httpd.conf):



#asp.net
LoadModule aspdotnet_module "modules/mod_aspdotnet.so"

AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources
resx soap vb vbproj vsdisco webinfo

<IfModule mod_aspdotnet.cpp>
# Mount the ASP.NET /asp application
AspNetMount /ApacheASP "c:/ApacheASP"
#/ApacheASP is the alias name for asp.net to execute
#"c:/ApacheASP" is the actual execution of files/folders in that location

# Map all requests for /asp to the application files
Alias /ApacheASP "c:/ApacheASP"
#maps /ApacheASP request to "c:/ApacheASP"
#now to get to the /ApacheASP type http://localhost/ApacheASP
#It'll redirect http://localhost/ApacheASP to "c:/ApacheASP"

# Allow asp.net scripts to be executed in the /ApacheASP example
<Directory "c:/ApacheASP">
Options FollowSymlinks ExecCGI
Order allow,deny
Allow from all
DirectoryIndex index.htm index.aspx
#default the index page to .htm and .aspx
Directory>

# For all virtual ASP.NET webs, we need the aspnet_client files
# to serve the client-side helper scripts.
AliasMatch /aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*)
"C:/Windows/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4"
<Directory "C:/Windows/Microsoft.NET/Framework/v*/ASP.NETClientFiles">
Options FollowSymlinks
Order allow,deny
Allow from all
Directory>
IfModule>
#asp.net

Crear el directorio c:\ApacheASP y agregar index.aspx :


<%@ Page Language="C#" %>
<html>
<head>
<link rel="stylesheet"href="example.css">
</head>
<body>
<form>
<% for (int i=0;i<5;i++= { %>
<font size="<%=I%>"> Sample ASP.NET TEST</font> <br>
<% } %>
</form>
</body>
</html>

4)Reiniciar el Servidor Apache y probar http://localhost/ApacheAsp

Eso es todo...

1 Comentário:

Unknown dijo...

Una pregunta como hago para alojar varias aplicaciones o webs en esta configuracion , porque cuando voy agregando carpetas de diferentes proyectos en c:/asp , me arroja un erro como de Could not load type ‘TORRUNWS.index’. , pero cuando configuro que sea c:/asp/miproyecto, hay si me corre sin problemas, saludos y gracias

 

©2009 _Sebastian | Template Blue by TNB