RE: [Asterisk-Users] Help Running am-main.pl Perl/CGI on Apache Server
Another reason can be a missing or incomplete addhandler line in /etc/httpd/conf/httpd.conf. The line should look like: Addhandler cgi-script .cgi .pl My Redhat installation was missing the .pl and when trying to run perl based cgi scripts also generated the same 500 error. Correcting the line fixed my problem. Bill Seddon Lyquidity Solutions 16 Lynton Road New Malden SURREY KT3 5EE +44 (0) 208 336 2556 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shilliday, Jim Sent: September 04, 2004 8:36 PM To: Shekhar Prasad; Asterisk Users Mailing List - Non-Commercial Discussion Subject: RE: [Asterisk-Users] Help Running am-main.pl Perl/CGI on Apache Server I had the same problem -- make sure these three lines are at the beginning of each of your .pl's (right after the comment section): use CGI; my $q = CGI-new(); print $q-header(); That fixed it for me. Jim Shilliday IT Director Equal Justice Center 1315 Walnut St. Suite 400 Philadelphia PA 19107 215-238-6970 -Original Message- From: Shekhar Prasad [mailto:[EMAIL PROTECTED] Sent: Saturday, September 04, 2004 2:19 PM To: [EMAIL PROTECTED] Cc: Taemoor Abbasi Subject: [Asterisk-Users] Help Running am-main.pl Perl/CGI on Apache Server Hi all, I've installed Asterisk on Linux Red Had 9. Now, I was trying to set up a GUI based system for the PBX. I downloaded some packages, but I have to have Perl running CGI scripts through the webserver. It does not allow me to. I am able to run a basic script that just just prints out html messages and nothing else. However, when I try to run am-main.pl or config.pl or any other cgi-bin scripts that came with Asterisk, I get a 500 error: Premature End of Script Header. I've tried changing the chmod to -x or 755 and also have included the header required to display the html script. However, no luck. I am able to run it in command line, but not through the Mozilla browser. Is this enough information I've provided? You can contact me directly if you need more information. shekhar . prasad at gmail . com shekhar ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Help Running am-main.pl Perl/CGI on Apache Server
Just tried it and no luck here. Here's a copy of the script if you want to go into details (note, I am having the same problem for all scripts that came with Asterisk Manager. The error I get when trying to execute in browser is: Server Error 500 - Premature end of script header) I've spent 3-4 hours researching the web and trying different things to fix it. #!/usr/bin/perl # Comments # use CGI; #already included with the file use am_common; my $q = CGI-new(); #additions just mentioned by Jim print $q-header(); #additions just mentioned by Jim $CGI::POST_MAX = 512 * 1024;# half meg is max size $pvars = CGI::new(); # get directories if passed in otherwise get them from the .cfg file my $dir_work = $pvars-param(DIRW); my $dir_conf = $pvars-param(DIRC); my $dir_ast = $pvars-param(DIRA); if (!$dir_work) { $dir_work = get_cfg_value(dir_work); } if (!$dir_conf) { $dir_conf = get_cfg_value(dir_conf); } if (!$dir_ast) { $dir_ast = get_cfg_value(dir_ast); } my $page = Content-type: text/html\n\n; $page .= HTMLHEADTITLEAsterisk Management System/TITLE/HEADBODY; $page .= FONT SIZE=-1BA HREF=\am-help.pl?DIRW=$dir_workDIRC=$dir_confDIRA=$dir_astHT=help-main\HELP/A/B; $page .= CENTERFONT SIZE=+3BAsterisk Management System/B/FONTBR; $page .= HR; $page .= BRA HREF=\config.pl?DIRW=$dir_workDIRC=$dir_confDIRA=$dir_ast\Configuration/A; $page .= BRA HREF=\admin.pl?DIRW=$dir_workDIRC=$dir_confDIRA=$dir_ast\Administration/A/CENTER; $page .= /BODY/HTML; print $page; exit(0); Any help will be greatly appreciated. Sincerely, Shekhar Prasad On Sat, 4 Sep 2004 15:35:48 -0400, Shilliday, Jim [EMAIL PROTECTED] wrote: I had the same problem -- make sure these three lines are at the beginning of each of your .pl's (right after the comment section): use CGI; my $q = CGI-new(); print $q-header(); That fixed it for me. Jim Shilliday IT Director Equal Justice Center 1315 Walnut St. Suite 400 Philadelphia PA 19107 215-238-6970 -Original Message- From: Shekhar Prasad [mailto:[EMAIL PROTECTED] Sent: Saturday, September 04, 2004 2:19 PM To: [EMAIL PROTECTED] Cc: Taemoor Abbasi Subject: [Asterisk-Users] Help Running am-main.pl Perl/CGI on Apache Server Hi all, I've installed Asterisk on Linux Red Had 9. Now, I was trying to set up a GUI based system for the PBX. I downloaded some packages, but I have to have Perl running CGI scripts through the webserver. It does not allow me to. I am able to run a basic script that just just prints out html messages and nothing else. However, when I try to run am-main.pl or config.pl or any other cgi-bin scripts that came with Asterisk, I get a 500 error: Premature End of Script Header. I've tried changing the chmod to -x or 755 and also have included the header required to display the html script. However, no luck. I am able to run it in command line, but not through the Mozilla browser. Is this enough information I've provided? You can contact me directly if you need more information. shekhar . prasad at gmail . com shekhar ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Help Running am-main.pl Perl/CGI on Apache Server
On Sat, Sep 04, 2004 at 01:18:59PM -0500, Shekhar Prasad wrote: Hi all, I've installed Asterisk on Linux Red Had 9. Now, I was trying to set up a GUI based system for the PBX. I downloaded some packages, but I have to have Perl running CGI scripts through the webserver. It does not allow me to. I am able to run a basic script that just just prints out html messages and nothing else. However, when I try to run am-main.pl or config.pl or any other cgi-bin scripts that came with Asterisk, I get a 500 error: Premature End of Script Header. I've tried changing the chmod to -x or 755 and also have included the header required to display the html script. However, no luck. I am able to run it in command line, but not through the Mozilla browser. Is this enough information I've provided? You can contact me directly if you need more information. The error message means that your your script has returned an error status, IIRC. Its standard error goes to /var/log/httpd/error_log in the default RH9 config. Use less, tail or tail -f to get the relevant error message (hint: press shift-G in less to jump to the end). -- Tzafrir Cohen +---+ http://www.technion.ac.il/~tzafrir/ |vim is a mutt's best friend| mailto:[EMAIL PROTECTED] +---+ ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
RE: [Asterisk-Users] Help Running am-main.pl Perl/CGI on Apache Server
I had the same problem -- make sure these three lines are at the beginning of each of your .pl's (right after the comment section): use CGI; my $q = CGI-new(); print $q-header(); That fixed it for me. Jim Shilliday IT Director Equal Justice Center 1315 Walnut St. Suite 400 Philadelphia PA 19107 215-238-6970 -Original Message- From: Shekhar Prasad [mailto:[EMAIL PROTECTED] Sent: Saturday, September 04, 2004 2:19 PM To: [EMAIL PROTECTED] Cc: Taemoor Abbasi Subject: [Asterisk-Users] Help Running am-main.pl Perl/CGI on Apache Server Hi all, I've installed Asterisk on Linux Red Had 9. Now, I was trying to set up a GUI based system for the PBX. I downloaded some packages, but I have to have Perl running CGI scripts through the webserver. It does not allow me to. I am able to run a basic script that just just prints out html messages and nothing else. However, when I try to run am-main.pl or config.pl or any other cgi-bin scripts that came with Asterisk, I get a 500 error: Premature End of Script Header. I've tried changing the chmod to -x or 755 and also have included the header required to display the html script. However, no luck. I am able to run it in command line, but not through the Mozilla browser. Is this enough information I've provided? You can contact me directly if you need more information. shekhar . prasad at gmail . com shekhar ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users