Successful operation of ASP.net in Apache environment-practical tips

Source: Internet
Author: User
Tags server port
Because the company's products in the new version, need to consider some new deployment methods, so take time to pay attention to. NET Cross-platform solutions. Although Mono Project Yes, based on. NET development, but because mono is a narrower cross-platform (because it is the OS level) concept. In a broad sense, the use of a different Web server can also be regarded as a collapse platform.

The reason for this is that the reputation of IIS is so indiscriminate that many key scenarios explicitly prohibit the installation and use of IIS. From the standpoint of ASP.net's execution, it handles TCP requests through a Web server, and then executes and renders the ASPX to implement a managed environment using. NET. So using Apache is the most economical IIS alternative at the moment, while the Apache Sub-Project has exactly one module that supports ASP.net, and has been developed to version 2.0. The version I'm working with is Apache HTTP Server 2.0.55 and mod_aspdotnet 2.0.0 。 The installation is very simple, two programs are MSI installation package, all the way next is done. And then in the installation directory/htdocs to build a directory, such as: active.

But there are two minor issues to note:
One is: In the installation of Apache HTTP Server, if the 80 port on our machine has been occupied, we need to choose to use 8080 ports to install the option, of course, this port can be modified in the httpd.conf file. Only use this installation method to install the following need to manually start the Apache2 service, use cmd command and enter the Apache installation directory, such as: D:\Program Files\apache Group\apache2\bin, run: apache-k Install

The second is: 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
<ifmodule mod_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 is 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+) _ (\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 >
Originally this configuration file is very simple, there are detailed comments. However, be sure to pay attention to the above command (not the beginning of the line), all need to write on a line, if it is from the Web page copy to be particularly careful, especially AddHandler and aliasmatch these two sentences easily broken into two lines, so that the launch of the Apache service will fail, and hints very simple It's not going to tell you. config file load error.

at present, the biggest problem with this mod_aspdotnet module is the lack of authentication support, such as Windows and form are not supported, but the new source of things are fast. Due to the use of the Microsoft. NET framework as the CLR, the pressure and mono to develop updates are not at an order of magnitude, and it is believed that there will soon be better support for page certification.

After successful installation, you can run a probe to check the effect, such as using the ASP.net probe by Mike's old cat comrade.
Server basic Information
Server name: birdshome Server IP Address: 127.0.0.1
. NET Framework language type:中文版 (United States) . NET Framework Version: 2.050727.29
Server port: Server domain name: localhost
Server time: 11/18/2005 12:11:39 AM Server operating system: Microsoft Windows XP
Server space occupancy: . Site physical path: D:\Program files\apache group\apache2\htdocs\active\
Server IE browser version: 6.0000 Server IIS version: apache/2.0.55 (WIN32)
Server last started to now run: 12,883 seconds Script timeout: 30 million seconds
Virtual directory absolute path: D:\Program files\apache group\apache2\htdocs\active\ Execute file absolute path: 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: 1 CPUs in this computer CPU Type: x86 Family Model 3 Stepping 3
CPU Level: CPU level is 50528271 CPU OEM ID: CPU's OEM ID is 0
CPU Page Size: the size of the page in the CPU is 4096
75% of memory is in use Total Physical Memory 510MB
There are 126MB of physical memory to use The total size of the swap file is 1245MB
The file size 750MB is acceptable Total virtual memory has 2047MB
no virtual memory available 1817MB Logical drives: A: | | C: | | D: | | E: | | F: | | G: | | H: | | J: | | K: | | L: | | M:


Finally, be aware that because Apache itself is case-sensitive for the URL's directory and filename, So asp.net's virtual directory must pay attention to the case, otherwise access will not be wrong, but will not find any files, like access to an empty directory. In addition to the virtual directory name, because other ASPX files are loaded by the Mod_aspdotnet module, they are still not case sensitive.
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.