非手工編譯apache中awstats日誌分析管理
非手工編譯apache中awstats日誌分析管理
實驗環境:一臺linux6.5 宿主機或者虛擬win7
使用的包為awstats-7.6.tar
事先設置好域名以及DNS地址解析
博主的域名為www.abc.com
1、掛載移動
2、進行腳本的配置,有y的y,該回車的回車,需要填寫的內容如下
3、進入自動生成的文件中修改
4、創建目錄
5、登陸apache網頁以及日誌管理網頁,刷新awstats管理日誌
6、刷新awstats管理日誌後也刷新網頁
末:代碼腳本記錄
配置apache網站
設置dns地址解析
mkdir /opt/abc
mount.cifs //192.168.10.55/linuxbage /opt/abc /掛載
cd /opt/abc
tar zxf awstats-7.6.tar.gz -C /opt /解壓
cd /opt
mv awstats-7.6/ /usr/local/awstats 移動便於管理
cd /usr/local/awstats/tools /tools工具
./awstats_configure.pl /進入執行配置模式
---------------------------------1------------------------------------
Enter full config file path of your Web server.
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf //微軟案例
Config file path (‘none‘ to skip web server setup): 讓你創建配置文件路徑
/etc/httpd/conf/httpd.conf //linux下創建的apache路徑
---------------------------------2------------------------------------
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y 是否創建新的awstats配置文件
----------------------------------3-----------------------------------
Your web site, virtual server or profile name:
www.benet.com //輸入域名
--------------4--------------默認路徑不該 回車.........回車
http://www.abc.com/awstats/awstats.pl?config=www.abc.com 告訴你可以通過這個網址去訪問
=========================================================
cd /etc/awstats 配置文件路徑在
[root@redhat6-1 awstats]# ls
awstats.www.benet.com.conf //日誌文件路徑
[root@redhat6-1 awstats]# ls /var/log/httpd/
access_log error_log 復制access_log
LogFile="/var/log/httpd/access_log " //找到LogFile 粘貼access_log
DirData="/var/lib/awstats" //關註這個路徑下有沒有awstats文件 沒有就創建
cd /var/lib/
mkdir awstats 創建日誌文件
cd /usr/local/awstats/tools/
./awstats_updateall.pl now /更新檢測數據
crontab -e 做一個周期性任務 每五分鐘執行一次更新腳本
/5 * /etc/awstats/tools/awstats_updateall.pl now
service crond start 啟動周期性任務
====================================================
vim /etc/httpd/conf/httpd.conf
G到末行直接添加
修改此配置拒絕10網段登陸日誌監控
<Directory "/usr/local/awstats/wwwroot">
Options None
AllowOverride None
Order deny,allow 先拒絕再允許
deny from 192.168.10.0/24 拒絕一個網段
end..........
非手工編譯apache中awstats日誌分析管理