0xf104a / MeowMeow

Tiny webserver written in erlang
MIT License
2 stars 0 forks source link
cgi cgi-fcgi cgi-server docker docker-image dockerfile erlang fcgi fcgiwrap fpm http http-server meowmeow-webserver php php-fpm server webserver

MeowMeow webserver (formerly Ghost WebServer)

Erlang CI Publish Docker image Tests

Abstract

This is simple web server written in plain erlang.

Erlang version

Erlang/OTP 23 is required to run this server. Erlang/OTP 24 is reccommended.

Running

Debug mode

The best way to debug the program is just to do as following:

$ cd src/
$ erlc *.erl && erl; rm -rf ./*.beam # This will rebuild everything from scratch, so there would be no problems with cached files
...
Eshell V11.2  (abort with ^G)
1> server:start().

Before using this approach don't forget to create configuration files:

$ cp -r configs/ /etc/MeowMeow/ # Porbably you will need root(i.e. sudo)

Production mode

Compile using rebar3:

$ rebar3 as prod release

Then you need to create configs in /etc/MeowMeow/. After this you can run server:

$ ./_build/prod/rel/MeowMeow/bin/MeowMeow <desired mode of running>

If you need help on modes of running just execute script with no arguments to get help.

Using

Put your files in /var/www/ directory they will be served statically. Currently FastCGI support available for serving files wich are not static.

Configuring

IMPORTANT NOTICE: In current version syntax errors in config are NOT checked, so misconfiguration may lead to fatal errors.

Server

Server configuration is stored in /etc/MeowMeow/meow.conf. The syntax is as follows:

Directive1 Args
Directive2 Args

Current version support following directives:

You can see an example of routing rules configuration here

Credits