Question

I am using this Apache2 handling Puppet module

https://forge.puppetlabs.com/puppetlabs/apache

When I execute the following code, it successfully installs the virtual host, but it never enables the PHP5 module for Apache2. How do I enable it?

class { 'apache': 
    mpm_module => 'prefork',
}

apache::vhost { 'mysite':
    ...
    xyz
    ...
}

apache::mod { 'php5': }

I also tried to replace the line with:

apache::mod { 'php': }

but that didn't help. The php5 module doesn't get enabled. I have to enable it manually by running a2enmod php5. The documentation doesn't say much about this. Thanks!

Was it helpful?

Solution

according to the README, the apache::mod type should only be used for modules that do not have a specific apache::mod:: class. This is not true for PHP, see another part of the same README. Therefor, the correct manifest would be

include apache::mod::php

These semi-official Puppet Labs modules are generally a good resource.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top