views:

79

answers:

1

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...

  1. Got Apache running just dandy. Macports installed it with perl5 placeholder and perl5.8.9.
  2. Installed mod_perl2.
  3. Run the script to configure httpd.conf.
  4. Restarted apache.
  5. 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?

+2  A: 

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.

Ether
That did it. I owe your cat one cheeseburger. Thanks!
Brooks