Apache Rendering 403错误

时间:2016-01-17 05:20:22

标签: php wordpress apache chef chef-solo

我正在尝试创建一个用于安装Wordpress的食谱。一切似乎都没问题,除了在参观视线时我得到403错误。 $PYTHONHOME

default.rb

You don't have permission to access / on this server.

httpd.rb

include_recipe 'wp::httpd'
include_recipe 'mariadb'
# include_recipe 'wp::mysql'
include_recipe 'wp::wordpress'

wordpress.rb

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

模板/默认/ vhost.conf.erb

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

1 个答案:

答案 0 :(得分:1)

您需要一些authz行才能访问docroot。通常在Apache 2.4的Require all granted块中为Directory