Skip to content

Instantly share code, notes, and snippets.

@dragonmantank
Last active January 21, 2016 17:39
Show Gist options
  • Save dragonmantank/6723460 to your computer and use it in GitHub Desktop.
Save dragonmantank/6723460 to your computer and use it in GitHub Desktop.
Reset Apache httpd to run as the vagrant user
exec { "change_httpd_user":
command => "sed -i 's/www-data/vagrant/g' /etc/apache2/envvars",
onlyif => "/bin/grep -q 'www-data' '/etc/apache2/envvars'",
notify => Service['apache2'],
require => Package['apache2'],
}
file { "/var/lock/apache2":
ensure => "directory",
owner => "vagrant",
group => "vagrant",
require => Exec['change_httpd_user'],
}
@rdohms
Copy link

rdohms commented Dec 12, 2013

problem i get when apache restart is issued is: * There are processes named 'apache2' running which do not match your pid file which are left untouched in the name of safety, Please review the situation by hand.

ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment