I am trying to create an image using Bio::Perl/Bio::Graphics and implement it on my webserver. However, whenever I am trying to run my scripts online, the command line does not respond to run my script.

One of my perl module files contains this system command:

my $command = "perl Graphics.pl $start $end $attributes";

All values are routed to this command and all scripts work perfectly fine when run manually through the command line. Apache does not report an error messages except that the file it was supposed to create in Graphics.pl hasn't been created:

> [Mon Dec 16 12:15:59 2013] [error] [client ::1] Cannot Open Output 59_15_12_16_11_113_1_349_0.png, referer: http://localhost/~User/cgi-bin/Home.pl

>[Mon Dec 16 12:15:59 2013] [error] [client ::1] File does not exist: /Users/User/Sites/cgi-bin/59_15_12_16_11_113_1_349_0.png, referer: http://localhost/~User/cgi-bin/Results.pl?start=1000&end=20000&chr=All&type=protein

Is there an additional setting that needs to be configured in the Apache settings so it can use the command line?

My specs are the following:

  • Server version: Apache/2.2.24 (Unix)
  • perl 5, version 16, subversion 2 (v5.16.2)
  • Mac OS 10.9 Mavericks

Any help would be greatly appreciated.

  • This seems much more on-topic at stackoverflow.com than here. – deceze Dec 16 '13 at 12:40
  • There are several sites where this is on-topic, but let's let the asker decide where they wish it to be placed. @felix how did you install and or configure / start apache? – bmike Dec 16 '13 at 12:46
  • 1
    Does the web server have write access to /Users/User/Sites/cgi-bin/? – nohillside Dec 16 '13 at 12:56
  • @patrix Yes the web server does have access to the directory. – fsimkovic Dec 16 '13 at 14:42
  • @bmike I wasn't sure myself where to place this question. Apache was installed by default and I configured it according to the normal guidelines. Everything seems to be working fine. It runs the scripts as it is supposed to. Has access to the perl modules and displays it correctly according to the html code. It's just that command that it ignores to execute. – fsimkovic Dec 16 '13 at 14:43

The problem has been solved. Basically Apache did not have permission to write into the folder. Steps to solve the issue included:

  1. ls -la cgi-bin to check the permissions of my cgi-bin folder.
  2. Give the _www group ownership of cgi-bin and give the group write permissions: chgrp -R _www cgi-bin && chmod g+w cgi-bin.
  3. In addition, I added my User to the group _www so I would not have to authenticate myself every time I added a file in the cgi-bin folder.
  4. sudo dseditgroup -o edit -a ikr -t user _www was used to do Step 3 (ikr has to be replaced with the username to be added)
  • Thought so :-) Thanks for giving detailed description on how to resolve this issue. – nohillside Dec 18 '13 at 15:09
  • @patrix Yeah, at the time I wasn't sure what exactly you meant. Somebody in StackOverflow pointed me into the right direction by asking to check the httpd.conf file and see the permissions in there. Was the long way round but got there in the end :) Thanks anyway – fsimkovic Dec 18 '13 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .