Apache的配置和应用
apache保持连接和访问控制
卸载apache
[root@centos01 ~]# yum remove httpd
卸载光盘-切换为Linux 挂载光盘
[root@centos01 ~]# umount /dev/cdrom /mnt/
切换为Linux.Iso
[root@centos01 ~]# mount /dev/sr0 /mnt/
解压
[root@centos01 ~]# tar zxvf /mnt/httpd-2.2.17.tar.gz -C /usr/src/
进入/usr/src/httpd-2.2.17/
[root@centos01 ~]# cd /usr/src/httpd-2.2.17/
配置
[root@centos01 httpd-2.2.17]# ./configure --prefix=/usr/local/httpd --enable-so --enable-cgi --enable-charset-lite --enable-rewrite
编译安装
[root@centos01 httpd-2.2.17]# make && make install
优化命令
[root@centos01 httpd-2.2.17]# ln -s /usr/local/httpd/bin/* /usr/local/bin/
生成配置文件
[root@centos01 httpd-2.2.17]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
[root@centos01 httpd-2.2.17]# vim /etc/init.d/httpd
#chkconfig:35 20 80
#description:Apache Server
给配置文件增加权限
[root@centos01 httpd-2.2.17]# chmod +x /etc/init.d/httpd
开启服务-设置为开机自动启动
[root@centos01 httpd-2.2.17]# chkconfig --add httpd
[root@centos01 httpd-2.2.17]# chkconfig --level 35 httpd on
1、apache保持连接
备份配置文件
[root@centos01 ~]# cp /usr/local/httpd/conf/httpd.conf /usr/local/httpd/conf/httpd.conf.bak
编辑配置文件-开启配置保持连接
[root@centos01 ~]# vim /usr/local/httpd/conf/httpd.conf
397 Include conf/extra/httpd-default.conf
配置访问保持