Developing for .NET on the Mac, Part 2: Serving ASP.NET Pages

Getting a Macintosh to serve up ASP.NET content is actually pretty simple. Mono's primary support for ASP.NET comes through an Apache plugin called mod_mono. This is very good news for the Mac user because Apache version 1.3 comes as part of Tiger. As long as you don't need to run other plugins that require newer versions of Apache (like Subversion), setting up ASP.NET on a Mac could scarcely be easier.

Prerequisites:
  • I'm assuming that you've already read and followed Part 1 of this series. At a minimum, you should have:
    • The Subversion client
    • A directory for Subversion checkouts (which I refer to as ~/src/mono)
    • A binary distribution of Mono from their website

  1. Open a terminal and go to ~/src/mono.
  2. Check out the code for mod_mono. This command should get the job done: svn checkout svn://anonsvn.mono-project.com/source/trunk/mod_mono.
  3. Go to ~/src/mono/mod_mono and run the command ./autogen.sh --prefix=/Library/Frameworks/Mono.framework/Versions/Current.
  4. Follow this by running make && make install. Note that you will probably need elevated permission to complete the installation ste.
  5. Edit /etc/httpd/httpd.conf and add this to the end of the file: Include /private/etc/httpd/mod_mono.conf.
  6. Open System Preferences and select "Sharing".
  7. Check the box next to "Personal Web Sharing".
At this point, you should have basic support for ASP.NET on your Mac. The last step that you performed turned on Apache, which by default will look for content in /Library/WebServer/Documents, and putting aspx files ino this folder should result in them being handled by mod_mono.

It should be noted that many applications will require more advanced setup than this (for example, applications like the CruiseControl.NET web dashboard want to be able to handle all web requests for their directory, not just the ones pointing to aspx files), but this is a topic for another post.

Print | posted @ Sunday, July 01, 2007 2:38 PM

Comments on this entry:

No comments posted yet.

Your comment:

Title:
Name:
Email:
Website:
 
Italic Underline Blockquote Hyperlink
 
 
Please add 5 and 1 and type the answer here: