nhwebgroup
Verified User
I have MANY cgi scripts out side of the cgi-bin folder on one website. I can not get them to run outs side of the cgi-bin
i have added a custom directive to HTTPC in the DA tool but the scrips still do not run
here is what i added to the DA httpd
<Directory /home/admin/domains/mywebsite.com/public_html/customscripts/>
Options ExecCGI
</Directory>
here is a sample CGI file:
<code>
#!/usr/bin/perl
#output html
print "Content-type: text/html\n\n";
print "<h1>hello world!</h1>";
$e = `perl -ver`;
$r = `whereis perl5`;
$z = `whereis sendmail`;#
$w = `top`;#
$d = `w`;
print "<pre>perl version:<br>$e<hr>perl path:<br>$r<hr>sendmail path:<br>$z<hr>top:<br>$w<hr>w:<br>$d<hr>environment vars:<br>";##
while (($key, $val) = each %ENV) {
print "$key = $val\n";
}
print "<hr>path tranlsated(NT)<br>$ENV{'PATH_TRANSLATED'}</pre>";
exit;
</code>
</code>
When i run this scrip in the browser i get Internal server error
I have check the permissions and they are set to 755 for both the file and the directroy.
What do i need to do to get cgi scripts to work outside the cgi
i have added a custom directive to HTTPC in the DA tool but the scrips still do not run
here is what i added to the DA httpd
<Directory /home/admin/domains/mywebsite.com/public_html/customscripts/>
Options ExecCGI
</Directory>
here is a sample CGI file:
<code>
#!/usr/bin/perl
#output html
print "Content-type: text/html\n\n";
print "<h1>hello world!</h1>";
$e = `perl -ver`;
$r = `whereis perl5`;
$z = `whereis sendmail`;#
$w = `top`;#
$d = `w`;
print "<pre>perl version:<br>$e<hr>perl path:<br>$r<hr>sendmail path:<br>$z<hr>top:<br>$w<hr>w:<br>$d<hr>environment vars:<br>";##
while (($key, $val) = each %ENV) {
print "$key = $val\n";
}
print "<hr>path tranlsated(NT)<br>$ENV{'PATH_TRANSLATED'}</pre>";
exit;
</code>
</code>
When i run this scrip in the browser i get Internal server error
I have check the permissions and they are set to 755 for both the file and the directroy.
What do i need to do to get cgi scripts to work outside the cgi