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:
- # 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
-
- AspNetMount/SampleASP"C:/SampleASP"
- Alias/SampleASP"C:/SampleASP"
- #/SampleASP is the alias used to execute the asp.net directory, and c:/SampleASP is its actual address
-
- # Open the script running permission
- <Directory"C:/SampleASP">
- Options FollowSymlinks ExecCGI
- Order allow, deny
- Allow from all
- DirectoryIndex index.htm index. aspx
- # Set the default file
- </Directory>
-
- # For ASP. NET virtual pages, the following aspnet_client file is required to support client help scripts.
- AliasMatch/aspnet_client/system_web/(\ 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>
- # 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.
- Make Apache support ASP. NET (Apache 2.0 or above)
- XML Web Service Method of ASP. NET
- XML data displayed on the ASP. NET page
- What is iframe asp. NET?
- ASP. NET lifecycle display