Shekhar Prasad
2004-Sep-04 11:18 UTC
[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
Shilliday, Jim
2004-Sep-04 12:35 UTC
[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:shekhar.prasad@gmail.com] Sent: Saturday, September 04, 2004 2:19 PM To: asterisk-users@lists.digium.com 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 Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Tzafrir Cohen
2004-Sep-05 17:20 UTC
[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:tzafrir@technion.ac.il +---------------------------+
Bill Seddon
2004-Sep-06 01:13 UTC
[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: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] 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:shekhar.prasad@gmail.com] Sent: Saturday, September 04, 2004 2:19 PM To: asterisk-users@lists.digium.com 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 Asterisk-Users@lists.digium.com 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 Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users