Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > perl cgi on Jaguar

perl cgi on Jaguar
Thread Tools
absmiths
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Mar 18, 2004, 02:42 AM
 
I know this has probably been covered before, but I can't seem to find it in a search. How do I deploy perl scripts to the Mac OS X apache server? I am trying to install YaBB and have copied all the necessary cgi files to /Library/WebServer/CGI-Executables, and the static content into /Library/WebServer/Documents. I did all the chmod's as they suggested, and uncommented the LoadModule perl stuff in httpd.conf. After restarting the web server I get error 500 when I try to load the YaBB.pl script through http://host/cgi-bin/yabb/YaBB.pl. The apache error log says:

Code:
[Thu Mar 18 00:31:39 2004] [error] (2)No such file or directory: exec of /Library/WebServer/CGI-Executables/yabb/YaBB.pl failed [Thu Mar 18 00:31:39 2004] [error] [client 192.168.1.44] Premature end of script headers: /Library/WebServer/CGI-Executables/yabb/YaBB.pl
I ran perl -wc YaBB.pl and got this output:

Code:
[x:/Library/WebServer/CGI-Executables/yabb] perl -wc YaBB.pl Name "main::language" used only once: possible typo at YaBB.pl line 33. Name "main::yyIIS" used only once: possible typo at YaBB.pl line 23. Name "main::username" used only once: possible typo at YaBB.pl line 57. Name "main::guestaccess" used only once: possible typo at YaBB.pl line 57. Name "main::settings" used only once: possible typo at YaBB.pl line 55. Name "main::YaBBversion" used only once: possible typo at YaBB.pl line 19. Name "main::YaBBplver" used only once: possible typo at YaBB.pl line 20. YaBB.pl syntax OK
I can't seem to make any more headway. Are there any suggestions?
     
tmornini
Junior Member
Join Date: Feb 2001
Location: Folsom, CA USA
Status: Offline
Reply With Quote
Mar 18, 2004, 03:04 AM
 
Hmmm. That error means that Apache is not happy with the headers that the CGI is generating.

What happens when you actually execute the perl program?

Post that output, and let's see what we'll see!

This could *easily* be a permissions problem. I seem to remember that YaBB needs an area to write files into. If this is the case, does the user that Apache runs as (not sure right now) have write permissions on the areas that it needs to read and write from?
--
-- Tom Mornini
     
absmiths  (op)
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Mar 18, 2004, 03:25 AM
 
This is what I get when I execute the YaBB.pl script as root:

Code:
[x:~] sudo perl /Library/WebServer/CGI-Executables/yabb/YaBB.pl Password: Can't locate Settings.pl in @INC (@INC contains: /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl /Network/Library/Perl .) at /Library/WebServer/CGI-Executables/yabb/YaBB.pl line 32.
The settings file is in the same directory - I wonder why there is a problem? I chowned all the files to root:admin because I didn't know what else to make them.
     
absmiths  (op)
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Mar 18, 2004, 03:31 AM
 
I seemed to get a step farther. I went into the YaBB.pl script and hard-coded the absolute paths to the Settings and language files and that at least got it to start. I don't know if it is fully functional yet, but we will see.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Mar 18, 2004, 08:44 PM
 
Make sure you don't use a text editor that generates unwanted line feeds (such as pico), or you'll mess up the script.
     
absmiths  (op)
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Mar 19, 2004, 12:24 AM
 
Originally posted by besson3c:
Make sure you don't use a text editor that generates unwanted line feeds (such as pico), or you'll mess up the script.
Pico is really irritating that way - but not enough to make me suffer with vi just yet. I had to disable email verification because I couldn't find an SMTP server that I could use, but it seems to be working fine otherwise.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Mar 19, 2004, 12:29 AM
 
Originally posted by absmiths:
Pico is really irritating that way - but not enough to make me suffer with vi just yet. I had to disable email verification because I couldn't find an SMTP server that I could use, but it seems to be working fine otherwise.
It's pretty easy to enable sendmail and use your localhost as a SMTP server.

I suggest looking into emacs. Control X + Control S saves a file, Control X + Control C quits emacs, Control A moves to the beginning of a line, Control E moves to the end, Control K cuts a line. The latter 3 commands are pretty generic Unix shell commands.
     
absmiths  (op)
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Mar 20, 2004, 02:50 PM
 
Originally posted by besson3c:
It's pretty easy to enable sendmail and use your localhost as a SMTP server.

I suggest looking into emacs. Control X + Control S saves a file, Control X + Control C quits emacs, Control A moves to the beginning of a line, Control E moves to the end, Control K cuts a line. The latter 3 commands are pretty generic Unix shell commands.
I found another thread which gave the steps for enabling the local SMTP server, but that didn't do me any good since quite a few mail hosts required reverse DNS for it to work and so they wouldn't accept my mail.

I didn't want to, but I just disabled email registration for now.
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Mar 21, 2004, 09:28 PM
 
Originally posted by absmiths:
Pico is really irritating that way - but not enough to make me suffer with vi just yet. I had to disable email verification because I couldn't find an SMTP server that I could use, but it seems to be working fine otherwise.
pico -w should fix that
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 05:01 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,