1.
准备工作:
[[email protected] ~]# rpm -e httpd --nodeps
2.
[[email protected] ~]# mkdir 123 (创建一个目录)
[[email protected] ~]# mount -ousername=administrator //172.16.1.111/123 空格123(把宿主机里面的软件共享到linux上面)
3.
[[email protected]]# tar zxvf httpd-2.2.17.tar.gz h -C/usr/src (解包)
4.
[[email protected] /]# cd/usr/src/httpd-2.2.17/
[[email protected] httpd-2.2.17]# ./configure--prefix=/usr/local/httpd --enable-so--enable-rewrite --enable-charset-lite --enable-cgi (配置)
5.
[[email protected] httpd-2.2.17]# make&& make install (编译安装)
6.
[[email protected] httpd-2.2.17]# ls /usr/local/httpd/ (确认安装结果)
7.
[[email protected] httpd-2.2.17]# ln -s/usr/local/httpd/bin/* /usr/local/bin/
[[email protected] httpd-2.2.17]# ls -hl/usr/local/bin/ (优化执行路径)
8.
[[email protected] ~]# httpd –v (查看程序版本)
9.
[[email protected] ~]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
(添加系统服务)
10.
[[email protected] ~]# vim /etc/init.d/httpd (添加一下两行)
#chkconfig 35 85 21
#description: Startup script for the apachehttp server
11.[[email protected] ~]# chkconfig--add httpd (//将httpd添加为系统服务)
[[email protected] ~]# chkconfig --list httpd (//查看httpd服务的自启动状态)
httpd 0:关闭 1:关闭 2:关闭 3:启用 4:关闭 5:启用 6:关闭
12.
[[email protected] ~]# vim/etc/sysconfig/network (修改localhost为www)
[[email protected] ~]#vim /etc/hosts 添加IP映射
[[email protected] ~]# init 6 重启生效
13.
[[email protected] ~]# vim/usr/local/httpd/conf/httpd.conf (配置httpd服务)
修改第97行
14.
[[email protected] ~]#/usr/local/httpd/bin/apachectl –t (检查语法)
Syntax OK
15.
[[email protected]~]# /etc/init.d/httpd start (启动httpd服务)
httpd (pid 1763) already running
16.
[[email protected] ~]# netstat -anpt | grep httpd (查看端口)
17.
[[email protected]~]#cat/usr/src/local/httpd/htdocs/index.html
18.验证测试
Linux验证结果:
Windows验证结果:
部署AWStats分析系统
1.安装AWStats软件包
[[email protected]]#tar zxvf awstats-7.3 -C /usr/local/
[[email protected] local]#mv awstats-7.3 awstats
2. 为统计站点建立配置文件
[[email protected]]#cd/usr/local/awstats/tools
[[email protected]]#chomd a+x awstats_configure.pl
[[email protected] tools]#./awstats_configure.pl
属入httpd.conf的文件路径 回车 会提示按两次Y
指定要统计的目标网站名称
直接按回车
- 3.修改站点统计配置文件
[[email protected] tools]#vim /etc/awstats/awstats.www.benet.com.conf
Logfile="/usr/local/httpd/logs/access_log"(修改这个配置文件)
- 4.mkdir /var/lib/awstats 创建一个指定日志目录
执行日志分析,并设置cron计划任务
- 5.访问AWStats
在客户端属入 http://benet.com/awstats/awstats.pl?config=www.benet.com