Click here to Skip to main content
6,597,576 members and growing! (19,848 online)
Email Password   helpLost your password?
Web Development » ASP.NET » General     Intermediate

Cassini and Apache 101

By Per S

This article describes how to get ASP.NET up and running on Apache 2.x for Windows
Windows, .NET 1.0, ASP.NET, Visual Studio, Apache, Dev
Posted:19 Aug 2002
Views:173,393
Bookmarked:51 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
7 votes for this article.
Popularity: 2.90 Rating: 3.43 out of 5
1 vote, 25.0%
1
1 vote, 25.0%
2

3
1 vote, 25.0%
4
1 vote, 25.0%
5

Introduction

Cassini is a web server written in C#, you'll find more information about it at http://www.asp.net/

These simple steps gets Apache up and running with ASP.NET

  1. Download and install Apache 2.x for Windows (remember to stop IIS)
  2. Modify the http.conf file:
    # 
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_connect_module modules/mod_proxy_connect.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule rewrite_module modules/mod_rewrite.so 
    
    # 
    ProxyPass /aspnet http://127.0.0.1:8080/ 
    ProxyPassReverse /aspnet http://127.0.0.1:8080/ 
    
  3. Create a different catalog (not the /aspnet catalog in http.conf) for your ASP.NET files and start Cassini:
    1. If you are using the cassini server included in WebMatrix
      c:\path-to-cassini\webserver.exe /port:8080 /path:"c:\path-to-asp.net-sourcefiles"
    2. or, the stand-alone Cassini server
      c:\path-to-cassini\CassiniWebServer "c:\path-to-asp.net-sourcefiles" 8080
  4. Test:
    • Cassini: http://localhost:8080/test.aspx
    • Apache: http://localhost/aspnet/test.aspx
    <!-- test.aspx -->
    <%@ Page Language="vb" %>
    <html>
    <body>
        <form runat="server">
            <asp:Calendar runat="server" />
        </form>
    </body>
    </html>
    

Ultimate test

If everything is working fine, you can move on to the 'ultimate' test, running ASP.NET Forums on Apache

  1. Do a manual installation of ASP.NET Forums (skipping step 7)
    See: http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=21470
  2. Add to http.conf (assumes the modifications above are done)
    #AspNetForums
    ProxyPass /AspNetForums http://127.0.0.1:8081/AspNetForums 
    ProxyPassReverse /AspNetForums http://127.0.0.1:8081/AspNetForums 
    #aspnet_client
    ProxyPass /aspnet_client http://127.0.0.1:8082/aspnet_client 
    ProxyPassReverse /aspnet_client http://127.0.0.1:8082/aspnet_client 
    
  3. Start 2 different Cassinis listening on port 8081 and 8082.
    c:\path-to-cassini\webserver.exe /port:8081 /path:"c:\path-to-asp.net-forums" /vpath:"/AspNetForums"
    c:\path-to-cassini\webserver.exe /port:8082 /path:"E:\Program Files\ASP.NET\Client Files" /vpath:"/aspnet_client"

It is not the fastest solution, but everything works fine. I decided to "stress-test" it using Homer running 10 threads 5 sockets per thread in one minute, and got the following:

Page Hits TTFB* Avg. TTLB* Avg.
/AspNetForums/Default.aspx 286 1024.96 7458.23

*: TTFB = Time To First Byte, TTLP = Time To Last Byte

Bear in mind that this test was done on my Thinkpad T21 800Mhz/512 MB, which is filled with junk.

Now I am waiting for someone to write a mod_cassini

Reference

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Per S


Member

Occupation: Web Developer
Location: Norway Norway

Other popular ASP.NET articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 24 of 24 (Total in Forum: 24) (Refresh)FirstPrevNext
QuestionApache performance Pinmemberkavithakcross18:45 18 Nov '08  
GeneralAnother way Pinmemberdfer0:34 17 Dec '06  
GeneralASP.NET and APACHE PinsussAnonymous4:01 12 May '05  
GeneralRe: ASP.NET and APACHE Pinmemberlcmduck2:42 4 Nov '05  
GeneralThere is another way... PinmemberAde_V13:51 19 Jan '05  
GeneralThink mod_mono PinmemberNeo4E656F17:36 29 Oct '04  
GeneralRe: Think mod_mono PinmemberBrian Delahunty2:33 16 Feb '05  
GeneralDoesn't work for me PinsussAndre S.15:28 5 May '04  
GeneralRe: Doesn't work for me PinmemberEron Zebadua11:47 27 May '04  
GeneralRe: Doesn't work for me PinsussGeorge Dyke16:13 7 Jun '04  
GeneralRe: Doesn't work for me Pinsussjbllama7:43 31 Oct '04  
GeneralRe: Doesn't work for me Pinmemberglusk11:52 8 Feb '05  
Generalcatalog PinsussAnonymous6:19 17 Jul '03  
GeneralRe: catalog PinsussAnonymous6:30 17 Jul '03  
GeneralApache and .net PinmemberJake Helfert8:00 23 Jan '03  
GeneralRe: Apache and .net Pinmemberyamadhrama21:50 14 Apr '03  
GeneralRe: Apache and .net PinmemberAlexGnauck5:31 8 Mar '04  
GeneralRe: Apache and .net Pinmemberarnab197419:53 14 Nov '04  
GeneralRe: Apache and .net PinmemberdzCepheus14:32 16 Nov '04  
Generalmod_rewrite PinmemberPeter Huisman12:39 29 Dec '02  
GeneralStill need Windows server PinmemberTrollslayer12:41 26 Aug '02  
GeneralRe: Still need Windows server Pinmembersoderlind14:22 26 Aug '02  
GeneralRe: Still need Windows server Pinsusswhatever12313:46 27 Feb '03  
GeneralRe: Still need Windows server Pinsussmsn2wolf0:17 2 Sep '04  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 19 Aug 2002
Editor: Nishant Sivakumar
Copyright 2002 by Per S
Everything else Copyright © CodeProject, 1999-2009
Web20 | Advertise on the Code Project