Add FastCGI approach
[matches/MCTX3420.git] / testing / fastcgi-approach / README.txt
1 The application could be quite easily made to use FastCGI. Unlike normal CGI,
2 with FastCGI (fcgi), the process is executed once, and continues to run. The
3 process will receive responses from the browser in the response loop. Hence,
4 sensor data can be read in another thread while the response loop runs.
5
6 Setup:
7 Compile fastcgi_test.c with:
8 gcc fastcgi_test.c -lfcgi -o fastcgi_test
9
10 Configure nginx to pass all requests to the address /cgi/ to the application:
11 Edit /etc/nginx/sites-enabled/default by adding the contents of nginx_server_config.txt
12
13 Restart nginx:
14 /etc/init.d/nginx restart
15
16 Run the application:
17 spawn-fcgi -p9005 -n ./fastcgi_test
18
19 You can see the results at:
20 http://your.domain/cgi

UCC git Repository :: git.ucc.asn.au