1

我需要帮助解决我要访问时得到 404 的 awstats 问题awstats/awstats.pl。下面是当前awstats.conf文件。

Alias /awstatsclasses "/usr/share/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/share/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-bin/"

<Directory "/usr/share/awstats/wwwroot">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<Directory "/usr/share/awstats/wwwroot/cgi-bin/">
    DirectoryIndex awstats.pl
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
    PerlOptions +ParseHeaders
    Options +ExecCGI
</Directory>

# Additional Perl modules
<IfModule mod_env.c>
    SetEnv PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins
</IfModule>


这是在我的 apache2 中运行的当前模块。

Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
actions_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_groupfile_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cgid_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
headers_module (shared)
limitipconn_module (shared)
log_config_module (shared)
logio_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
perl_module (shared)
rewrite_module (shared)
setenvif_module (shared)
status_module (shared)
systemd_module (shared)
unixd_module (shared)
php5_module (shared)


这就是我的access.log

"GET /awstats/awstats.pl HTTP/1.1" 404 216 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36"

我试图用谷歌搜索可能的解决方案,但不幸的是得到了同样的错误。

我真的需要你们的帮助:(非常感谢那些可以帮助我解决这个错误的人,我被困在这部分了。

这是我的 awstats 厨师食谱

include_recipe "yum-epel"
include_recipe "awstats"

%w(apachetraffic).each do |rule|
    iptables_rule rule do
        action :enable
    end
end

%w(awstats perl-Geo-IP).each do |pkg|
    package "#{pkg}" do
        action [:install]
    end
end

directory "#{node['awstats']['db_dir']}" do
  action :create
end

template "#{node['apache']['dir']}/conf.d/awstats.conf" do
  source "awstats/awstats.conf.erb"
    owner "root"
    group "root"
    mode 0644
    notifies :restart, 'service[apache2]', :delayed
end

# template "#{node['apache']['dir']}/conf-available/awstats.conf" do
#   source "awstats/awstats.conf.erb"
#   owner "root"
#   group "root"
#   mode 0644
#   notifies :restart, 'service[apache2]', :delayed
# end

template "#{node['awstats']['config_dir']}/awstats.#{node['awstats'] ['http_config']}.conf" do
    source "awstats/awstats.http.erb"
    owner "root"
    group "root"
    mode 0644
    variables(
        :logfile => node["awstats"]["logfile"],
        :site_domain => node["awstats"]["site_domain"],
        :db_dir => node["awstats"]["db_dir"],
        :geo_ip_dir => node["awstats"]["geo_ip_dir"]
    )
    notifies :restart, 'service[apache2]', :delayed
end

if node["awstats"]["has_ftp"]
    template "#{node['awstats']['config_dir']}/awstats.#{node['awstats']['ftp_config']}.conf" do
        source "awstats/awstats.ftp.erb"
        owner "root"
        group "root"
        mode 0644
        variables(
            :logfile => '/var/log/xferlog',
            :site_domain => node["awstats"]["site_domain"],
            :db_dir => node["awstats"]["db_dir"],
            :geo_ip_dir => node["awstats"]["geo_ip_dir"]
        )
        notifies :restart, 'service[apache2]', :delayed
    end
end
4

1 回答 1

-1

我的队友解决了这个问题,这完全是关于 apache status_allow_list 的。:) 感谢大家尝试解决这个问题。再会。:)

于 2016-12-06T10:38:07.023 回答