Perl script rendered in browser as code through symlink - fine when accessed directly

Posted by John Dittmar on Pro Webmasters See other posts from Pro Webmasters or by John Dittmar
Published on 2013-10-29T21:58:49Z Indexed on 2013/10/29 22:20 UTC
Read the original article Hit count: 273

Filed under:
|
|
|

I have a Rails 4 app that has some views that post to Perl cgi scripts. The perl scripts are accessed via a symbolic link to a folder called "cgi-bin". When I navigate to a perl script through the symbolic link they are rendered as text instead of executed (ie: localhost:3000/cgi-bin/test.cgi), however when I access them directly they execute without issue (ie. localhost/path/to/cgi-bin/test.cgi).

I am using apache2 on os x. In the directory localhost/path/to/ I have an .htaccess file that contains the following:

# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

I have the exact same lines in the .htaccess file that I have in localhost:3000/

I have also uncommented the AllowOverride all in httpd.conf.

The are no errors in apache's error log. When I access the direct link to test.cgi a new line is appended to apache's access log, when I access the script through the symbolic link (and it is rendered as text), there is no line appended to the access log.

Any idea why this error occurs? This setup worked fine in a previous version of rails of OS X, but recently I upgraded to Mavericks and figured I should update the Rails application to v4.0 as well.

© Pro Webmasters or respective owner

Related posts about htaccess

Related posts about apache