views:

37

answers:

2
+1  Q: 

htaccess correct?

Although I can run test.cgi fine but my perl all doesn't work, is this htaccess correct:

AddHandler cgi-script .cgi
Options +ExecCGI

IndexIgnore *
DirectoryIndex myapp.cgi


RewriteEngine on

RewriteRule ^$ myapp.cgi [L]
RewriteRule ^/$ myapp.cgi [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ myapp.cgi/$1
A: 

What kind of error is Apache returning? If it looks like permissions, try adding:

Order allow,deny
Allow from all

before the RewriteEngine line and see if that helps.

Also, unless you're sure that your rewrite rules are correct I'd comment them out until you see that your script runs as it should. If the script won't work without them then replace it for testing purposes with something really simple just to make sure that Apache's working correctly.

elmugrat
Added, still no effect. :(
Nimbuz
Ok, make everything as simple as possible. Comment out the rewrite stuff and the index lines in your .htaccess. Make a new script containing just: #!/usr/bin/perl print "hey there";chmod it to 755 so permissions won't mess you up. Add an index.html with just a word in it and make sure that works. If that's ok, then try the .cgi again with just the bare necessities in the .htaccess:AddHandler cgi-script .cgiOptions +ExecCGIOrder allow,denyAllow from allFinally, check your httpd.conf and make sure AllowOverride is set to all on that directory. Errors would help too.
elmugrat
Ugh sorry the comment stripped out all my newlines.... If that's too hard to read let me know.
elmugrat
Nothing worked, please see: http://stackoverflow.com/questions/3097979/perl-app-not-loading/3097994#3097994
Nimbuz
Since you said that test.cgi runs fine, your .htaccess/apache config must be correct. That means there's a problem somewhere in the perl app you're trying to run. Errors from cgi apps usually show up in the logs... check there to make sure your app compiles correctly.
elmugrat
A: 

Turns out that mediatemple's PERL version is 5.8.4 and my app is only compatible with 5.8.8+.

Nimbuz