[英]How do I set documentroot for apache with puppet?
I've been trying to get apache to serve from /vagrant/ using puppet through vagrant, my manifest looks like this: 我一直在尝试从/ vagrant /使用puppet到vagrant服务apache,我的清单看起来像这样:
class apache {
exec { 'apt-get update':
command => '/usr/bin/apt-get update'
}
package { "apache2":
ensure => present,
}
service { "apache2":
ensure => running,
require => Package["apache2"],
root => '/vagrant/'
}
}
I would really appreciate the help.... I'm stunned at how bad the manifest documentation is. 我真的很感激帮助......我对清单文档的糟糕程度感到震惊。
easier than changing the httpd.conf with templates etc, it's to make a symlink from /var/www to /vagrant. 比使用模板等更改httpd.conf更容易,它是从/ var / www到/ vagrant创建一个符号链接。 Add
加
file { '/var/www':
ensure => 'link',
target => '/vagrant',
force => true,
}
to your puppet file and you are running. 你的木偶文件,你正在运行。
The service
resource manages the process but doesn't have anything to do with the configuration files. service
资源管理进程,但与配置文件无关。 Your manifest simply says "Make sure that apt is updated, apache2 is installed and running". 您的清单只是说“确保apt已更新,apache2已安装并正在运行”。
I think what you are looking for can be handled with templates ( http://docs.puppetlabs.com/guides/templating.html ). 我认为你要找的东西可以用模板处理( http://docs.puppetlabs.com/guides/templating.html )。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.