#!/bin/bashIf you move/copy the script from a different directory or you use a different directory, the SELinux context is likely to be wrong and will need to be changed, so bear that in mind.
echo "Content-type: text/html"
echo ""
echo "Uptime is: $(uptime)"
Make the script executable:
chmod +x uptime.cgiYou can now test your new cgi script with:
elinks 127.0.0.1/cgi-bin/uptime.cgiYou might want to add the following directives to a different directory to enable script execution and allow other script extensions.
Directory Options +ExecCGINote that the . before the file extension is not needed and that the extensions are case insensitive.
AddHandler cgi-script pl cgi
No comments:
Post a Comment