Hey, Unix heads... I need help

drastik

macrumors 6502a
Original poster
Apr 10, 2002
978
0
Nashvegas
I am trying to set up a discussion board using my machine for hosting. I think I have all of the file paths right, but when I try to bing up the page, I just get the text of the script. In the terminal, if I try to run teh script from the command line, I get permission denied. When I try to chmod a+x to the file, it cycles to the command line again and still won't let me execute. I'm confused about where my Perl interpeter is, but I currently have it set to /system/library/perl/cgi

Any deas out there? I really don't know my way around Unix, and I'm pulling my hair here:(
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,111
0
San Diego, CA
Type "which perl" in the command line to see the path to where perl is installed, mine's in /usr/bin/

Double check your permission on your files if you're getting a permission denied error. You may have to use sudo to apply chmod to all of the files.

===CAUTION: Obligatory Warning===
Don't run any commands via sudo or su if you're not sure what you're doing.
 

drastik

macrumors 6502a
Original poster
Apr 10, 2002
978
0
Nashvegas
Thanks Rower, but I'm still not sure whats going on. heres the script, minus some of the remarks.

#!/usr/bin
############################################

## ##

## WebBBS ##

## by Darryl Burgdorf ##

## (e-mail burgdorf@awsd.com) ##

## ##

## version: 5.01 ##

## last modified: 6/27/02 ##

## copyright (c) 2002 ##

## ##

## latest version is available from ##

## http://awsd.com/scripts/ ##

## ##

############################################



# COPYRIGHT NOTICE:

#

# -------------
#################################################

## Define your forum's configuration settings! ##

#################################################



## (1) Specify the location of your webbbs_settings.pl script:



require "Library/WebServer/cgi-bin/webbbs_settings.pl

## (2) Locate the files and directories unique to this forum:



$dir = "Library/WebServer/Documents/FCP3";

$cgiurl = "http://xx.xx.xxx.xx/FCP3/webbbs_config.pl";



$boardname = "Final Cut Pro 3";

$shortboardname = "FCP3";



## (3) Define variables you want changed from webbbs_settings.pl:



#############################################

## Do NOT change anything in this section! ##

#############################################



require $webbbs_text;

require $webbbs_basic;



&Startup;

&WebBBS;
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,111
0
San Diego, CA
A couple questions:

## (1) Specify the location of your webbbs_settings.pl script:

require "Library/WebServer/cgi-bin/webbbs_settings.pl
Did you rename the "CGI-Executables" folder to "cgi-bin"? If not, that path probably won't work. As far as I understand it, cgi-bin only maps to the CGI-Executables when accessed through a browser.

$cgiurl = "http://xx.xx.xxx.xx/FCP3/webbbs_config.pl";
Same thing here...any perl scripts should be kept in cgi-bin/CGI-Executables, so check your path.

Am I on the right track?
 

drastik

macrumors 6502a
Original poster
Apr 10, 2002
978
0
Nashvegas
okay, so I set it all back to CGi-Executables, but now i can't call up the script in the browser, do I need to link to it from HTML? Or shold I move the CGI folder into the Documents folder (active folder at my IP)?
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,111
0
San Diego, CA
Let me try to clarify.

Anything that will be accessed locally should use the CGI-Executables name for its path.

Anything that the browser window calls needs to use cgi-bin instead.

So, anything going /Library/WebServer/... needs to use CGI-Executables. Anything using http://myserver.com/... needs to use cgi-bin.

Check?
 

drastik

macrumors 6502a
Original poster
Apr 10, 2002
978
0
Nashvegas
got it, I figured that part out when I reread your post, sorry to not notice before. Now at least I'm geting an error message, and my cgi-bin (from the browser) is listed Forbidden, so Now I have a permissions problem
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,111
0
San Diego, CA
Double-check any documentation for the BB, as far as permissions they suggest you use.

As long as the www user/everybody has read and execute permissions, you should be set.
 

drastik

macrumors 6502a
Original poster
Apr 10, 2002
978
0
Nashvegas
I can't seem to set the permisions. Im in terminal typing in

chmod 755 filename

and it gives me operation not permitted

I'm not sre about sudo, hate to mess somehting up
edit: changes 775 to 755
 

balliet

macrumors member
Dec 21, 2001
68
0
Maybe this was a typo, but above you have:

#!/usr/bin

That should be #!/usr/bin/perl
 

drastik

macrumors 6502a
Original poster
Apr 10, 2002
978
0
Nashvegas
Alright, I'll brave it, how do i do the sudo thing? If i just change the permissions, it'll be allright, right
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,111
0
San Diego, CA
Originally posted by drastik
I can't seem to set the permisions. Im in terminal typing in

chmod 755 filename

and it gives me operation not permitted

I'm not sre about sudo, hate to mess somehting up
edit: changes 775 to 755
Type in ls -la to see who the owner and group are set to. Mine is root and admin group, and it should be 775 by default.

sudo allows you to use your own password to "pretend" to be root for a certain amount of time. So, if you type "sudo chmod 775 filename" you will be prompted for your password. Once you type it in the command will be executed as root.

[edit: Even permissions can royally mess things up if you change them inside /System or any of the "invisible" system folders. Messing around in /Library won't be too bad, but might mess up some prefs for apps. As always, be careful.]
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,111
0
San Diego, CA
Do you have Apache configured to handle perl scripts?

You might need to modify the Apache config file.../etc/httpd/httpd.conf in order to enable perl.

We're making headway.:)
 

gbojim

macrumors 6502
Jan 30, 2002
353
0
If you are getting an internal server error, Apache is running the script but the script is failing for some reason. The Apache error log should give you a listing of the error message.

I don't have a Mac handy and I can't remember the path to the error log off the top of my head, but try the command:

tail /var/log/httpd/error_log

If I have the path correct, you will get the last 10 lines of the error log and there should be a line or 2 that describes what script was running when the error occurred and what line the error occurred on. If you have a path wrong and a file cannot be found - this should tell you where the error is.
 

gbojim

macrumors 6502
Jan 30, 2002
353
0
If you are getting an internal server error, Apache is running the script but the script is failing for some reason. The Apache error log should give you a listing of the error message.

I don't have a Mac handy and I can't remember the path to the error log off the top of my head, but try the command:

tail /var/log/httpd/error_log

If I have the path correct, you will get the last 10 lines of the error log and there should be a line or 2 that describes what script was running when the error occurred and what line the error occurred on. If you have a path wrong and a file cannot be found - this should tell you where the error is.
 

this28

macrumors newbie
Jul 31, 2002
3
0
Minnesota
what is the Internal Error?

what is the exact wording of the internal error?
given the what that error says, we could give you some more help.

or
try running the command form the command line and giving the output that it gives back. If it doesn't give anything back and just sort of hangs, hit <ctrl>+<d> and see if it kicks out any HTML at you...