How to Configure Apache 2 to Run Perl Cgi Scripts

Configure Apache2 to allow clients to run Perl Scripts in cgi-bin

If they are receiving 404, it means that the file does not even exist in the correct location. In the httpd.conf look for the "ScriptAlias" directive that has an entry for cgi-bin, should be something like

ScriptAlias /cgi-bin/ /some_folder/cgi-bin

Once you know the correct folder, the 404 error should go away.

Two other points -
1. For cgi files, ensure that the execute bit is set.
2. Verify that the location of perl matches the one in the perl script.

How can I configure Apache to run Perl CGI scripts?

What type of scripts? CGI? FastCGI? mod_perl? The steps are different.

  • http://httpd.apache.org/docs/2.2/howto/cgi.html
  • http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html
  • http://perl.apache.org/docs/2.0/user/intro/start_fast.html


Related Topics



Leave a reply



Submit