1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

How to install/configure suPHP on a RHEL 5.2 with Plesk 8.6

Discussion in 'Plesk for Linux - 8.x and Older' started by netaffairs, Nov 5, 2008.

  1. netaffairs

    netaffairs Guest

    0
     
    Hello,

    For the last days i'm trying to get suPHP to work on my server with RHEL 5.2 and Plesk 8.6. I installed the rpm mod_suphp-0.6.2-1.el5.rf.i386.rpm and configured the suphp.conf:
    ---------------------------------------
    /etc/suphp.conf:
    [global]
    logfile=/var/log/httpd/suphp_log
    loglevel=info
    webserver_user=apache
    docroot=/var/www/vhosts
    env_path=/bin:/usr/bin
    umask=0077
    min_uid=500
    min_gid=500

    ; Security options
    allow_file_group_writeable=false
    allow_file_others_writeable=false
    allow_directory_group_writeable=false
    allow_directory_others_writeable=false

    ;Check wheter script is within DOCUMENT_ROOT
    check_vhost_docroot=true

    ;Send minor error messages to browser
    errors_to_browser=true

    [handlers]
    ;Handler for php-scripts
    x-httpd-php=php:/usr/bin/php

    ;Handler for CGI-scripts
    x-suphp-cgi=execute:!self
    --------------------------------------------------

    /etc/httpd/conf.d/suphp.conf:
    # This is the Apache server configuration file providing suPHP support.
    # It contains the configuration directives to instruct the server how to
    # serve php pages while switching to the user context before rendering.

    LoadModule suphp_module modules/mod_suphp.so

    # This option tells mod_suphp if a PHP-script requested on this server (or
    # VirtualHost) should be run with the PHP-interpreter or returned to the
    # browser "as it is".
    suPHP_Engine on

    # Disable php when suphp is used, to avoid having both.
    <IfModule mod_php5.c>
    php_admin_flag engine on
    </IfModule>
    <IfModule mod_php4.c>
    php_admin_flag engine on
    </IfModule>

    # To use suPHP to parse PHP-Files
    AddHandler x-httpd-php .php
    AddHandler x-httpd-php .php .php4 .php3 .php5 .phtml

    # This option tells mod_suphp which path to pass on to the PHP-interpreter
    # (by setting the PHPRC environment variable).
    # Do *NOT* refer to a file but to the directory the file resides in.
    #
    # E.g.: If you want to use "/path/to/server/config/php.ini", use "suPHP_Config
    # /path/to/server/config".
    #
    # If you don't use this option, PHP will use its compiled in default path.
    suPHP_ConfigPath /etc

    # If you compiled suphp with setid-mode "force" or "paranoid", you can
    # specify the user- and groupname to run PHP-scripts with.
    # Example: suPHP_UserGroup foouser bargroup
    # suPHP_UserGroup apache apache psaserv
    suPHP_UserGroup logopediestart psacln

    # This option tells mod_suphp to handle requests with the type <mime-type>.
    # Please note this only works, if an action for the handler is specified
    # in the suPHP configuration file.
    suPHP_AddHandler x-httpd-php

    # This option tells mod_suphp to NOT handle requests with the type <mime-type>.
    # suPHP_RemoveHandler <mime-type>
    ---------------------------------------------------------

    I edited the httpd.conf and added the line:
    LoadModule suphp_module /usr/lib/httpd/modules/mod_suphp.so

    I rebooted the server but i still get a 500 internal server error. In the error log i see:
    Premature end of script headers: index.php

    I hope someone can help me out.

    Kind Regards,
    Wim
     
  2. xixi

    xixi Guest

    0
     
    Welcome

    I have similar problem. You need to use php-cgi, not default php-cli so in your /etc/suphp.conf just change:
    x-httpd-php=php:/usr/bin/php
    to:
    x-httpd-php=php:/usr/bin/php-cgi
     
  3. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    965
    Likes Received:
    32
    Location:
    Romania
  4. Nicola Agnelli

    Nicola Agnelli Guest

    0
     
    lvalics,
    'ive read your tutorial, but i'm not able to get suphp up and running .. i always get:

    500 Internal server Error
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    I'm on CentOS 5.2 .. what can i check ? How can i solve this ?

    Thank you so much
     
  5. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    965
    Likes Received:
    32
    Location:
    Romania
    I think in /etc/suphp.conf you missed to change the line

    [handlers]
    ;Handler for php-scripts
    php5-script=php:/usr/bin/php-cgi
     
  6. Nicola Agnelli

    Nicola Agnelli Guest

    0
     
    no it's correct, this is my suphp.conf

    cat /etc/suphp.conf
    [global]
    logfile=/var/log/httpd/suphp_log
    loglevel=warn
    webserver_user=apache
    docroot=/
    env_path=/bin:/usr/bin
    umask=0022
    min_uid=500
    min_gid=500

    ; Security options
    allow_file_group_writeable=false
    allow_file_others_writeable=false
    allow_directory_group_writeable=false
    allow_directory_others_writeable=false

    ;Check wheter script is within DOCUMENT_ROOT
    check_vhost_docroot=true

    ;Send minor error messages to browser
    errors_to_browser=false

    [handlers]
    ;Handler for php-scripts
    x-httpd-php=php:/usr/bin/php-cgi

    ;Handler for CGI-scripts
    x-suphp-cgi=execute:!self
     
  7. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    965
    Likes Received:
    32
    Location:
    Romania
    [handlers]
    ;Handler for php-scripts
    php5-script=php:/usr/bin/php-cgi
     
  8. Nicola Agnelli

    Nicola Agnelli Guest

    0
     
    sorry, my /etc/suphp.conf now:

    [global]
    logfile=/var/log/httpd/suphp_log
    loglevel=warn
    webserver_user=apache
    docroot=/
    env_path=/bin:/usr/bin
    umask=0022
    min_uid=500
    min_gid=500

    ; Security options
    allow_file_group_writeable=false
    allow_file_others_writeable=false
    allow_directory_group_writeable=false
    allow_directory_others_writeable=false

    ;Check wheter script is within DOCUMENT_ROOT
    check_vhost_docroot=true

    ;Send minor error messages to browser
    errors_to_browser=false

    [handlers]
    ;Handler for php-scripts
    php5-script=php:/usr/bin/php-cgi

    ;Handler for CGI-scripts
    x-suphp-cgi=execute:!self


    but i'm still having the same problem...
     
  9. MickP

    MickP Guest

    0
     
    Check your config file.
    Replace
    with
    Notice the addition of the " double quote marks.
    That fixed it for me on Centos 5.3 with php 5
    Hope that helps.

    Mick
    _lunix_
     
    Last edited by a moderator: Jul 20, 2009
  10. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    965
    Likes Received:
    32
    Location:
    Romania
    For PHP5 you need

    [handlers]
    ;Handler for php-scripts
    php5-script=php:/usr/bin/php-cgi

    Check your error log for errors.
     
Loading...