This is how you use CGI on barwen.ch. It is not intended to tell you how to use CGI in general.
cd ~ mkdir public_html mkdir public_html/cgi-bin cd public_html/cgi-bin cat > test <<EOD #!/bin/bash echo Content-type: text/plain echo echo HELLO EOD chmod a+x test
and then browse to http://s0.barwen.ch/~you/cgi-bin/test. You should see the word "HELLO" in your browser.
CGIs will run under your account, not as the www-data user.
You can also use FastCGI, a different CGI-like protocol, by creating a