简体   繁体   English

如何使用puppet为apache设置documentroot?

[英]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.

相关问题 如何在Apache服务Plone中正确设置Documentroot - How to correctly set Documentroot in Apache serving Plone Apache2 reverseproxy-如何在服务器上设置DocumentRoot? - Apache2 reverseproxy - How to set a DocumentRoot on the server? 如何使用 Puppet 的 Apache 模块进行 Location/ProxyPass? - How do I do Location/ProxyPass with Puppet's Apache module? 在Apache的本地目录上设置DocumentRoot - Set DocumentRoot on local directory in apache 如何将其他DocumentRoot添加到我的Apache服务器? - How can I add an additional DocumentRoot to my Apache Server? 将apache documentRoot设置为符号链接(以便于部署) - Set apache documentRoot to symlink (for easy deployment) Apache:在 VirtualHost 部分中动态设置 DocumentRoot? - Apache: Dynamically set the DocumentRoot inside a VirtualHost section? 我到处寻找更改Apache上的DocumentRoot无济于事 - I looked everywhere to change DocumentRoot on Apache to no avail 安装 PHP、MySQL 和 Apache2 后,我在哪里可以找到 Ubuntu 上的 DocumentRoot? - Where do I find DocumentRoot on Ubuntu after installing PHP, MySQL and Apache2? 如何在Apache中将子目录请求动态映射到DocumentRoot - How to Dynamically Map Subdirectory Requests to DocumentRoot in Apache
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM