Skip to navigation
Run a rust or c compiled CGI binary with lighttpd
13.03.23
1. add a config setting like to 99-unconfigured.conf server.modules += ( "mod_cgi" ) $HTTP["url"] =~ "/" { cgi.assign = ( "" => "" ) } cgi.assign = ( ".cgi" => "" ) other example unning a CGI written in C This article illustrates how to config lighttpd web server to run cgi written in C Hello world example Save this "Hello world !" source code example in /var/www/cgi-bin (create this directory if it not exists). #include "stdio.h" int main(void) { printf( "Content-Type: text/plain\n\n" ); printf("Hello world !\n"); return 0; } Compile it typing: debarm:~# gcc hello.c -o hello.cgi lighttpd configuration Change the server.modules list inside /etc/lighttpd/lighttpd.conf in: server.modules = ( "mod_access", "mod_cgi", "mod_alias", "mod_accesslog", "mod_compress", ) and add these lines: $HTTP["url"] =~ "/cgi-bin/" { cgi.assign = ( "" => "" ) } cgi.assign = ( ".cgi" => "" ) Restart lighttpd typing: debarm:~# /etc/init.d/lighttpd restart Final test Access with your browser to the FOX Board web page using this URL: http:///cgi-bin/hello.cgi
https://www.acmesystems.it/foxg20_cgi
Reply
Anonymous
Information Epoch 1732441573
Silence is golden.
Home
Notebook
Contact us