Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
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):
Ø /opt/lampp/etc/httpd.conf #http.conf文件路径
—–> 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.test.cn#生成配置文件的名字
—–> 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):
>配置文件放置地址 默认即可
—–> 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.test.cn
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: /etc/awstats/awstats.www.test.cn.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for ‘www.test.cn’ with command:
> perl awstats.pl -update -config=www.test.cn
You can also read your statistics for ‘www.test.cn’ with URL:
> http://localhost/awstats/awstats.pl?config=www.test.cn
Press ENTER to finish…
回车结束
Configure.pl配置文件,会将:
CustomLog ……………………..common
改为
CustomLog ……………………..combined #实际上面我们已经更改过来,日志切割的时候
会在apache中增加如下内容:
Alias /awstatsclasses “/usr/local/awstats/wwwroot/classes/”
Alias /awstatscss “/usr/local/awstats/wwwroot/css/”
Alias /awstatsicons “/usr/local/awstats/wwwroot/icon/”
ScriptAlias /awstats/ “/usr/local/awstats/wwwroot/cgi-bin/”
<Directory “/usr/local/awstats/wwwroot”>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
当然你也有可能会发现httpd.conf文件会变成这个样子:(每句后面会多出^M)
# Do NOT simply read the instructions in here without understanding^M
# what they do. They’re here only as hints or reminders. If you are unsure^M
# consult the online docs. You have been warned. ^M
#^M
# Configuration and logfile names: If the filenames you specify for many^M
# of the server’s control files begin with “/” (or “drive:/” for Win32), the^M
# server will use that explicit path. If the filenames do *not* begin^M
# with “/”, the value of ServerRoot is prepended — so “logs/foo.log”^M
# with ServerRoot set to “/opt/lampp” will be interpreted by the^M
# server as “/opt/lampp/logs/foo.log”.^M
^M
#^M
使用dos2unix命令转换下格式:
[iyunv@saas tools]# file /opt/lampp/etc/httpd.conf
/opt/lampp/etc/httpd.conf: ASCII English text, with CRLF, LF line terminators
[iyunv@saas tools]# dos2unix /opt/lampp/etc/httpd.conf
dos2unix: converting file /opt/lampp/etc/httpd.conf to UNIX format …
[iyunv@saas tools]# file /opt/lampp/etc/httpd.conf
/opt/lampp/etc/httpd.conf: ASCII English text
[iyunv@saas ~]# usr/local/awstats/tools/awstats_updateall.pl now
Running ‘”/usr/local/awstats/wwwroot/cgi-bin/awstats.pl” -update -config=www.test.cn -configdir=”/etc/awstats”‘ to update config www.test.cn
Create/Update database for config “/etc/awstats/awstats.www.test.cn.conf” by AWStats version 6.95 (build 1.943)
From data in log file “/opt/lampp/logs/test_acc.log”…
Phase 1 : First bypass old records, searching new record…
Direct access after last parsed record (after line 880)
Jumped lines in file: 880
Found 880 already parsed records.
Parsed lines in file: 0
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 0 new qualified records.
使用浏览器,察看日志统计情况:http://域名/awstats/awstats.pl?config=配置文件名。。
实例如下:
http://www.test.cn/awstats/awstats.pl?config=www.test.cn
如提示:Forbidden You don’t have permission to access /awstats/awstats.pl on this server.错误。
1、 请确认/usr/local/awstats目录权限
[iyunv@saas ~]# chmod -R 755 /usr/local/awstats
2、 检测httpd.conf文件是否应用支持CGI。。改httpd.conf为如下:
[iyunv@OAServer ~]# tail /opt/lampp/etc/httpd.conf
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory “/usr/local/awstats/wwwroot”>
Options FollowSymLinks +ExecCGI
AddHandler cgi-script .pl
AllowOverride None
Order allow,deny
Allow from all
</Directory>
三、插件安装:
1、 GeoIP-1.4.6.tar.gz安装
[iyunv@saas soft]# tar zxvf GeoIP-1.4.6.tar.gz
[iyunv@saas GeoIP-1.4.6]#./configure &&make &&make install