How to make Apache run ASP. NET/ASP. NET 2.0

Source: Internet
Author: User
How to make Apache run ASP. NET/ASP. NET 2.0

Don't ask me why... But I 've been asked to make Apache run ASP. NET.

It worked!

Even worked with ASP. NET 2.0 site!

Following are the instruction to Make ASP. NET work under Apache:

-InstallApache 2.0.54

-InstallMod_aspdotnet

-Add at the end of c: \ Program Files \ apache group \ apache2 \ conf \ httpd. conf 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

<Ifmodule mod_aspdotnet.cpp>
# Mount the ASP. NET/ASP Application
Aspnetmount/sampleasp "C:/sampleasp"
#/Sampleasp is the alias name for Asp.net to execute
# "C:/sampleasp" is the actual execution of files/folders in that location

# Map all requests for/asp to the Application Files
Alias/sampleasp "C:/sampleasp"
# Maps/sampleasp request to "C:/sampleasp"
# Now to get to the/sampleasp type http: // localhost/sampleasp
# It'll redirect http: // localhost/sampleasp to "C:/sampleasp"

# Allow Asp.net scripts to be executed in the/sampleasp example
<Directory "C:/sampleasp">
Options followsymlinks execcgi
Order allow, deny
Allow from all
Directoryindex index.htm index. aspx
# Default the index page to. htm and. 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>
# Asp.net

-Create a directory c: \ sampleasp and insert in it the index. aspx

-Restart Apache server:
Start-> Apache HTTP Server 2.0.54->
Control Apache server-> restart

-Open explorer and navigateHttp: // localhost/sampleasp/index. aspx

 

If everything worked fine you shoshould get a nice Asp.net page working.

-Index. aspx-

<% @ Page Language = "VB" %>
<HTML>
<Head>
<LINK rel = "stylesheet" href = "intro.css">
</Head>
<Body>
<Center>
<Form action = "index. aspx" method = "Post">
<H3> name: <input id = "name" type = text>
Category: <select id = "category" size = 1>
<Option> one </option>
<Option> two </option>
<Option> three </option>
</SELECT>
</H3>
<Input type = submit value = "lookup">
<P>
<% Dim I as integer
For I = 0 to 7%>
<Font size = "<% = I %>"> sample ASP. NET test </font> <br>
<% Next %>
</Form>
</Center>
</Body>
</Html>

 

 

Reprinted from: http://weblogs.asp.net/israelio/archive/2005/09/11/424852.aspx

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.