Table of Contents
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 .
Install lighttpd
brew install lighttpd
Modify
server_rootin /usr/local/etc/lighttpd/lighttpd.conf It is equal toserver.document_rootvar.server_root = "/absolute/path/to/my/website"
server.port = 8080Run lighttpd as service
brew services start lighttpd
# if you modify any lighttpd conf file, restart this service
brew services restart lighttpdView your website on browser
localhost:8080is 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 .
install pow
curl get.pow.cx | sh
Symlink your Rack app to
~/.powcd ~/.pow
ln -s /path/to/myapp- Your app is running at http://myapp.dev/
Uninstall pow with this cmd
curl get.pow.cx/uninstall.sh | sh