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
- Download and install
Apache 2.x for Windows (remember to stop IIS)
- 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/
- Create a different catalog (not the /aspnet catalog in http.conf)
for your ASP.NET files and start Cassini:
- 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"
- or, the stand-alone Cassini server
c:\path-to-cassini\CassiniWebServer "c:\path-to-asp.net-sourcefiles" 8080
- Test:
- Cassini: http://localhost:8080/test.aspx
- Apache: http://localhost/aspnet/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
- Do a manual installation of ASP.NET Forums (skipping step 7)
See:
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=21470
- 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
- 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