Search code examples
mysqlnginxluaosx-server

MAMP or Mac nginx MySQL Lua


I've recently purchased a Mac Mini with the only purpose of being a server.

I'm a C programmer, learning Lua and Obj-C at the moment. I'm trying to set up a website, a kind of CV/Personal Promotion site.

I've been looking at MAMP for a while however, I would like to use nginx and Lua in place of Apache and PHP.

My thought is using Lua instead of PHP would help accelerate my learning curve.

Does anyone have experience with this setup or using lua as server scripting?

Cheers


Solution

  • There is Jan Kneschke's lua magnet of which I maintain a fork on github. I use this in conjunction with FastCGI (and luasql.sqlite3) for a small message board, which was previously written in PHP, then python.

    The PHP and python versions each performed so-so (which may be due to me not being a good PHP/Python programmer at that time), and each took about 10-40MB of RAM. The Lua version runs within 1MB and is measurably faster. Also the code is easier to read, IMHO.

    Note that you will need some helper modules to work with POST requests. The download files to the book Lighttpd contain a version of cgi.lua that does the trick. If there is interest, I can make it available on my GitHub.