Beware that this can be a fix that causes more problems. It's very tempting to let the web server run as root--which opens up a big can of security worms.
Paul
11:25am, Vladimir D Belousov wrote:
... But if you have enabled SuEXEC (see the output `httpd -l`), your script will run as user/group you specify.
Paul Archer wrote:
This is a very common problem. When you run the script from the command line, you are running it with different privileges and a different path than when the web server runs it.
Most likely, either the command is not in the path for CGI scripts (try setting $ENV{PATH} or calling the command with the full pathname), or the web server, which should run as 'nobody', doesn't have permission to run the command properly.
10:29am, TapasranjanMohapatra wrote:
All, i am new to cgi. Please let me know why I dont get the data printed? I have abc.cgi in /var/www/cgi-bin
When the $cmd is "ls" I get the filenames when I visit localhost/cgi-bin/abc.cgi
But when the $cmd is the snmpquerry, I get nothing on the page, though I get the desired output(value of sysContact.0) when I run the script in commandline.
---------------------------- #! /usr/bin/perl print "Content-type: text/html\n\n"; print <<"END OF PRINT"; <html> <head><title>test</title></head> <body> END OF PRINT my $cmd = "snmpget 23.23.23.23 public sysContact.0"; #my $cmd = "ls"; my $res = qx!$cmd!; chomp($res); print <<"end of print"; <center> $res </center> </body></html> end of print -------------------------------------
TIA Tapas
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
------------------------------------------------------------- Note the obsessive use of abbreviations and avoidance of capital letters; this is a system invented by people to whom repetitive stress disorder is what black lung is to miners. Long names get worn down to three-letter nubbins, like stones smoothed by a river. ---Neal Stephenson, on Unix filesystem naming conventions----
---------------------------------------------------------------- Q: What do Winnie-the-Pooh and John the Baptist have in common? A: Their middle name. ----------------------------------------------------------------
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>