View Full Version : Hey, Unix heads... I need help
drastik
Jul 30, 2002, 11:56 PM
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
Jul 31, 2002, 12:24 AM
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
Jul 31, 2002, 12:30 AM
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
Jul 31, 2002, 12:38 AM
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
Jul 31, 2002, 12:48 AM
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
Jul 31, 2002, 12:53 AM
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
Jul 31, 2002, 12:56 AM
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
Jul 31, 2002, 01:00 AM
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
Jul 31, 2002, 01:04 AM
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
Jul 31, 2002, 01:04 AM
Maybe this was a typo, but above you have:
#!/usr/bin
That should be #!/usr/bin/perl
drastik
Jul 31, 2002, 01:11 AM
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
Jul 31, 2002, 01:12 AM
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.]
drastik
Jul 31, 2002, 01:19 AM
do i have to do it one file at a time, or can I do the directory?
Rower_CPU
Jul 31, 2002, 01:22 AM
"chmod -R xxx foldername" will recursively change the permission for everything within a folder.
drastik
Jul 31, 2002, 01:47 AM
well, now Im getting an internal server error, thanks for the help though
Rower_CPU
Jul 31, 2002, 10:04 AM
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
Jul 31, 2002, 10:43 AM
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
Jul 31, 2002, 10:51 AM
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
Jul 31, 2002, 10:53 AM
Oops, sorry about the double post.
this28
Jul 31, 2002, 06:20 PM
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...
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.