Simple libmicrohttpd C web server. It hosts one route /whois
that returns the server hostname.
Some things to take notice:
- Threading model: Main thread doing select, and Thread Pool (min 2).
- Hostname variable: Is a global heap-allocated variable (freed up when exiting program), it is re-defined on
controller.h
. - Linking: Is dynamically linked.
First download libmicrohttpd.
- Fedora:
sudo dnf install libmicrohttpd libmicrohttpd-devel
- Ubuntu:
sudo apt-get install libmicrohttpd libmicrohttpd-dev
Execute make
. You can use this options:
DEBUG=1
: It uses theMHD_USE_DEBUG
The binary should be on the folder bin
.
-
Which threading model should i use ?
- Threading models. The best combo for maximum performance and scalability is
MHD_USE_SELECT_INTERNALLY
withMHD_OPTION_THREAD_POOL_SIZE
.
- Threading models. The best combo for maximum performance and scalability is
-
ccache: error: Failed to create temporary file for Permission denied
- ccache doc. According to this, we should chown
~/.ccache
to the compiling user
- ccache doc. According to this, we should chown