light weight server

1 Lightweight web sever

Apache, lighttpd, nginx are the most widely used websevers, and lighttpd can be the best choice for personal server. But there are actually more great options available, like minihttpd, litespeed, mongrel, thttpd, and ihttpd, im-httpd, fnord, mattows, darkhttpd, Yaws are extremely small servers.

Here is a comparison of web server software.

The easiest way is running this command in your terminal, if python 3 has installed.

python -m http.server 8080

I prefer lighttpd and configed it according to this archlinux wiki .

  1. Install lighttpd

    brew install lighttpd
  2. Modify server_root in /usr/local/etc/lighttpd/lighttpd.conf It is equal to server.document_root

    var.server_root = "/absolute/path/to/my/website"
    server.port = 8080
  3. Run lighttpd as service

    brew services start lighttpd
    # if you modify any lighttpd conf file, restart this service
    brew services restart lighttpd
  4. View your website on browser

    localhost:8080 is the default website address.

2 Lightweight app server

Pow is a even better choice as Rack server for Mac OSX, because it is zero-config according to its website .

  1. install pow

    curl get.pow.cx | sh
  2. Symlink your Rack app to ~/.pow

    cd ~/.pow
    ln -s /path/to/myapp
  3. Your app is running at http://myapp.dev/
  4. Uninstall pow with this cmd

    curl get.pow.cx/uninstall.sh | sh