Run ASP. NET program on Apache

Source: Internet
Author: User
ArticleDirectory
    • 1. Why not use IIS
    • Ii. Required Documents
    • Iii. configuration process
    • 4. Run and test website instances
    • 5. Problems
1. Why not use IIS

Using ASP. NET to develop web pages, selecting IIS on the server is definitely the best web page deployment solution. It seems nonsense to say this, because they are all Microsoft's own products. Of course, it will be better to combine them. However, I encountered a situation where I considered non-IIS ASP. NET deployment solutions.

The operating system I use is WINXP and ghost xp. When installed, IIS is not installed by default, to download an independent IIS installation package or use the original system disk to add this IIS component to the control panel. In such an unprofessional environment, there are many IIS problems (for example, IIS may be unavailable when some patches are updated by the system). Sometimes, even if IIS is reinstalled, at this time, we only need to reinstall the system, so it is especially annoying. Especially after using the system for a while, we have installed a lot of software and really don't want to reinstall the system. So now I think of ASP. NET Server building options outside of IIS.

Ii. Required Documents

1. phpnow. (Including PHP, Apache, and MySQL, As long as Apache is used ,......)

2. Microsoft. NET Framework.

3. ASP. NET module of Apache.

Iii. configuration process

1. Install Microsoft. NET Framework. The installation will be completed after the next step.

2. Install the Apache server. Decompress the phpnow installation package and run Setup. just install cmd (for details about the installation method, refer to my other tutorial "using Zend studio + phpnow + Zend debugger to build a PHP server debugging environment"). because I plan to use the php web page again, I used the phpnow Integrated Installation Package instead of installing Apache separately.

3. Install the ASP. NET module of Apache. Install the downloaded Installation FileProgramIt will initialize and automatically find the Apache installation directory. If an error is found, you can manually adjust it. (Note: The mod_aspdotnet version must correspond to the Apache version installed by yourself.). Finally, configure APACHE-20/CONF/httpd. CONF file, open this file with notepad, append the following configuration node at the end of the file, and start with "#" as the comment part. Also, change the directory in the corresponding configuration to your actual directory.

The following Apache configuration method and comments are from the network, which is unknown to the author.

# Asp.net support
#
These two configurations are global and can be placed after other response loadmodule/addhandler statement blocks.
#
In my configuration, the entire configuration block below is placed at the end, not separated, to facilitate management
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

# The following configuration can be placed in the VM
ifmodule mod_aspdotnet.cpp >

# mount the ASP. net example application
#
the aspnetmount statement is equivalent to the mount command in Linux. it mounts the ASP program directory to a URL address
#
If ASP is not used for the entire website, it should not be hashed under. For example: aspnetmount/asptool "d :\\ www \ apache2 \ htdocs \ aspweb"
#
Note: The Global DocumentRoot parameter is" D: /www/apache2/htdocs/aspweb "
aspnetmount / " D: /phpnow/htdocs "

# Map all requests for/active to the Application Files
#
All requests to '/asptool' are mapped to the mounted ASP program directory.
#
In my configuration, the following sentence is commented out.
#
Alias/asptool "D:/www/apache2/htdocs/aspweb"

# Allow Asp.net scripts to be executed in the active example
< Directory " D:/phpnow/htdocs " >
Options followsymlinks execcgi
Order allow, deny
Allow
From All
Directoryindex default.htm default. aspx index.html index. aspx
</ Directory >
# For all virtual ASP. NET webs, we need the aspnet_client files
#
To serve the client-side helper scripts.

# Note: The following two lines correspond to the. NET Framework installation directory.
Aliasmatch / Aspnet_client / System_web / (\ D + ) _ (\ D + ) _ (\ D + ) _ (\ D + ) / (. * ) " C:/win2003/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
FromAll
</Directory>

</Ifmodule>
#Asp.net supports end.4. Run and test website instances

After completing the above installation and configuration, you can now make your own simple ASP. net Site program or download simple ASP.. Net Site program is placed in the Apache site directory (htdocs directory), and then enter http: // 127.0.0.1 address in the browser to access the site. For more information, see my other tutorial "using Zend studio + phpnow + Zend debugger to build a PHP server debugging environment". Here, why do I emphasize the need to test a "simple" website? I found that there are still some problems in this running environment. Please refer to the fifth point below.

5. Problems

In the above ASP. NET runtime environment, I tested the easy-to-use sitefactory CMS and found that there were many problems and it was impossible to run normally. It is understood that this server environment is correct. the Identity Authentication Mode of net is not supported. In addition, I also found that the support for sub-directories also encountered some strange problems. Therefore, we can conclude that this runtime environment is defective and should be used with caution, you can try it on a small website or a small test.

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.