I'm trying to get perl running under on my Apache 2 macports install. I'm hoping an experienced perl geek can help me out. I've...
Written the following test script in htdocs
#!/opt/local/bin/perl
print "content-type: text/html \n\n";
print 'Hello world.';
All I get is the script contents printed out to the screen. Am I missing a step? Is there some additional configuration I need to do in the .conf file?
Apache hasn't been configured to recognize certain file types as cgi executables. Adding this line to your httpd.conf will do the trick, although there are many other ways of configuring this to achieve the same effect:
AddHandler cgi-script .cgi .pl
You may also have to add ExecCGI
to an options list for your domain. See Apache Tutorial: Dynamic Content with CGI for more information.