1

I need help for my awstats problem I got 404 when I'm going to access awstats/awstats.pl. below is the current awstats.conf file.

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>


and this is the current module running in my 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)


and this is what I've got on my 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"

I tried to google the possible solution but unfortunately got the same error.

I really need your help guys :( thanks a lot for those who can help me with this error, I got stuck on this part.

this is my chef recipe for 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
chicks
  • 2,393
  • 3
  • 24
  • 40
  • Why the chef tag, this question is just apache related, if there's chef involved, give some details (show your recipe) ? (Did you restart apache after creating your config file ?) – Tensibai Dec 05 '16 at 09:50
  • yup there's chef involved. yup I already restart the apache after creating the configuration. below is my recipe for awstats. – Larry Borrero Dec 05 '16 at 10:24
  • @Tensibai I already attached the recipe. – Larry Borrero Dec 05 '16 at 10:29
  • Nothing in your apache error logs ? – Tensibai Dec 05 '16 at 10:37
  • this is my error logs [here](https://s3.amazonaws.com/uploads.hipchat.com/25779/912084/8OCeBJgLxi71Z1y/Screenshot%20from%202016-12-05%2018%3A48%3A54.png) – Larry Borrero Dec 05 '16 at 10:51
  • I'm not sure if one of those error is the cause why I got 404. – Larry Borrero Dec 05 '16 at 10:54
  • can you disable selinux just to make sure it is apache's problem and not a problem caused by selinux? – jsalatas Dec 06 '16 at 00:50
  • @jsalatas I already dis selinux but still the same issue, still got 404. I don't know what to do about this problem. – Larry Borrero Dec 06 '16 at 04:00
  • can you post again apache's error log? Just clear everything from the error log, restart apache, then try to visit the awstats url (you will get the 404 error) and then post the error log. – jsalatas Dec 06 '16 at 05:38
  • I got this error.log after clearing those logs and restart apache and browse again [here](https://s3.amazonaws.com/uploads.hipchat.com/25779/912084/102F26ehKSnvEBZ/Screenshot%20from%202016-12-06%2015%3A02%3A33.png) – Larry Borrero Dec 06 '16 at 07:05

1 Answers1

-1

My team mate solve this issue its all about apache status_allow_list. :) thanks guys for trying to solve this issue. Good day. :)