Run ASP. NET successfully in Apache Environment

Source: Internet
Author: User
Article Title: ASP. NET is successfully run in the Apache environment. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
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
  
# 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
  
Options FollowSymlinks ExecCGI
Order allow, deny
Allow from all
DirectoryIndex Default.htm Default. aspx
  
# 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"
  
Options FollowSymlinks
Order allow, deny
Allow from all
  
  
  
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.
    

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.