1

I am trying to set up suPHP on a centos 6.5 box with the puppetlabs/apache module.

Apache Configuration

file { "/var/www/vhosts":
        ensure => "directory",
        owner  => "root",
        group  => "root",
        mode   => 755,
    }

    class { '::apache':  
        require => File['/var/www/vhosts'],
    }

    include ::apache::mod::suphp

Vhosts Example

apache::vhost { $site:
    port            => '80',
    serveraliases   => [
        $root,
        "www.${site}",
        "development.${site}",
        "www.development.${site}",
    ],
    options => ['Indexes', 'FollowSymlinks'],
    suphp_engine        => 'on',
    suphp_addhandler    => 'x-httpd-suphp',
    suphp_configpath    => '/etc/httpd/conf.d/suphp.conf',
    directories         => { 
        path => "${_root}/${webroot}",
        'suphp' => { 
            user => $owner, 
            group => $group 
        },
    },
    override        => 'ALL',
    logroot         => "${_root}/${logroot}",
    docroot         => "${_root}/${webroot}",
    docroot_owner   => $owner,
    docroot_group   => $group,
}

When applying these mod_suphp couldnt be found so I installed and enabled rpm forge.

[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

I re run it and it installs but now I am getting a 500 internal server error on php pages.

The apache logs are showing this.

[Mon Dec 08 16:51:02 2014] [error] [client 192.168.50.1] SecurityException in Application.cpp:496: Handler not found in configuration
[Mon Dec 08 16:51:02 2014] [error] [client 192.168.50.1] Caused by KeyNotFoundException in Configuration.cpp:234: Handler "application/x-httpd-suphp" not found
[Mon Dec 08 16:51:02 2014] [error] [client 192.168.50.1] Premature end of script headers: index.php

The suphp logs are empty.

  • Have you investigated what the error messages are telling you? – Andrew Schulman Dec 9 '14 at 1:50
  • Yes but nothing I have found has been helpful. I am more of a developer than a sysadmin so i'm sure its something obvious but I cant find it. – Yamiko Dec 9 '14 at 2:22
0

Check to make sure that x-httpd-suphp in vhost definition matches the handler defined in /etc/httpd/conf.d/suphp.conf. For example:

application/x-httpd-suphp="php:/usr/bin/php-cgi"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.