如果您查看 httpd.conf,您可以看到“AllowOverride None”,我想将其更改为“AllowOverride All”,但可以通过下面的 Puppet list 来执行此操作。
我已经尝试使用“目录”进行此操作,但它不起作用。在此示例中将AllowOverride更改为All的正确方法是什么?
httpd.conf
# ************************************
# Vhost template in module puppetlabs-apache
# Managed by Puppet
# ************************************
<VirtualHost *:443>
ServerName test.example.com
## Vhost docroot
DocumentRoot "/var/www/html"
## Directories, there should at least be a declaration for /var/www/html
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
apache.pp
apache::vhost { 'test.example.com':
port => '443',
docroot => '/var/www/html',
ssl => true,
ssl_cert => "${ssl_base}/ssl.crt",
ssl_key => "${ssl_base}/ssl.key",
directories => [
{
'path' => '/var/www/html',
'options' => 'Indexes FollowSymLinks',
'allowoverride' => 'All',
},
],
}
}
最佳答案
根据给出的示例,您似乎需要使用“allow_override”而不是“allowoverride”或“override”。现在这将创建所需的虚拟主机文件。
apache.pp
apache::vhost { 'test.example.com':
port => '443',
docroot => '/var/www/html',
ssl => true,
ssl_cert => "${ssl_base}/ssl.crt",
ssl_key => "${ssl_base}/ssl.key",
directories => [
{
'path' => '/var/www/html',
'options' => 'Indexes FollowSymLinks',
'allow_override' => 'All',
},
],
}
}
关于apache - 如何通过 Puppet Manifest 在 Apache 中启用 AllowOverride?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44506168/