返回顶部
首页 > 资讯 > 操作系统 >linux Apache 环境下安装AWStatsWEB的步骤
  • 937
分享到

linux Apache 环境下安装AWStatsWEB的步骤

2023-06-13 04:06:50 937人浏览 泡泡鱼
摘要

这篇文章主要讲解了“linux Apache 环境下安装AWStatsWEB的步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“linux Apache 环境下安装AWStatsWEB的步骤

这篇文章主要讲解了“linux Apache 环境下安装AWStatsWEB的步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“linux Apache 环境下安装AWStatsWEB的步骤”吧!


1.在home下建一个目录awstats,cd /home/awstats
2.wget Http://awstats.sourceforge.net/files/awstats-7.0.tar.gz,下载awstats最新版本7.0
3.安装

代码如下:


[root@JMAppSer tools]# perl awstats_configure.pl
----- AWStats awstats_configure 1.0 (build 1.9) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).
-----> Running OS detected: Linux, BSD or Unix
-----> Check for web server install
Found Web server Apache config file '/usr/local/apache/conf/httpd.conf'
-----> Check and complete web server config file '/usr/local/apache/conf/httpd.conf'
Add 'Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"'
Add 'Alias /awstatsCSS "/usr/local/awstats/wwwroot/css/"'
Add 'Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"'
Add 'ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"'
Add '<Directory>' directive
AWStats directives added to Apache config file.
-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
File awstats.model.conf updated.
-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y
-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> www.b2bweb.co
-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
> /usr/local/awstats/config
-----> Create config file '/usr/local/awstats/config/awstats.www.b2bweb.co.conf'
Config file /usr/local/awstats/config/awstats.www.b2bweb.co.conf created.
-----> Restart Web server with '/sbin/service httpd restart'
Usage: /etc/init.d/httpd [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files
-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.b2bweb.co
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...
A SIMPLE config file has been created: /usr/local/awstats/config/awstats.www.b2bweb.co.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www.b2bweb.co' with command:
> perl awstats.pl -update -config=www.b2bweb.co
You can also read your statistics for 'www.b2bweb.co' with URL:
> http://localhost/awstats/awstats.pl?config=www.b2bweb.co
Press ENTER to finish...
[root@JMAppSer tools]# cp /usr/loca/awstats/wwwroot/icon /usr/local/apache/htdocs/awstatsicons -rf
cp: 无法 stat “/usr/loca/awstats/wwwroot/icon”: 没有那个文件或目录
[root@JMAppSer tools]#
[root@JMAppSer tools]#
[root@JMAppSer tools]# ls
awstats_buildstaticpages.pl awstats_exportlib.pl geoip_generator.pl logresolvemerge.pl Nginx webmin
awstats_configure.pl awstats_updateall.pl httpd_conf mailloGConvert.pl urlaliasbuilder.pl xslt
[root@JMAppSer tools]# cd ..
[root@JMAppSer awstats]# ls
awstats-7.0 awstats-7.1 awstats-7.1.zip config docs README.TXT tools wwwroot
[root@JMAppSer awstats]# ll
总计 1508
drwxr-xr-x 5 1000 1000 4096 2010-12-06 awstats-7.0
drwxr-xr-x 5 root root 4096 11-22 17:52 awstats-7.1
-rw-r--r-- 1 root root 1505352 11-22 18:02 awstats-7.1.zip
drwxr-xr-x 2 root root 4096 11-25 10:21 config
drwxr-xr-x 4 root root 4096 11-22 18:04 docs
-rw-r--r-- 1 root root 6787 11-22 18:04 README.TXT
drwxr-xr-x 5 root root 4096 11-22 18:04 tools
drwxr-xr-x 7 root root 4096 11-22 18:04 wwwroot
[root@JMAppSer awstats]# cd wwwroot/
[root@JMAppSer wwwroot]# ls
cgi-bin classes css icon js
[root@JMAppSer wwwroot]# cp icon/ /usr/local/jiemai/apache-blogs/htdocs/awstatsicons -rf
[root@JMAppSer wwwroot]#
[root@JMAppSer wwwroot]#
[root@JMAppSer wwwroot]# pwd
/usr/local/awstats/wwwroot
[root@JMAppSer wwwroot]# cd ..
[root@JMAppSer awstats]# ls
awstats-7.0 awstats-7.1 awstats-7.1.zip config docs README.TXT tools wwwroot
[root@JMAppSer awstats]# ls
awstats-7.0 awstats-7.1 awstats-7.1.zip config docs README.TXT tools wwwroot
[root@JMAppSer awstats]# ll
总计 1508
drwxr-xr-x 5 1000 1000 4096 2010-12-06 awstats-7.0
drwxr-xr-x 5 root root 4096 11-22 17:52 awstats-7.1
-rw-r--r-- 1 root root 1505352 11-22 18:02 awstats-7.1.zip
drwxr-xr-x 2 root root 4096 11-25 10:21 config
drwxr-xr-x 4 root root 4096 11-22 18:04 docs
-rw-r--r-- 1 root root 6787 11-22 18:04 README.TXT
drwxr-xr-x 5 root root 4096 11-22 18:04 tools
drwxr-xr-x 7 root root 4096 11-22 18:04 wwwroot
[root@JMAppSer awstats]# cd config/
[root@JMAppSer config]# ls
awstats.www.b2bweb.co.conf
[root@JMAppSer config]# vi awstats.www.b2bweb.co.conf
# AWSTATS CONFIGURE FILE 7.0
#-----------------------------------------------------------------------------
# Copy this file into awstats.www.mydomain.conf and edit this new config file
# to setup AWStats (See documentation in docs/ directory).
# The config file must be in /etc/awstats, /usr/local/etc/awstats or /etc (for
# Unix/Linux) or same directory than awstats.pl (windows, Mac, Unix/Linux...)
# To include an environment variable in any parameter (AWStats will replace
# it with its value when reading it), follow the example:
# Parameter="__ENVNAME__"
# Note that environment variable AWSTATS_CURRENT_CONFIG is always defined with
# the config value in an AWStats running session and can be used like others.
#-----------------------------------------------------------------------------
# $Revision: 1.353 $ - $Author: eldy $ - $Date: 2012/02/15 14:19:22 $
#-----------------------------------------------------------------------------
# MAIN SETUP SECTION (Required to make AWStats work)
#-----------------------------------------------------------------------------
# "LogFile" contains the web, ftp or mail server log file to analyze.
# Possible values: A full path, or a relative path from awstats.pl directory.
# Example: "/var/log/apache/access.log"
# Example: "../logs/mycombinedlog.log"
# You can also use tags in this filename if you need a dynamic file name
# depending on date or time (Replacement is made by AWStats at the beginning
# of its execution). This is available tags :
# %YYYY-n is replaced with 4 digits year we were n hours aGo
# %YY-n is replaced with 2 digits year we were n hours ago
# %MM-n is replaced with 2 digits month we were n hours ago
# %MO-n is replaced with 3 letters month we were n hours ago
# %DD-n is replaced with day we were n hours ago
# %HH-n is replaced with hour we were n hours ago
# %NS-n is replaced with number of seconds at 00:00 since 1970
# %WM-n is replaced with the week number in month (1-5)
# %Wm-n is replaced with the week number in month (0-4)
# %WY-n is replaced with the week number in year (01-52)
# %Wy-n is replaced with the week number in year (00-51)
# %DW-n is replaced with the day number in week (1-7, 1=sunday)
# use n=24 if you need (1-7, 1=monday)
# %Dw-n is replaced with the day number in week (0-6, 0=sunday)
# use n=24 if you need (0-6, 0=monday)
# Use 0 for n if you need current year, month, day, hour...
# Example: "/var/log/access_log.%YYYY-0%MM-0%DD-0.log"
# Example: "C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log"
# You can also use a pipe if log file come from a pipe :
# Example: "gzip -d </var/log/apache/access.log.gz |"
# If there are several log files from load balancing servers :
# Example: "/pathtotools/logresolvemerge.pl *.log |"
#
#LogFile="/var/log/httpd/mylog.log"
LogFile="/usr/local/jiemai/apache-blogs/logs/access_logs"
/DirData
# Note: Result of DNS Lookup can be used to build the Country report. However
# it is highly recommanded to enable the plugin 'geoip' or 'geoipfree' to
# have an accurate Country report with no need of DNS Lookup.
# Possible values:
# 0 - No DNS Lookup
# 1 - DNS Lookup is fully enabled
# 2 - DNS Lookup is made only from static DNS cache file (if it exists)
# Default: 2
DNSLookup=2
# When AWStats updates its statistics, it stores results of its analysis in
# files (AWStats database). All those files are written in the directory
# defined by the "DirData" parameter. Set this value to the directory where
# you want AWStats to save its database and working files into.
# Warning: If you want to be able to use the "AllowToUpdateStatsFromBrowser"
# feature (see later), you need "Write" permissions by web server user on this
# directory (and "Modify" for Windows NTFS file systems).
# Example: "/var/lib/awstats"
# Example: "../data"
# Example: "C:/awstats_data_dir"
# Default: "." (means same directory as awstats.pl)  
DirData="/usr/local/awstats/data"
# Relative or absolute web URL of your awstats cgi-bin directory.
# This parameter is used only when AWStats is run from command line
# with -output option (to generate links in HTML reported page).
# Example: "/awstats"
# Default: "/cgi-bin" (means awstats.pl is in "/yourwwwroot/cgi-bin")
#
DirCgi="/usr/local/awstats/wwwroot/cgi-bin"
/AllowToUpdateStatsFromBrowser
# When this parameter is set to 1, AWStats adds a button on report page to
# allow to "update" statistics from a web browser. Warning, when "update" is
# made from a browser, AWStats is run as a CGI by the web server user defined
# in your web server (user "nobody" by default with Apache, "IUSR_XXX" with
# IIS), so the "DirData" directory and all already existing history files
# awstatsMMYYYY[.xxx].txt must be writable by this user. Change permissions if
# necessary to "Read/Write" (and "Modify" for Windows NTFS file systems).
# Warning: Update process can be long so you might experience "time out"
# browser errors if you don't launch AWStats frequently enough.
# When set to 0, update is only made when AWStats is run from the command
# line interface (or a task scheduler).
# Possible values: 0 or 1
# Default: 0
#
AllowToUpdateStatsFromBrowser=1
# AWStats saves and sorts its database on a month basis (except if using
# databasebreak option from command line).
# However, if you choose the -month=all from command line or
# value '-Year-' from CGI combo fORM to have a report for all year, AWStats
# needs to reload all data for full year (each month), and sort them,
# requiring a large amount of time, memory and CPU. This might be a problem
# for web hosting providers that offer AWStats for large sites, on shared
# servers, to non CPU cautious customers.
# For this reason, the 'full year' is only enabled on Command Line by default.
# You can change this by setting this parameter to 0, 1, 2 or 3.
# Possible values:
# 0 - Never allowed
# 1 - Allowed on CLI only, -Year- value in combo is not visible
"awstats.www.b2bweb.co.conf" 1557L, 62015C written
[root@JMAppSer config]# chown -R root:root /usr/local/awstats
[root@JMAppSer config]# chmod -R 755 /usr/local/awstats
[root@JMAppSer config]# mkdir /usr/local/awstats/data
[root@JMAppSer config]# chown nobody.nobody /usr/local/awstats/data
[root@JMAppSer config]# chmod 777 data
chmod: 无法访问 “data”: 没有那个文件或目录
[root@JMAppSer config]# cd ..
[root@JMAppSer awstats]# ls
awstats-7.0 awstats-7.1 awstats-7.1.zip config data docs README.TXT tools wwwroot
[root@JMAppSer awstats]# chmod 777 data
[root@JMAppSer awstats]# chmod 755 /usr/local/awstats/wwwroot/cgi-bin/*.pl


tar zxf awstats-7.0.tar.gz
mv awstats-7.0 /usr/local/awstats
cd /usr/local/awstats/tools
perl awstats_configure.pl
在[y/N]提示时,输入y
Your web site, virtual server or profile name: 这时输入要被分析的域名
其他按<Enter>
Press ENTER to finish。。。完成安装
4.修改文件目录
cp /usr/loca/awstats/wwwroot/icon /usr/local/apache/htdocs/awstatsicons -rf
5.配置
vi /etc/awstats/awstats.上面输入的域名.conf
LogFile="/usr/local/apache/logs/access_logs"
DirData="/usr/local/awstats/data"
DirCgi="/usr/local/awstats/wwwroot/cgi-bin"
AllowToUpdateStatsFromBrowser=1
6.设置权限
chown -R root:root /usr/local/awstats
chmod -R 755 /usr/local/awstats
mkdir /usr/local/awstats/data
chown nobody.nobody /usr/local/awstats/data
chmod 777 data
chmod 755 /usr/local/awstats/wwwroot/cgi-bin/*.pl
7.生成分析日志与静态查看界面
cd /usr/local/awstats/wwwroot/cgi-bin
perl awstats.pl -config=上面域名 -update -lang=cn
perl awstats.pl -config=上面域名 -output -staticlinks -lang=cn>awstats.上面域名.html
8.测试 http://上面的域名/awstats/awstats.pl?config=上面的域名
遇到的问题
1.perl awstats.pl -config=上面域名 -update -lang=cn提示出错,或在测试时提示出错。LogFormat不正确:
原因:access_logs格式不正确,删除access_logs,重启APACHE。搞定
2.测试时看图片显示不了。
原因:/etc/awstats/awstats.上面输入的域名.conf中的DirIcons配置不正确,这个目录一定要从/usr/local/apache/htdocs目录开始算,相对目录,要确保配置的目录可能过http访问到
3.点击测试页面的“立即更新”时,提示"xxxx.tmp"无法存储

原因:/usr/local/awstats/data的权限不正确,需要使用nobody权限,赋777.

感谢各位的阅读,以上就是“linux Apache 环境下安装AWStatsWEB的步骤”的内容了,经过本文的学习后,相信大家对linux Apache 环境下安装AWStatsWEB的步骤这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是编程网,小编将为大家推送更多相关知识点的文章,欢迎关注!

--结束END--

本文标题: linux Apache 环境下安装AWStatsWEB的步骤

本文链接: https://lsjlt.com/news/265326.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
  • linux Apache 环境下安装AWStatsWEB的步骤
    这篇文章主要讲解了“linux Apache 环境下安装AWStatsWEB的步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“linux Apache 环境下安装AWStatsWEB的步骤...
    99+
    2023-06-13
  • Linux环境下Django的安装配置步骤
    本篇内容主要讲解“Linux环境下Django的安装配置步骤”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Linux环境下Django的安装配置步骤”吧!在Ubuntu 18.04上安装Djan...
    99+
    2023-06-16
  • Linux环境下安装MySQL8.0的完整步骤
    目录前言第一步:下载安装配置第二步:修改密码,并设置远程连接(为了可以在别的机器下面连接该mysql)总结前言 搞了一台云服务器,首先要干的活就是得安装数据库,在Windows下安装...
    99+
    2022-11-13
    linux安装mysql8.0的步骤和方法 linux下安装mysql linux安装mysql版本
  • Linux 环境下安装Oracle 11.2.0.4.0 详细步骤
    前言:   最近在学习oracle,这里我把安装和配置过程记录下来,按照我的这个方法一步一步基本上不会有问题,如果有问题可以留言大家探讨互相学习一下。安装环境和版本:系统版本:Redha...
    99+
    2024-04-02
  • mac下的nodejs环境安装的步骤
    说明 我们以brew的方式进行安装。 node安装 #我们安装时要附加参数,因为在新版中,默认的安装参数不会安装npm包管理器。 brew install node --with-npm #检查安装是否...
    99+
    2022-06-04
    步骤 环境 mac
  • linux环境下安装jdk和Tomcat详细步骤
    目录一、安装jdk手动安装 二、Tomcat一、安装jdk 注意:安装tomcat需要先配置jdk 一种是yum安装 一种是手动安装(个人推荐手动安装) 手动安装 1.去O...
    99+
    2024-04-02
  • Linux中Python 环境软件包安装步骤
    简介: 记录一下关于 Python 环境软件包的一些安装步骤 1、升级 Python 到 2.7.10( 默认 2.6.6 ) shell > yum -y install epel-releas...
    99+
    2022-06-04
    软件包 步骤 环境
  • linux安装apache的步骤是什么
    安装Apache Web服务器的步骤如下:1. 打开终端窗口。2. 使用以下命令安装Apache Web服务器:```sudo ap...
    99+
    2023-09-05
    linux apache
  • win10环境下python3.5安装步骤图文教程
    点我去Python官网下载 往下翻几页就能看到各种版本的Python,当前最新的是Python3.6,也没多大区别,我选择的是3.5.2 64位的,点击download 根据自己的电脑配置,我选择的是6...
    99+
    2022-06-04
    步骤 图文 环境
  • liunx环境下安装jdk和Tomcat详细步骤
    目录一、安装jdk手动安装二、Tomcat一、安装jdk 注意:安装tomcat需要先配置jdk 一种是yum安装 一种是手动安装(个人推荐手动安装) 手动安装 1.去Oracle官网下载需要安装的jdk版本,我这里用的...
    99+
    2022-06-04
    liunx安装jdk教程 linux安装Tomcat教程
  • Ubuntu环境下mongodb安装配置详细步骤
    1. 安装mongodb 1.1 安装依赖包 sudo apt-get install libcurl4 openssl 1.2 关闭和卸载原有的mongodb servi...
    99+
    2024-04-02
  • DKhadoop环境的安装配置步骤
    这篇文章主要讲解了“DKhadoop环境的安装配置步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“DKhadoop环境的安装配置步骤”吧!1.修改权限步骤...
    99+
    2024-04-02
  • Linux环境下mysql的安装
    1、环境准备 (1)卸载自带的Mariadb 命令:rpm –qa|grep mariadb  ---------查询已经安装的mariadb rpm –e –nodeps 文件名------------------卸载mariadb (...
    99+
    2019-03-30
    Linux环境下mysql的安装 数据库入门 数据库基础教程 数据库 mysql
  • linux下mysql的安装步骤
    1.mysql tar文件下载: https://dev.mysql.com/downloads/mysql/5.6.html#downloads 2.进入安装包所在目录 执行命令:tar mysql-5...
    99+
    2024-04-02
  • Linux下zabbix的安装步骤
    如果你需要安装zabbix的机器可以联网,那么你可以按照我下方的步骤来安装配置zabbix所需的环境。众所周知,在Linux下安装zabbix,所需的底层环境是LAMP=linux+apache+mysql...
    99+
    2024-04-02
  • Linux下安装MySQL5.7的步骤
    这篇文章主要讲解了“Linux下安装MySQL5.7的步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Linux下安装MySQL5.7的步骤”吧!本次将在...
    99+
    2024-04-02
  • Linux下MySQL5.1的安装步骤
    这篇文章主要讲解了“Linux下MySQL5.1的安装步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Linux下MySQL5.1的安装步骤”吧!Linu...
    99+
    2024-04-02
  • Linux下Python3.6的安装步骤
    这篇文章主要介绍“Linux下Python3.6的安装步骤”,在日常操作中,相信很多人在Linux下Python3.6的安装步骤问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Linux下Python3.6的安...
    99+
    2023-06-15
  • Linux安装PHP环境具体步骤是什么
    Linux安装PHP环境具体步骤是什么,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。PHP即“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发...
    99+
    2023-06-28
  • Linux环境下安装MongoDB
    下载安装包 下载地址:https://www.mongodb.com/download-center/community curl -O https://fastdl.mongodb.org/linux/mongodb-linux...
    99+
    2017-05-27
    Linux环境下安装MongoDB
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作