位置: 编程技术 - 正文

linux Apache 环境下安装AWStatsWEB日志分析工具(linux apache2配置)

编辑:rootadmin
今天安装了awstats(AWStats是在Sourceforge上发展很快的一个基于Perl的WEB日志分析工具。),好好折腾了一把,终于搞完了,参考了不少资料,将主要步骤和遇到的问题分享一下。 1.在home下建一个目录awstats,cd /home/awstats 2.wget 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: > 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 总计 drwxr-xr-x 5 -- awstats-7.0 drwxr-xr-x 5 root root - : awstats-7.1 -rw-r--r-- 1 root root - : awstats-7.1.zip drwxr-xr-x 2 root root - : config drwxr-xr-x 4 root root - : docs -rw-r--r-- 1 root root - : README.TXT drwxr-xr-x 5 root root - : tools drwxr-xr-x 7 root root - : 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 总计 drwxr-xr-x 5 -- awstats-7.0 drwxr-xr-x 5 root root - : awstats-7.1 -rw-r--r-- 1 root root - : awstats-7.1.zip drwxr-xr-x 2 root root - : config drwxr-xr-x 4 root root - : docs -rw-r--r-- 1 root root - : README.TXT drwxr-xr-x 5 root root - : tools drwxr-xr-x 7 root root - : 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. $ - $Author: eldy $ - $Date: // :: $ #----------------------------------------------------------------------------- # 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 : since # %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 (-) # %Wy-n is replaced with the week number in year (-) # %DW-n is replaced with the day number in week (1-7, 1=sunday) # use n= if you need (1-7, 1=monday) # %Dw-n is replaced with the day number in week (0-6, 0=sunday) # use n= 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/system/LogFiles/W3SVC1/ex%YY-%MM-%DD-.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" L, C written [root@JMAppSer config]# chown -R root:root /usr/local/awstats [root@JMAppSer config]# chmod -R /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 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 data [root@JMAppSer awstats]# chmod /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 /usr/local/awstats mkdir /usr/local/awstats/data chown nobody.nobody /usr/local/awstats/data chmod data chmod /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.测试 遇到的问题: 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权限,赋.

推荐整理分享linux Apache 环境下安装AWStatsWEB日志分析工具(linux apache2配置),希望有所帮助,仅作参考,欢迎阅读内容。

linux Apache 环境下安装AWStatsWEB日志分析工具(linux apache2配置)

文章相关热门搜索词:linux apache版本,linux中的apache搭建,linux apache版本,linux apache配置文件,linux apache2,linux中的apache搭建,linux apache2,linux apache2,内容如对您有帮助,希望把文章链接给更多的朋友!

ubuntu. root的帐户启用方法 在网上看了半天,自已也没搞成,到后来搞成的时候恍然大悟,也来给菜鸟们分享一下经验原来很简单的,在系统-系统管理-》用户和组里把帐户类型

Ubuntu .下安装 Oracle Java分享教程 下面将给大家介绍如何在Ubuntu操作系统下如何安装Oracle的JavaRuntime和SDK。默认的Ubuntu安装完毕后,系统内会内置一个开源的JavaSE,还有OpenJDK(开放的Java开

Linux bond 网卡绑定配置教程 按照一下命令就可以配置成功,我是在vm8.0虚拟机上配置的1.创建bond网卡文件在/etc/sysconfig/network-scripts/目录下创建ifcfg-bond0命令:vi/etc/sysconfig/network-scrip

标签: linux apache2配置

本文链接地址:https://www.jiuchutong.com/biancheng/362054.html 转载请保留说明!

上一篇:利用openfiler实现iSCSI原理分析(openfiledialog怎么用)

下一篇:ubuntu10.04 root的帐户启用方法

  • 装卸费属于什么费用
  • 租地建厂房房产税谁交
  • 手机里面的发票在哪里
  • 代理费住宿费都包括什么
  • 代扣代缴个税对企业所得税的影响
  • 分公司独立核算的利弊
  • 税务机关六位地区编码是什么
  • 母子公司借款要交什么税
  • 印花税没有在我的待办里是不是就不用申报
  • 建筑业营改增前后区别
  • 预付房租摊销账务处理
  • 预缴增值税销售额
  • 广告公司对外捐赠的会计处理怎么做?
  • 总公司给分公司开发票
  • 税控盘全额抵减申报
  • 人力资源劳务费发票税率
  • 新企业如何办理税务登记
  • 行政单位财务长期挂账处理办法
  • 设备租赁公司购进设备怎么做账
  • 费用转利润分录怎么做?
  • 无形资产撤资要交税吗
  • 报税申报不了
  • 印花税滞纳金计入什么科目
  • 资本公积与股东借款
  • 如何计算工程预付款
  • 酒店招募
  • 出口货物免征增值税的有哪些
  • 增值税预缴税款表
  • 工地买东西怎么记账
  • window10开始菜单
  • 建筑公司小规模纳税人怎么做账报税
  • 研发阶段产品销售账务处理
  • 超市发购物卡给员工会计分录
  • 腾讯手游助手玩不了金铲铲
  • 招待费如何列支
  • 房地产会计工资一般多少
  • 为什么win+d
  • 蚊子咬了怎么消肿止痒最快红霉素软膏
  • 金枝玉叶怎么养才爆盆
  • 差额银行承兑汇票
  • 电风扇需要用完电再充吗
  • php的数据类型主要有哪几种
  • php批量替换
  • 给工程项目买保险是选哪个保险公司
  • php fgetcsv
  • 营改增企业所得税税率
  • ubuntu系统删除
  • 资产证券化会计处理案例
  • 暂估少了冲销时怎么办
  • 税控维护费可以抵企业所得税吗
  • 管理费用的核算内容主要包括哪些
  • 下列支出计入销售费用账户借方的是
  • 出售无形资产净损益
  • 零申报步骤
  • 其他债权投资如何计提减值
  • 收到国外客户的货款怎么做账
  • 开发票的销售收入正规的做账如何做?
  • 出差补贴算工资吗
  • 成本核算方法有哪几种
  • 会计入门技巧
  • mysql80安装配置教程
  • windows xp安装win32程序
  • 远程桌面修改默认端口
  • vmware虚拟机不能用桥接模式
  • windows系统后台不显示QQ等软件(任务栏右侧不显示QQ图标)
  • win7出现正在启动就不动了
  • ubuntu 无法正常启动
  • win7旗舰版显示器亮度调节
  • win7隐藏账户
  • linux系统fedora
  • Win7系统打开文件夹没有自动排列选项
  • 结构 类型
  • css透明属性详解怎么写
  • python urljoin
  • unity配置安卓sdk
  • node urlencode
  • javascript写html
  • node.js怎么用
  • 安卓中adapter
  • jquery点击方法
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设