Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to revamp some nasty old sites on a cheap shared host using one of these new-fangled Perl web frameworks (Dancer). I had module dependency problems with the existing Perl install (5.6.1) so I built a new (5.12) version locally.

The new Perl version seems to work fine when testing my app or using the development server, and I was hoping I could just change the shebang the CGI script to point to my new Perl and Apache would serve it ok. Unfortunately in the Apache error log I just get:

failed to open log file
fopen: Permission denied
[Thu Dec  9 14:45:21 2010] [error] [client 138.***.***.***] Premature end of script headers: /home/www/hosts/blahblah/cgi-bin/bb/public/dispatch.cgi

This seems to indicate Apache can't find or execute my new Perl version, but I can't see why not.

I've checked the permissions on my local Perl and they're all 755, which I though user www would be able to access and execute ok. Now I've run out of ideas? Is there anything else I can try?

I can SSH in to the hosting server but don't have root perms or access to the Apache config.

Thanks.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Not sure I should "answer" this myself but I eventually figured it out the problem. I'd installed my own version of Perl in a ~/perl5 directory, but Apache could apparently only see inside ~/www (a symlink pointing to my domain name.) Rebuilding Perl and all the modules inside ~/www/perl5 fixed things.

Lessons learned:

  • if I'd configured Perl with "relative @INC paths" option enabled I could have just moved the whole lot and saved myself a bunch of time - it's not the default though.
  • cpanm (App::cpanminus on CPAN) is a real time-saver for installing Perl modules and their dependencies if you're in a restricted environment and can't get regular CPAN to work.

Unlikely this'll help someone in a similar situation but you never know.

(Incidentally, now I've solved the build/run problems, running a modern framework like Dancer doesn't seem to be working out with regular old CGI. There might be some config issues remaining but it seems incredibly slow to serve my tiny app. But those are problems for a different SF question.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.