Run ASP. NET successfully in Apache Environment

Source: Internet
Author: User

Because the company's products need to consider some new deployment methods in the new version, so I took the time to pay attention to some cross-platform. NET solutions. Although the Mono Project is no stranger to people developed based on. NET, Mono is a narrow cross-platform (because it is an OS-level) concept. In a broad sense, using different Web servers can also be regarded as a tool.
The reason is that IIS is too popular, so many key application scenarios Prohibit installation and use of IIS in plain text. According to the execution principle of ASP. NET, it processes tcp requests through a Web Server, and then executes and presents ASPX in a managed environment using. NET. Therefore, Apache is currently the most economical alternative to IIS. At the same time, Apache's sub-project has a module that supports ASP. NET and has been developed to version 2.0. I used Apache HTTP Server 2.0.55 and mod_aspdotnet 2.0.0. The installation is very simple. Both programs are the msi installation package, and you can do it all the way to next. Create a directory under the installation directory/htdocs, for example, active.
However, there are two minor issues to note:
First, when installing Apache HTTP Server, if port 80 on our machine is occupied, You need to select port 8080 to install that option. Of course, this port can be installed in httpd. conf file. After you install apache2 manually, run the cmd command and enter the apache installation directory, for example, D: \ Program Files \ Apache Group \ Apache2 \ bin, run: apache-k install.
Second, when configuring aspdotnet_module, We need to append the following list to the httpd. conf file:# 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
<IfModuleMod_aspdotnet.cpp>
# Mount the ASP. NET example application
AspNetMount/active "J:/Working/BIVSS"
# Map all requests for/active to the application files
Alias/active "J:/Working/BIVSS"
# Allow asp.net scripts to be executed in the active example
<Directory"J:/Working/BIVSS">
Options FollowSymlinks ExecCGI
Order allow, deny
Allow from all
DirectoryIndex Default.htm Default. 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 + )/(. *) "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>

This configuration file is simple and has detailed comments. However, you must note that the above commands (non-#-start lines) must be written on one line. If you copy data from a Web page, you must be especially careful, in particular, the AddHandler and AliasMatch statements are easily broken into two lines. In this way, the apache service will fail to be started and the prompt is very simple and will not tell you the configuration file loading error.
Currently, the biggest problem with the mod_aspdotnet module is the lack of authentication support. For example, windows and form are not supported yet, but the open-source update is still very fast. Because Microsoft. NET Framework is used as the CLR, the development and update pressure and Mono are not an order of magnitude, and I believe it will soon be able to provide better support for page authentication.
After successful installation, you can run the probe to check the effect, for example, using the ASP. NET probe of Comrade Mike.

Basic Server Information
Server Name:Birdshome Server IP Address:127.0.0.1
. NET Framework language types:English (United States) . NET Framework Version:2.050727.29
Server Port:80 Server Domain Name:Localhost
Server time:11/18/2005 12:11:39 AM Server Operating System:Microsoft Windows XP
Server space usage:. 13 Physical site path:D: \ Program Files \ Apache Group \ Apache2 \ htdocs \ active \
Server IE browser version:6.0000 Server IIS version:Apache/2.0.55 (Win32)
The server has been running since it was last started:12883 seconds Script Timeout:30000000 seconds
Absolute path of the virtual directory:D: \ Program Files \ Apache Group \ Apache2 \ htdocs \ active \ Absolute path of the execution file:D: \ Program Files \ Apache Group \ Apache2 \ htdocs \ active \ SiteInfo. aspx
Server Operating System installation directory:C: \ WINDOWS Server application installation directory:C: \ Program Files
Number of CPUs:This computer has 1 CPU CPU type:X86 Family 15 Model 3 Stepping 3
CPU level:The CPU usage is 50528271. Cpu oem id:The cpu oem id is 0.
CPU page size:The page size in CPU is 4096
 75% of memory in use  The total physical memory is 510 MB.
 The available physical memory is 126 MB.  The total size of the swap file is 1245 MB.
 The size of the interchangeable file is 750 MB.  Total virtual memory: 2047 MB
 Unused virtual memory: 1817 MB Logical drive:A: | C: | D: | E: | F: | G: | H: | J: | K: | L: | M:


Related Article

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.