在 puppet 中配置 apache 目录
Configuring apache directories in puppet
当我从 puppet 配置 apache 时,我进入 apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
我该如何改变它?我的主机在 /var/otherdir/,无法工作。
我的人偶初始化文件
class apache
{
package
{
"apache2":
ensure => present,
require => [Exec['apt-get update'], Package['php5'], Package['php5-dev'], Package['php5-cli']]
}
service
{
"apache2":
ensure => running,
enable => true,
require => Package['apache2'],
subscribe => [
File["/etc/apache2/mods-enabled/rewrite.load"],
File["/etc/apache2/sites-available/000-default.conf"],
File["/etc/apache2/conf-enabled/phpmyadmin.conf"]
],
}
file
{
"/etc/apache2/mods-enabled/rewrite.load":
ensure => link,
target => "/etc/apache2/mods-available/rewrite.load",
require => Package['apache2'],
}
file
{
"/etc/apache2/sites-available/000-default.conf":
ensure => present,
owner => root, group => root,
source => "/vagrant/puppet/templates/vhost",
require => Package['apache2'],
}
exec
{
'echo "ServerName localhost" | sudo tee /etc/apache2/conf-enabled/fqdn.conf':
require => Package['apache2'],
}
}
为 /etc/apache2/apache2.conf
添加一个需要软件包 Apache2
的文件部分
获得一个有效的 apache2.conf 并将其放入您的模块文件部分
当我从 puppet 配置 apache 时,我进入 apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
我该如何改变它?我的主机在 /var/otherdir/,无法工作。
我的人偶初始化文件
class apache
{
package
{
"apache2":
ensure => present,
require => [Exec['apt-get update'], Package['php5'], Package['php5-dev'], Package['php5-cli']]
}
service
{
"apache2":
ensure => running,
enable => true,
require => Package['apache2'],
subscribe => [
File["/etc/apache2/mods-enabled/rewrite.load"],
File["/etc/apache2/sites-available/000-default.conf"],
File["/etc/apache2/conf-enabled/phpmyadmin.conf"]
],
}
file
{
"/etc/apache2/mods-enabled/rewrite.load":
ensure => link,
target => "/etc/apache2/mods-available/rewrite.load",
require => Package['apache2'],
}
file
{
"/etc/apache2/sites-available/000-default.conf":
ensure => present,
owner => root, group => root,
source => "/vagrant/puppet/templates/vhost",
require => Package['apache2'],
}
exec
{
'echo "ServerName localhost" | sudo tee /etc/apache2/conf-enabled/fqdn.conf':
require => Package['apache2'],
}
}
为 /etc/apache2/apache2.conf
添加一个需要软件包 Apache2
获得一个有效的 apache2.conf 并将其放入您的模块文件部分