2009
08.06

This was modified from JLBN, his tutorial focuses on Apache 2.2.x (and is also 12 pages long).

  1. Download this: mod_aspdotnet and install it
  2. Make a new folder in your C:\wamp\www\ folder called ASP.
  3. Open your httpd.conf file in your favorite text editor (C:\wamp\bin\apache\apache2.0.x\conf\httpd.conf)
  4. In the LoadModule section, add this line:
  5. LoadModule aspdotnet_module “modules/mod_aspdotnet.so”

  6. Add this code before “Include “c:/wamp/alias/*””:
  7. <IfModule mod_aspdotnet.cpp>
    # Mount the ASP.NET /ASP application
    AspNetMount /ASP “C:/wamp/www/ASP”

    # Map all requests for /ASP to the application files
    Alias /ASP “C:/wamp/www/ASP”

    # Allow asp.net scripts to be executed in the /ASP folder
    <Directory “C:/wamp/www/ASP”>
    # Set asp.net options
    Options Indexes FollowSymLinks Includes +ExecCGI
    # Set asp.net permissions
    Order allow,deny
    Allow from all
    # Set asp.net default index page to .aspx and .htm
    DirectoryIndex index.aspx index.htm
    </Directory>

    # Set 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>

  8. Let’s test it. Make a file called simple.aspx in the ASP folder you created, and put this code inside.
  9. <% Dim I As Integer
    For I = 0 to 7 %>
    <font size=”<%=I%>”> Simple ASP.NET TEST</font> <br>
    <% Next %>

  10. Go to your browser and type in http://localhost/ASP/simple.aspx
  11. If you get an error, check to make sure the directory it’s looking for is there and if it isn’t just create it. For me the directory was C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

If I missed something, let me know.

35 comments so far

Add Your Comment
  1. So is this any different for Apache 2.2.11 ?

    I did JLBN method, I just notices you don’t call out the httpd-aspdotnet.conf since you added it in the same httpd.config.

    Either way I still cant get my asp to work on my wampserver. A see the actual code.

    Any sugestions would be greatly appresiated. And thanks for the 12 page brackdown real good.

    • It’s not called in httpd-aspdotnet.conf because there is no separate config file for that Apache version (at least the one I tested it on). And if I tried to import it, it would never work right.. So I just hardcoded it to httpd.conf itself.

      There is a different ASP.net version for 2.2 that is on Sourceforge, did you try downloading that instead of the 2.0 version that I linked?

      Are you sure it’s saved as an aspx file? And that it’s set like it is above in the httpd.conf? Sounds like it’s not being read as an ASP file and just reading the code into an HTML file.

  2. Adam thank you for your quick reply.

    Yes I know there is no separated file since you just hard coded it. but in JLBN Method he did actually called it the http-aspdotnet.conf and he loaded it through the httpd.conf. At least this is what I understood.

    Anyways I would like to do it your way. I am currently trying to get asp running in wampserver, apache version is Apache 2.2.11, Yes I did install ASP for apache 2.2. also made sure I had the latest Frameworks. Do i need to have a specific framework ?

    I also hard coded the httpf.conf file with your suggestions.

    I made sure that the file was simple.aspx, inside “C:\wamp\www\ASP\simple.aspx” and i visit the site through http://localhost/asp/simple.aspx and i just get html output with actual asp code.

    Every .aspx, .asp page just spits out html code including the actual asp code.

    I have completely removed and reinstalled everything and still end up with the same thing. maby I should start looking for a different method for this ?

    Any help would be greatly appreciated thanks.

    • You’re right, he included it in the httpd.conf file. For some reason, that never worked for me and it never got included, so hardcoded it in the file itself instead.

      Anyways, are you sure the ASP module is running and working? Check the modules tab under WAMP and make sure it is checked and the line loading the module is pointing to the right path.

      Otherwise you’ll get..

      < % Dim I As Integer For I = 0 to 7 %>
      ”> Simple ASP.NET TEST
      < % Next %>

      as straight text when you load the page in a browser.

      Other than that, I’m not really sure. Make sure the module is properly installed and working and that you are pointing to the correct paths. I’m assuming you are restarting WAMP after you made the changes too. Apache shouldn’t successfully load if something is wrong in the httpd.conf file.

  3. I do restart Apache.

    In the modules tab under WAMP what name does the module show up as ?

    mod_aspdotnet?

    If so it doesn’t show up on my WAMP module list.

    I did install the mod_aspdotnet in the C:\wamp\bin\apache\Apache2.2.11\ is it in another directory?.

    Maby C:\wamp\bin\apache\Apache2.2.11\modules??

    Thanks again.

    • Apache doesn’t see the module then and yes, that’s the correct folder. The file should be called “mod_aspdotnet.so” in that folder.

      If the file isn’t there, then reinstall the module and make sure the installer is set to the correct apache path (it isn’t by default).

      Then make sure that this line..

      LoadModule aspdotnet_module “modules/mod_aspdotnet.so”

      is in the LoadModule section of httpd.conf.

  4. I double checked the httpd.conf file, but like you said it should not load if there is something wrong, and it doesn’t work. ( Thanks for that i always had to re-install wamp )

    So I removed the code you have and it works just fine with ought the asp changes on the httpd.conf.

    I do have a module called mod_aspdotnet.so there for should work fine.

    I cant see what I am missing :(. Maby I am locating the LoadModule aspdotnet_module “modules/mod_aspdotnet.so” some where I shouldn’t ?

    Maby if you could point me on where to locate exactly the following line:

    LoadModule aspdotnet_module “modules/mod_aspdotnet.so”

    I am currently puting it under: LoadModule php5_module “c:/wamp/bin/php/php5.3.0/php5apache2_2.dll”

    Does this count as the LoadModule section of the httpd.conf?

    • Yes under that line is the right place.

      I don’t know what else to tell you :(. It sounds like the module isn’t installed properly.

  5. Adam, it wont work. ASP is just not for my WAMPS I guess. I only wanted ASP for some support while I changed some stuff to PHP and MySQL

    Anyways I do have one last question. Could WAMP be used to manage a collage website and be stable on a actual server 24/7?. I currently maintain this collage site that is all ASP and yeah it needs upgrades.

    Just a thought since its actually really good.

    • I use WAMP to host business enterprise sites. The only thing I haven’t got working is SSL/HTTPS. Other than that, I’ve had no problems using WAMP as a server.

      • Enabling ssl_module in apache modules and php_openssl in php extension will get ssl working; you can find a tutorial about generating an ssl certificate, but ssl will work without the ssl cert for functionality that requires it, it just won’t be certified.

  6. Very nice, well thanks for your help I appreciate everything.

    Great site by the way !

  7. For everyone experiencing issues when WAMP works with an original httpd.conf but not with the edited. Make sure that the quotes, and with that I mean the rabbit ears, ” are not formatted. That really screwed things up for me, it was just a simple search and replace for all strange ” characters (could be characters from another keyboard layout or something than for others).

  8. I have one problem. Where exactly i have to install the thing from 1.? I tried it every where on m wamp server. But it says that this is the wrong path.

    • I’m pretty sure it’s your Apache install.

      In my case its

      C:\wamp\bin\apache\Apache2.2.11

      So maybe try that? Hope that helps.

  9. Valuable information you got here! I would like to thank you for the nice stuff you post!! Thumbs up

  10. To Sam: you got the older version try this one, it should work:
    http://sourceforge.net/projects/mod-aspdotnet/files/mod_aspdotnet/2.x.0.2006/mod_aspdotnet-2.2.0.2006-setup-r2.msi/download

  11. Thanks! i really thought .aspx cannot be used in WAMP Server.. phew! This saves me a lot of time reading ebooks! :)

    • It should be called WAMPA 😛

  12. Thanks ! I have installed the 4.0 Framework but when i try to view the webpage it tells me that I use 2.0. Do oyu know how I can change that?

  13. Hi I did the 12 pages long thing and it WORKED just one problem.

    All the files i have is HTML and ASP files not ASPX.

    What to do then?

    The thing is i need to test something for a Association that asked for my help with their homepage and their old Webmaster apparently did all in .asp so i am reading up on my ASP atm but i need WAMP to accept.

    I get this error: “Serverfejl i programmet ‘/ASP’.
    Denne type side kan ikke leveres.
    Beskrivelse: Den type side, du anmodede om, kan ikke leveres, for den er udtrykkeligt forbudt. Filtypenavnet ‘.asp’ er muligvis ikke korrekt. Kontroller URL-adressen nedenfor for at sikre, at den er stavet korrekt.

    Ønsket URL-adresse: /ASP/simple.asp

    Versionsoplysninger: Microsoft .NET Framework version:2.0.50727.5446; ASP.NET version:2.0.50727.5420 ”

    I will try and translate to English: “Server error in the program ‘/ASP’.
    This type of page can’t be delivered.
    Description: This type of page, your requesting can’t be delivered, because its explicit prohibited. File type name ‘.asp’ is possible not right. Check the URL-address below to be sure you spelled it correctly.

    Requested URL-address: /ASP/simple.asp

    Versions information: Microsoft .NET Framework version:2.0.50727.5446; ASP.NET version:2.0.50727.5420”

    I run windows 7 ultimate x64 with the newest ASP.net frame.

    I am trying the simple.aspx to asp just to see if it was the asp files them self that was wrong sadly not.

    Any help on this?

  14. Hey, so I’m getting pretty frustrated.

    I tried the 12 page long way and that did not work and caused my WAMP server to not work because APACHE would not load. So I came to you. Hard coding it seemed like it would be a much better idea; however, that is not the case. Your way did not work either.

    I followed both instructions perfect TO THE “T”. Twice in fact… so this is my fourth failed attempt.

    I have NO idea what is wrong with it. Each time I edit the HTTPD file, it causes my APACHE to stop running. I edited when I installed PERL on the server, but now every time I edit that file it causes it to stop running.

    I don’t understand how so many people can get it to work just by doing the SAME thing as me, but mine won’t work. Any ideas?

    Here are the specs:
    Windows XP
    Wamp Server APACHE Version: 2.2.17

    I even used the ASP.NET from the other guy’s because that was for version 2.2X… I’m completely baffled by this. Please help! WAMP Is an amazing server and I don’t want to have to figure out another server to use!

  15. HI can run aspx but not asp. What is wrong?

  16. How aboat if the Apache Server dose not load up after i have done this steps?
    Bechuse he dose not start for me.

    • Yeah, I’m having the same problem. Apache doesn’t restart if you include the mod_aspdotnet.so line. Once I comment that out, it starts again. Anyone have a fix/solution?

  17. I couldn’t get it working in my WAMPserver, The tray dock icon only turned orange, not green. It turned out I was mixing the 64-bit version with 32-bit ASP.net module. I installed the latest 32-bit version of WAMPserver and now it runs fine.

  18. Using windows 7, when I try to install the mod_aspdotnet module I get ‘not a valid path’ error, no matter where I try to install. Need some help here … Thanks

  19. I followed the location “C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files” and failed I back tracked it and noticed mine does not have the Temporary folder whatsoever and I could not find ASP.NET files.
    Please help!!!!

    Thanks

  20. I follow the steps given above:
    1. Downloaded mod_aspdotnet-2.2.0.2006-setup-r2.msi and installed.
    2. Added LoadModule aspdotnet_module “modules/mod_aspdotnet.so” and all the codes in httpd.conf.
    3. Started all Services successfully in WAMP v2.2.
    4. Create simple.aspx will the code given above.

    When I use Firefox to load http://localhost/simple.aspx
    It only shows the code below:

    <font size=¡±¡±> Simple ASP.NET TEST

    Can you tell me what’s wrong and how to correct it?

  21. Hello sir, I have successfully made the simple.aspx work with WAMP, But when I copy pasted my website that I created using VS2010, it doesnt work. It errors:
    It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level.

    This error can be caused by a virtual directory not being configured as an application in IIS
    … and I am using WIN7 so I dont have IIS.. Please take a look at this link for my detailed explanation.

    http://stackoverflow.com/questions/16331546/error-on-wamp-allowdefinition-machinetoapplication-beyond-application-level?noredirect=1#comment23390572_16331546

    please help me kind sir! THANK YOU.

  22. To @Jason: when you copy pasted the codes to your httpd files. try removing the double quote and typing it again, When you copy paste it the double quotes are different 😀

    hope yours work

  23. Hello there,

    many people seem to be facing the same problem as me, aspdotnet does not worr. Wamp Icon stays orange.
    So guyds, any ideas? I am guessing it has to do with the 64bit version of Windows, but that would not explain why it does not work when you install a 32bit wamp server anyway.

    So please dear Author of the post: clear us up and help us, we are lost 😉
    Kind regards,
    Dominik

  24. I also tried this method to be able to see ASP webpages through WAMP server.
    First I also got the WAMP taskbar icon orange. But after fiddling around with removing the hash (#) before virtual host include line in the httpd.conf file above the inserted line # ASP.net …. and restarting the whole WAMP server (All services) the WAMP tray icon then turned green. I put back the hash (#) to exclude the line for include virtual host – restarted again all services and the WAMP tray icon went green again. So I guess all is working now and the page simple.aspx is displaying fine.

    But – it seems only working with .aspx files and not asp. As few have already asked… why is this?

  25. Hi Adam

    Installed module in apache root directory of wamp, result 73k .so file can be seen in the module subfolder.
    There is a already the temporary folder ie v2.0.50727\Temporary ASP.NET in windows folder
    Add … before “Include “c:/wamp/alias/*”” in the httpd.conf
    Loaded aspdotnet.so module using LoadModule aspdotnet_module “modules/mod_aspdotnet.so” in httpd.conf.

    After shut down and restart wamp, all seem ok as this module is ticked in tray’s apache modules

    but …
    the any dynamic aspx or asp file in the localhost folders is not processed by .net.

    Any advice for a quick fix.

    Or this the way to go now
    Have Apache as the front-end server (port 80) and have IIS be the back-end server (8080). Then use Apache’s ProxyPass directive to proxy specific websites or URLs to IIS, which runs the ASP.NET code, and give the output back to Apache, which delivers it to the visitor/client.

  26. @Nimras

    in C:\Windows\Microsoft.NET\Framework\vx.x.x\CONFIG\web.config
    add line

    in block and try again