Setting and 'index page' in a cgi-bin directory

Discussion in 'Linux VPS/Dedicated - General' started by Dandello, Sep 22, 2013.

  1. Dandello

    Dandello New Member

    I've tried adding 'DirectoryIndex index.pl' in the htaccess file in 'cgi-bin/yabb2' but I'm still getting a 'forbidden' when I try to access something on the order of test254.yabbforumsoftware.com/cgi-bin/yabb2' . What am I missing?
     
  2. Dan

    Dan Moderator

    Hi Dandello,

    What does it say in the Apache error log? My guess is that it will be a premature end of script headers message. Did you put the perl shebang in the file? Something like this: '#!/usr/bin/perl -w'.

    Not that I have experience in this lol but that's what a Google search turned up and from the forbidden error that's what it sounds like.
     
  3. Dandello

    Dandello New Member

    I just get a 403 - forbidden. It doesn't go to the assigned index page at all. (A 500 error would at least indicate it found a script and when that Perl script is called by a direct link, it works fine. The actual assigned index is YaBB.pl but I didn't want to post that as we have spammer issues on top of everything else.) ''DirectoryIndex YaBB.pl' (But the fact that you got a 500 on something gives me something to check.)

    Edited: Nope - index.html throws a 500 error when called from the cgi-bin. So how do I get index.html to render?
     
    Last edited: Sep 23, 2013
  4. KH-Mathew

    KH-Mathew Systems Administration Staff Member

    Hi Dandello,

    Check your directory and file permissions as well as file ownership. Also, what do the global and custom (if enabled) Apache logs say about it?
     
    Last edited: Oct 22, 2013
  5. Dandello

    Dandello New Member

    Okay - the error in the errorlog is :
    Code:
    [Mon Sep 23 11:53:38 2013] [error] [client xx.xx.xxx.x] attempt to invoke directory as script: /home/yabber/public_html/yabb254/cgi-bin/yabb2/
    Which tells me that the 'DirectoryIndex' parameter in htaccess in that directory isn't being invoked at all. What am I doing wrong? (And where should I look to fix it?)

    What's in the htaccess is
    Code:
    DirectoryIndex YaBB.pl index.html
    Options -Indexes
     
  6. KH-Dmitry

    KH-Dmitry Administrator Staff Member

    1) Does .htaccess in the cgi-bin directory allow going into subdirectories? maybe some rewrite rules or permissions don't?
    2) Does apache allow overrides for cgi-bin/yabb2 directory?
    3) Shouldn't you have at least +ExecCGI in the cgi-bin/yabb2/.htaccess file? Perhaps a handler for perl files as well?
     
  7. Dandello

    Dandello New Member

    I honestly have no idea on any of those questions. I know, aside from doing some .htaccess edits for redirects, I haven't changed much from what comes standard with theVPS2 package. (Added some accounts, added some Perl Modules.)

    I figure I don't need to add +ExecCGI to the .htaccess file in that sub-directory since I know for a fact that my Perl scripts are running fine. I'm now guessing I'll have to ask support.
     
  8. Dandello

    Dandello New Member

    Did a bit more research. I think the issue has to do with suexec not permitting 'web' access so .html files aren't recognized or accessed when in the cgi-bin. Maybe.
     
  9. Dan

    Dan Moderator

    Hi Dandello,

    You never said anything about html files in the cgi-bin. You would be correct in that they can't be in there. You can make calls to them in other directories in a script file though of course.
     

Share This Page