Mono XSP == OSX Web Server

Over the weekend I required a very simple web server on my MacBook to allow me to play around with some iPhone Web App development. It didn’t need to do much, simply accept requests and serve webpages. While I’ve created web servers before, after sending a tweet out I was reminded about Mono XSP. XSP is an web server developed under the Mono project banner allowing you to serve web pages and asserts (javascript, css, images etc) to clients. Simply – it’s great!

After installing Mono, to launch a server simply navigate to the directory where your pages resides using a Terminal (command prompt), and type in XSP. This will start a full webserver on port 8080 serving pages from the directory. Now, within seconds, I can quickly make any directory on my laptop accessible over HTTP!

On OSX, the execution simply looks like this:

Pretty:Base Ben$ xsp
Listening on address:
Root directory: /Users/Ben/SourceControl/iPhoneWebApp101/iWebKit/Base
Listening on port: 8080 (non-secure)
Hit Return to stop the server.

Great for prototyping and rapid development and while I haven’t tried it, it should work on Windows equally as well.

Leave a Reply

Your email address will not be published. Required fields are marked *