Compile tinyhttpd under Linux

Compile tinyhttpd under Linux

Source: https://blog.csdn.net/qq673675158/article/details/104927245?spm=1001.2014.3001.5506

According to the instructions,

  • To compile for Linux:
    1. Comment out the #include <pthread.h> line.
    1. Comment out the line that defines the variable newthread.
    1. Comment out the two lines that run pthread_create().
    1. Uncomment the line that runs accept_request().
    1. Remove -lsocket from the Makefile.

Modify the httpd.c file

Modify Makefile

Modify htdocs/color.cgi

first row:

#!/usr/local/bin/perl -Tw

change into:

#!/usr/bin/perl -Tw

That is, the installation path where perl is located, otherwise cgi cannot run.

Guess you like

Origin blog.csdn.net/u013209189/article/details/127253993