libhttpserver 入门

libhttpserver 依赖libmicrohttpd,所以我们要先安装这个libmicrohttpd

https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.59.tar.gz

下载后并解压

./configure; make && make install

完成后最后开始编译libhttpserver

https://github.com/etr/libhttpserver/archive/0.17.0.tar.gz

下载解压到对应目录下执行以下命令

cd example; 
sed -i "s/8080/8081/g" `find . -type f`  #更换端口
./bootstrap
mkdir build
cd build
../configure
make
make install
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib #设置环境变量

./example/hello_world 运行即可

你可能感兴趣的:(libhttpserver 入门)