Apache's magic weapon for supporting ASP. NET 2.0: mod_aspdotnet

Source: Internet
Author: User

ASP. NET 2.0 is the latest Web application development platform. As part of the. NET Framework, it is powerful, high-performance, and easy to develop. As a Microsoft product, IISIIS and Apache are the best Web servers used to build ASP. NET ). However, if a Windows machine has installed Apache and a Web application, you cannot enable IIS on the same port ). Fortunately, we can also support ASP. NET under Apache httpd.

Mono, the most famous open-source project dedicated to. NET cross-platform, provides an Apache plug-in Mod_mono to support ASP. NET. However, Mod_mono mainly targets Unix/Linux platforms. Although Windows is available, it is based on Mono instead of Windows's ready-made. NET Framework, and is not updated in a timely manner. ASP. NET 2.0 cannot be well supported.

Some people have created an independent Web server to support ASP. NET, but it still cannot meet our direct use of existing Apache to support ASP. NET.

In fact, Apache has provided the ASP. NET solution for a long time, that is, the mod_aspdotnet module. But this plug-in stopped development a year and a half ago. I don't know whether to give way to Mono or worry that ASP. NET is developing too fast. However, we can still download it from the Apache module archive library.

Mod_aspdotnet is much more sophisticated than mod_mono, and the installation program is more than 300 K. As long as the. NET Framework is installed in the system, it can perfectly support ASP. NET, or even 2.0.

The specific implementation of Apache's support for ASP. NET is quite simple. The steps are as follows:

1. download and install the latest Apache HTTP Server. Here is the link 2.2.3.) and perform basic configuration. If the Apache service has been enabled, skip this step ).

2. download and install the mod_aspdotnet module.

3. modify the configuration file in C: \ Program Files \ Apache Group \ Apache2 \ conf \ httpd. conf) and add the following lines:

 
 
  1. # Asp.net 
  2. LoadModule aspdotnet_module"Modules/mod_aspdotnet.so" 
  3.  
  4. AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo
  5.  
  6. AspNetMount/SampleASP"C:/SampleASP"
  7. Alias/SampleASP"C:/SampleASP" 
  8. #/SampleASP is the alias used to execute the asp.net directory, and c:/SampleASP is its actual address 
  9.  
  10. # Open the script running permission 
  11. <Directory"C:/SampleASP">
  12. Options FollowSymlinks ExecCGI
  13. Order allow, deny
  14. Allow from all
  15. DirectoryIndex index.htm index. aspx 
  16. # Set the default file 
  17. </Directory> 
  18.  
  19. # For ASP. NET virtual pages, the following aspnet_client file is required to support client help scripts. 
  20. AliasMatch/aspnet_client/system_web/(\ d + )/(.*)"C:/Windows/Microsoft. NET/Framework/v $1. $2. $3/ASP. NETClientFiles/$4"
  21. <Directory"C:/Windows/Microsoft. NET/Framework/v */ASP. NETClientFiles">
  22. Options FollowSymlinks
  23. Order allow, deny
  24. Allow from all
  25. </Directory> 
  26. # Asp.net 

4. Create an ASP. NET site under C:/SampleASP to create the index. aspx file)

5. Restart the Apache server.

6. You can use http: // localhost/SampleASP/index. aspx to view the effect of Apache's support for ASP. NET.

  1. Make Apache support ASP. NET (Apache 2.0 or above)
  2. XML Web Service Method of ASP. NET
  3. XML data displayed on the ASP. NET page
  4. What is iframe asp. NET?
  5. ASP. NET lifecycle display

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.