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:
-
- Comment out the #include <pthread.h> line.
-
- Comment out the line that defines the variable newthread.
-
- Comment out the two lines that run pthread_create().
-
- Uncomment the line that runs accept_request().
-
- 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.