Revisit: perl CGIs with suphp

Discussion in 'Installation/Configuration' started by zetnsh, Jan 18, 2008.

  1. zetnsh

    zetnsh New Member

    Hi there,

    I was looking for the answer months ago, never found it, and it was never really an issue then :)

    I have successfully installed suphp with ISPConfig which works fine, PHP scripts run as the website user rather than apache user, but I always came unstuck getting it to run CGI's -I just don't know where to start with the apache config etc.

    Here is /etc/suphp.conf:
    ;Path to logfile
    ;User Apache is running as
    ;Path all scripts have to be in
    ;Path to chroot() to before executing script
    ;Security options
    ;Check wheter script is within DOCUMENT_ROOT
    ;Send minor error messages to browser
    ;PATH environment variable
    ;Umask to set, specify in octal notation
    Here is /etc/httpd/conf.d/suphp.conf:

    LoadModule suphp_module modules/
    And finally attached as a .txt file is httpd.conf (overkill probably - I know!)

    Any thoughts would be much appreciated!


    Attached Files:

  2. Hans

    Hans Moderator ISPConfig Developer

    Did you enable "CGI Scripts" and/or "Standard CGI Scripts"
    on the basis tab within ISPConfig for that website?

    The cgi-scripts must be placed within the folder "cgi-bin" or "bin" within the webspace of your website.
  3. zetnsh

    zetnsh New Member

    Hi Hans, thanks for responding!

    Yes, CGI Scripts was ticked.

    The CGI scripts are in a folder called cgi-bin on the same level as the web directory for that user. They all work fine, it's just they don't run as the user of the web!

    I've just run this perl test script:

    print "Content-type: text/html\n\n$< $>\n";
    This tells me the user the script is running as (and in fact the user it would be running as if it was setuid which it isn't).

    This comes back with

    48   48
    which is the uid of the apache user on my system.

    Any other thoughts anyone?


  4. Hans

    Hans Moderator ISPConfig Developer

    Did you create an admin user for that website?
    If you have created an admin user for that website, your cgi scripts should run automaticly under that admin user.
  5. zetnsh

    zetnsh New Member

    Bear in mind this is perl not php (did I explain that?). The PHP side is working correctly, it's just Perl CGI's that are the problem.

    Yes, there is an admin user set up, the same one that owns the files!

    Any thoughts?


  6. Hans

    Hans Moderator ISPConfig Developer

  7. zetnsh

    zetnsh New Member

    Just to confirm on this, here is my test CGI program written in perl:

    [[email protected] cgi-bin]# ls -al /var/www/web1/cgi-bin/testperm.cgi
    -rwxr-xr-x 1 web1_historydirect web1 59 Jan 18 16:01 /var/www/web1/cgi-bin/testperm.cgi
    That seems to look right with what you told me...

    Thanks again,


Share This Page