实验环境:
需要的软件包:apr-util-1.4.1.tar。广州,httpd-2.4.2.tar。广州,apr-1.4.6.tar。广州
宿主机共享文件夹已挂在到/abc下
实验步骤:
一、手工编译安装apache
- - - - - - - - - - - - - - - - - - - - - -安装软件包- - - - - - - - - - - - - - - - - - - - - - - -
cd/abc
百胜删除httpd -y ,,,,//卸载默认安装的httpd服务
焦油zxvf apr-1.4.6.tar。广州- c/opt
焦油zxvf apr-util-1.4.1.tar。广州- c/opt
焦油zxvf httpd-2.4.2.tar。广州- c/opt
cd/opt
cp - r apr-1.4.6/httpd-2.4.2/srclib/4月
cp - r apr-util-1.4.1/httpd-2.4.2/srclib/apr-util
- - - - - - - - - - - - - - - - - - - - - - - -安装编译环境- - - - - - - - - - - - - - - - - - - - - - - -
yum安装gcc gcc-c + + pcre pcre-devel zlib-devel - y
- - - - - - - - - - - - - - - - - - - - - -手工配置安装- - - - - - - - - - - - - - - - - - -
cd/opt/httpd-2.4.2/
。/配置\
——prefix=/usr/地方/httpd \,,,,,,,,,,,,,,,,,,//指定配置文件路径
——enable-deflate \,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,//开启压缩功能
——enable-expires \,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,//开启缓存功能
——启动\,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,//启用动态模块加载
——enable-rewrite \,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,//启用重写功能
——enable-charset-lite \,,,,,,,,,,,,,,,,,,,,,,,//启用字符集支持
——enable-cgi ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,//启用CGI脚本程序支持
做,,使安装
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -设置启动脚本- - - - - - - - - - - - - - - - - -
grep - v“#”;/usr/local/httpd/bin/apachectl祝辞/etc/init.d/httpd //启动脚本
vim/etc/init.d/httpd
,# !/bin/sh
,,,,,15 # chkconfig: 2345 85
,,,,,描述:Apache是一个万维网服务器。
chmod + x/etc/init.d/httpd
chkconfig——添加httpd
chkconfig列表httpd
chkconfig, 35级httpd alt=" Apache网页优化——压缩,缓存“>
三,开启缓存更能