Skip to content

Instantly share code, notes, and snippets.

@msound
Created May 12, 2015 19:48
Show Gist options
  • Save msound/fd72de7ff5f30c89cada to your computer and use it in GitHub Desktop.
Save msound/fd72de7ff5f30c89cada to your computer and use it in GitHub Desktop.
Running apache as vagrant
ruby_block "Run apache as vagrant user" do
block do
fe = Chef::Util::FileEdit.new("/etc/apache2/envvars")
fe.search_file_replace(/www-data/, 'vagrant')
fe.write_file
end
only_if "grep 'www-data' /etc/apache2/envvars"
notifies :restart, 'service[apache2]', :delayed
end
directory "/var/lock/apache2" do
owner 'vagrant'
group 'root'
mode 0755
action :create
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment