Problems Executing CGI scripts on Apache2
#!/usr/bin/perl -w
use strict;
print "Content-Type: text/html\n\nHello world!";
I got this working by adding the following to the /etc/apache2/sites-available/mysitename.com file.
<directory srv="" www="" mysitename.com="" public_html="">Options +ExecCGI
AddHandler cgi-script .cgi</directory>
But I want to execute CGI scripts in the /srv/www/mysitename.com/public_html/mt/ directory, so I changed the directory in the entry above to that path and when I view the hello world script in that folder via a browser I see the source for the hello.cgi script rather than the output. Clearly something isn't right. I've spent more than enough time trying to work this out myself and the time has come to ask for help. So, anyone got any suggestions? Please keep answers simple I really am just learning to tread water Linux/Apache2 wise here!