Not Just Paranoid

Another site by Pete Maynard

Check Apache2 CGI is working

Using bash, create the file test.pl, and write a simple CGI script which outputs, “It works!”.

echo -e '#!/usr/bin/perl\nprint "Content-type: text/plain\\n\\n";\nprint "It works!\\n";'|sudo tee /usr/lib/cgi-bin/test.pl

Give the new file correct permissions sudo chmod 755 /usr/lib/cgi-bin/test.pl

Send a get request to the script, by piping the request to the netcat.

echo -e "GET /cgi-bin/test.pl HTTP/1.0\n"|nc -q 1 127.0.0.1 80```

15 Apr 2012 | Tags ( Apache2 CGI )

Website Last Updated on 13 Oct 2020 (CC BY-SA 4.0)

This site uses JQuery and nanogallery2 hosted by jsdelivr.net
for the Flickr photo feed and GoatCounter for user insights.