V
vivekian
Hi,
I have a cgi script which opens a telnet session to a switch. The
script is listed below. It executes fine on command line. When i call
it via a web browser, the error log shows the following error :
problem creating socket: Permission denied at /var/www/html/vlab/cgi-
bin/init_lab.cgi line 10
Other scripts which don't have sockets execute fine.
The file permissions for init_lab.cgi are :
-rwxrwxrwx 1 apache tspradhan 634 2007-08-20 00:48 init_lab.cgi
Not sure what is being missed here.
#!/usr/bin/perl
use CGI ;
use Net::Telnet ();
my $passwd = "network" ;
$t = new Net::Telnet (Timeout => 2);
$t->open("192.168.1.1");
$t -> waitfor ('/Enter password: /');
$t -> print ('network') ;
$t -> waitfor ('/Enter Selection: /') ;
$t -> put ('V') ;
$t -> waitfor ('/Enter Selection: /') ;
$t -> put ('C') ;
$t -> waitfor ('/Select \[1 \- 4\]: /') ;
$t -> print ('1') ;
$t -> waitfor ('/Enter Selection: /') ;
$t -> put ('M') ;
$t -> waitfor ('/Enter port numbers: /') ;
$t -> print ('1-16') ;
$t -> close ;
exit(0);
Thanks in advance,
vivekian
I have a cgi script which opens a telnet session to a switch. The
script is listed below. It executes fine on command line. When i call
it via a web browser, the error log shows the following error :
problem creating socket: Permission denied at /var/www/html/vlab/cgi-
bin/init_lab.cgi line 10
Other scripts which don't have sockets execute fine.
The file permissions for init_lab.cgi are :
-rwxrwxrwx 1 apache tspradhan 634 2007-08-20 00:48 init_lab.cgi
Not sure what is being missed here.
#!/usr/bin/perl
use CGI ;
use Net::Telnet ();
my $passwd = "network" ;
$t = new Net::Telnet (Timeout => 2);
$t->open("192.168.1.1");
$t -> waitfor ('/Enter password: /');
$t -> print ('network') ;
$t -> waitfor ('/Enter Selection: /') ;
$t -> put ('V') ;
$t -> waitfor ('/Enter Selection: /') ;
$t -> put ('C') ;
$t -> waitfor ('/Select \[1 \- 4\]: /') ;
$t -> print ('1') ;
$t -> waitfor ('/Enter Selection: /') ;
$t -> put ('M') ;
$t -> waitfor ('/Enter port numbers: /') ;
$t -> print ('1-16') ;
$t -> close ;
exit(0);
Thanks in advance,
vivekian