Hey, Unix heads... I need help

Discussion in 'Mac Help/Tips' started by drastik, Jul 30, 2002.

  1. drastik macrumors 6502a

    drastik

    Joined:
    Apr 10, 2002
    Location:
    Nashvegas
    #1
    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:(
     
  2. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #2
    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.
     
  3. drastik thread starter macrumors 6502a

    drastik

    Joined:
    Apr 10, 2002
    Location:
    Nashvegas
    #3
    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;
     
  4. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #4
    A couple questions:

    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.

    Same thing here...any perl scripts should be kept in cgi-bin/CGI-Executables, so check your path.

    Am I on the right track?
     
  5. drastik thread starter macrumors 6502a

    drastik

    Joined:
    Apr 10, 2002
    Location:
    Nashvegas
    #5
    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)?
     
  6. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #6
    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?
     
  7. drastik thread starter macrumors 6502a

    drastik

    Joined:
    Apr 10, 2002
    Location:
    Nashvegas
    #7
    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
     
  8. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #8
    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.
     
  9. drastik thread starter macrumors 6502a

    drastik

    Joined:
    Apr 10, 2002
    Location:
    Nashvegas
    #9
    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
     
  10. balliet macrumors member

    Joined:
    Dec 21, 2001
    #10
    Maybe this was a typo, but above you have:

    #!/usr/bin

    That should be #!/usr/bin/perl
     
  11. drastik thread starter macrumors 6502a

    drastik

    Joined:
    Apr 10, 2002
    Location:
    Nashvegas
    #11
    Alright, I'll brave it, how do i do the sudo thing? If i just change the permissions, it'll be allright, right
     
  12. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #12
    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.]
     
  13. drastik thread starter macrumors 6502a

    drastik

    Joined:
    Apr 10, 2002
    Location:
    Nashvegas
    #13
    do i have to do it one file at a time, or can I do the directory?
     
  14. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #14
    "chmod -R xxx foldername" will recursively change the permission for everything within a folder.
     
  15. drastik thread starter macrumors 6502a

    drastik

    Joined:
    Apr 10, 2002
    Location:
    Nashvegas
    #15
    well, now Im getting an internal server error, thanks for the help though
     
  16. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #16
    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.:)
     
  17. gbojim macrumors 6502

    Joined:
    Jan 30, 2002
    #17
    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.
     
  18. gbojim macrumors 6502

    Joined:
    Jan 30, 2002
    #18
    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.
     
  19. gbojim macrumors 6502

    Joined:
    Jan 30, 2002
  20. this28 macrumors newbie

    Joined:
    Jul 31, 2002
    Location:
    Minnesota
    #20
    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...
     

Share This Page