Click here to Skip to main content
Email Password   helpLost your password?

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:
    <!-- 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

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
QuestionApache performance
kavithakcross
18:45 18 Nov '08  
Hi everyone can anybody tell me how compatible asp.net project with apache 2.2....we r planning to host website using asp.net with Apache webserver...does this works? if yes can u tell me hw can i implement it...? if no please tell me the reason and in which way it can be implemented....

Thanks in advance....
GeneralAnother way
dfer
0:34 17 Dec '06  
http://www.ultidev.com/products/Cassini/index.htm[^]
GeneralASP.NET and APACHE
Anonymous
4:01 12 May '05  
I did try the cassini + apache stuff but didnt quite work so i googled for a while and found another solution to this issue.

Apache released a mod por the server called cli which handles asp.net pages very well. Here is the url. The documentation is very simple just add a few lines and it works.

http://httpd.apache.org/cli/

Example:
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

AliasMatch "^/(?i)aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*)" \
"C:/Windows/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4"

Options FollowSymlinks
Order allow,deny
Allow from all


AspNetMount /app-uri "C:/path/to/app"
Alias /app-uri "C:/path/to/app"
Options FollowSymlinks Indexes Includes ExecCGI
Order allow,deny
Allow from all
DirectoryIndex default.htm default.aspx


ENJOY!
GeneralRe: ASP.NET and APACHE
lcmduck
2:42 4 Nov '05  
I tried it, but when I try to access by IE 6.0 it shows this message error:

Server Error in '/expansiva' Application.
--------------------------------------------------------------------------------

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested Url: /expansiva/Entrada.aspx


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

Do you know why it is happening?


thanks...

Lucas
GeneralThere is another way...
Ade_V
13:51 19 Jan '05  
Get the Apache CLI library. It's only for Apache2, but it allows Apache to serve .NET content, without relying on Cassini in the background.

Read about it here: http://incubator.apache.org/projects/httpd-cli.html
Download it here: http://httpd.apache.org/cli/
Cheers,
Ade.
GeneralThink mod_mono
Neo4E656F
17:36 29 Oct '04  
The fantastic guys at the Mono project have alraedy created a module for apache you can find it here:

http://www.go-mono.com/asp-net.html[^]

If you wanted to you could easily recompile it for Microsoft .NET instead of Mono if there is any need to, but I imagine if you are using apache you'd almost preffer to use mono as your .NET provider.

GeneralRe: Think mod_mono
Brian Delahunty
2:33 16 Feb '05  
The mono module for Apache doesn't work with Apache on windows.

Regards,
Brian Dela Smile

Now Bloging![^]
GeneralDoesn't work for me
Andre S.
15:28 5 May '04  
I got a naked XP Pro System w/ Xampp. No Firewalls and no other software running.

I didn't make Cassini run on any port. No matter which port I use, Cassini tells me that this port is used by another server.

Any ideas?
GeneralRe: Doesn't work for me
Eron Zebadua
11:47 27 May '04  
your should add the cassini.dll to the global assembly

c:\cassini\gacutil / i cassini.dll
GeneralRe: Doesn't work for me
George Dyke
16:13 7 Jun '04  
I am trying to run Apache 2.0 on Win XP Home + Cassini for ASP.NET pages.

At step (3) in the basic instructions on this page, I get a similar message to the one described at the beginning of this post:

<<
Cassini Managed Web Server failed to start listening on port 8080.
Possible conflict with another Web Server on the same port.
>>
Any idea if this is the same issue? If so, what does it mean to add the cassini.dll to the global assembly? Is the global assembly like the Windows path? Or something else entirely?

Thanks,
George
GeneralRe: Doesn't work for me
jbllama
7:43 31 Oct '04  
I had trouble installing Cassini. I ran the build.bat from the Start-Run menu, but it didn't successfully run gacutil. Another reply had mentioned that gacutil doesn't always work, and suggested copying the cassini.dll to the c:\WINDOWS\assembly directory (this is the directory name if you are using Windows XP).
I couldn't copy/paste the file, but I was able to tag and drag it to the directory.

That took care of the gacutil problem.

The next problem I ran into was that IIS needed to not be running. It can be turned off from the Apache-Services menu. (Or, Control Panel-Administrative Tools-Internet Information Services, IIS).

I needed to fill in the blanks on the Cassini panel with:
Application: c:\inetpub\wwwroot
port: 8080 (port 80 didn't work for me, conflict)
Virtual Root: /

This worked for me, I could click on the link for the localhost and see the files I'd copied to the inetpub/wwwroot directory. I could click on an aspx file, and the aspx page did work correctly.

I needed to have IIS stopped, and Cassini started, to create a new project in Visual Studio.NET.

Unfortunately, in my attempts to get stuff working, I messed with the virtual directories and their file permissions ... now I can't get Cassini to run the aspx files anymore.

Anyone know how to set the permissions correctly?


GeneralRe: Doesn't work for me
glusk
11:52 8 Feb '05  
For what it's worth, we got it up and running. The trick is to run the gacutil command in the VS.NET command prompt utility to register the Cassini dll in the global assembly cache. Afterwards, everything worked fine. This whole approach is a bit of a hack, obviously. The cleaner approach is to use the Apache CLI library. If you're running a 1.3 production version, you can install 2.0 side by side and run the CLI on it.

Cheers,

GregSmile
Generalcatalog
Anonymous
6:19 17 Jul '03  
could you plz explain #3 in a little more detail? I'm not really familiar with Apache server yet, but I'm getting there. where exactly do I put this line:

c:\path-to-cassini\CassiniWebServer "c:\path-to-asp.net-sourcefiles" 8080

in what file?

-Paul
GeneralRe: catalog
Anonymous
6:30 17 Jul '03  
sorry for the confusion. i now understand that the line i typed in the previous post is to be typed at a command prompt, but i'm still unsure as to what "Create a different catalog (not the /aspnet catalog in http.conf) for your ASP.NET files " is asking me to do. thanks.

-Paul
GeneralApache and .net
Jake Helfert
8:00 23 Jan '03  
I recently completed an apache module that wraps asp.net and the .net framework. This allows apache to serve .aspx pages natively, w/o IIS or Cassini, etc. It works great.

I am wondering if there is any interest out there for such a beast.

Please send me an email with your opinions.



Jake Helfert
jake@helfert.cc
GeneralRe: Apache and .net
yamadhrama
21:50 14 Apr '03  
hai JAke
i am using apache 1.3 on windows.
can u pls tell me how to configure apache to process asp.net applications.

i am not using cassini web server.

pls help me in configuring this

thanks
GeneralRe: Apache and .net
AlexGnauck
5:31 8 Mar '04  
Hello,

im very interested at this module. is it available for download somewhere? Is the source available too?

Alex
GeneralRe: Apache and .net
arnab1974
19:53 14 Nov '04  
Hi Jake
Can u pls tell me how to run asp.net in apache 2.x.
thanks in advance

Arnab
GeneralRe: Apache and .net
dzCepheus
14:32 16 Nov '04  
Don't you just hate when people show up, drop something like this on us, then disappear and don't answer their emails? *sigh*

Support your local gravity testers -- Skydive!
Generalmod_rewrite
Peter Huisman
12:39 29 Dec '02  
suggestion: use mod_rewrite to server aspx ?!
GeneralStill need Windows server
Trollslayer
12:41 26 Aug '02  
Maybe I'm having a blonde moment here, but does this mean I can run .asp pages without a windows server now, just use Apache in say, Win2k pro ?

Elaine (slightly confused fluffy tigress)

Would you like to meet my teddy bear ?
GeneralRe: Still need Windows server
soderlind
14:22 26 Aug '02  
Well, I'm a natural blond and have blond moments all the time. Smile

Yes, you can run this on a w2k Pro or a XP Pro (any 'platform' supported by the .NET framework).

btw: saw your teddy bear - she(?) is a tough one Wink

br,
Per


GeneralRe: Still need Windows server
whatever123
13:46 27 Feb '03  
so apache can't run asp.net without cassini running. if so then what is the advantage?

can I write asp.net and php in same website?
GeneralRe: Still need Windows server
msn2wolf
0:17 2 Sep '04  
The advantage as I see it, resides in the freedom to *not* use IIS 5 and this translates in be able to use an older Windows version (supported by the .NET Framework). As far as I know Windows XP Home doesn't have IIS as an install option (without some dark hackings) and you can't upgrade IIS 4 from your Windows2000 to IIS 5. Besides I assume that the IIS that comes with Windows XP Pro is more like the one that came with Windows 2000 Pro, kind of a watered down version with tendencies to PWS. Microsoft will probably encourage you to get Windows 2003 Server for production deployments which is too expensive and inmature for my taste.


Last Updated 20 Aug 2002 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010