Webserver bring up(I): Install lighttpd and fastcgi++
Lighttpd is a popular high performance webserver.
If you are using Debian based distributions, you can directly install it by apt install:
sudo apt install lighttpd
If you are using Yocto, you also can install it easily because poky already provided recipe for it. you can find it at poky/meta/recipes-extended/lighttpd/.
The default installed version(no matter PC or Yocto) only provides basic functions, fastcgi is not included. To enable support for fastcgi you need to :
- Modify file lighttpd.conf(On PC path is /etc/lighttpd/lighttpd.conf) to add mod_fcgi into server.modules.
- If you are using Yocto, you also need to add lighttpd-module-fastcgi to IMAGE_INSTALL_append or declare dependencies of module fastcgi in your recipes:
IMAGE_INSTALL_append += "lighttpd-module-fastcgi"
fastcgi++(fastcgipp) is a C++ FastCGI and Web development platform. I choose this library because it provides support for C++14 and the official site of fastcgi which provides C/C++ libraries before has been closed for several years.
Seems there is no yocto recipe for fastcgi++ on internet, but it’s easy to write a recipe by myself because it supports built by cmake. Here comes my recipe for fastcgi++:
SUMMARY = "fastcgi++"
BTW to pass cmake runtime parameters in Yocto, we can use EXTRA_OECMAKE :
EXTRA_OECMAKE += "-DBUILD_SAMPLE=ON"