我正在尝试创建一个用于安装Wordpress的食谱。一切似乎都没问题,除了在参观视线时我得到403错误。 $PYTHONHOME
You don't have permission to access / on this server.
include_recipe 'wp::httpd'
include_recipe 'mariadb'
# include_recipe 'wp::mysql'
include_recipe 'wp::wordpress'
directory(node[:wp][:app_root])
web_app(node[:wp][:app_name]) do
server_name(node[:wp][:server_name])
docroot(node[:wp][:app_root])
template('vhost.conf.erb')
end
ruby_block 'install_wordpress' do
block do
require 'fileutils'
FileUtils.cd node[:wp][:app_root]
system 'wget https://wordpress.org/latest.tar.gz'
system 'tar -xzf latest.tar.gz --strip-components=1 && rm latest.tar.gz'
end
not_if { ::File.exist?(File.join(node[:wp][:app_root], 'wp-settings.php')) }
action :create
end
template("#{node[:wp][:app_root]}/wp-config.php") do
source('wp-config.php.erb')
variables(
db_name: node[:wp][:app_name],
db_user: node[:wp][:app_name],
db_password: node[:wp][:db_password]
)
end
execute 'set_apache_as_owner' do
command "chown #{node['apache']['user']} -R #{node[:wp][:app_root]}"
end
答案 0 :(得分:1)
您需要一些authz行才能访问docroot。通常在Apache 2.4的Require all granted
块中为Directory
。