Last active
January 21, 2016 17:39
-
-
Save dragonmantank/6723460 to your computer and use it in GitHub Desktop.
Reset Apache httpd to run as the vagrant user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'], | |
} |
@dragonmantank: I had to tweak yours a bit before I got it working, but it works like a charm. Thanks again!
Win. Thanks!
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
@dragonmantank: I'm dropped this in my
manifests/default.pp
but I'm not getting any joy so far. Any gotchas I need to look out for?