Apache 2.2 and ASP.NET

Alright, so we’ve proved we can run Apache on XP home edition and hit html pages.  Now for something cool!  Lets get ASP.NET up and running with Apache 2.2.  I’ll presume you have the .NET framework and Apache already installed.  First thing is to download Mod_ASPDotNet.  After you’ve installed it crack open the <apache server>\conf\httpd.conf file and append the following.

#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>
  AspNetMount /ASPNETFolder "c:/ASPNETFolder"
  Alias /ASPNETFolder "c:/ASPNETFolder"
  <Directory "c:/ASPNETFolder">
    Options FollowSymlinks ExecCGI
    Order allow,deny
    Allow from all
    DirectoryIndex index.htm index.aspx
  </Directory>

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

Now create the C:\ASPNETFolder directory and restart the Apache server.  Then publish your web services and web applications straight from Visual Studio to ASPNETFolder.  As a quick test create a file called testASP.aspx in C:\ASPNETFolder and add the following content.  Then hit the following link.  http://localhost/ASPNETFolder/testASP.aspx

<!– testASP.aspx –>
<%@ Page Language="vb" %>
<html>
<body>
    <form runat="server">
        <asp:textbox runat="server" />
    </form>
</body>
</html>

Advertisements
This entry was posted in Apache. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s