apache 的编译安装
apache 的编译安装
首先对压缩包解压,静茹文件夹
# ll
total 7036
drwxr-xr-x. 11 dwchaoyue dwchaoyue 4096 Jan 252012 httpd-2.2.22
-rw-r--r--.1 root root 7200529 Dec 22 21:13 httpd-2.2.22.tar.gz
# cd httpd-2.2.22
#
apache 的安装分为以下几个步骤。
[*] root@linuxvm02 httpd-2.2.22]#./configure --prefix=/usr/local/apache --enable-so --enable- proxy --enable-proxy-http --enable-proxy-balancer --enable-modules=all --enable-mods- shared=all
[*] 执行make
[*] 执行make install
[*] chkconfig --add httpd # 添加到系统服务
[*] chkconfig --level 345 httpd on
查看apache服务状态
# servicehttpd status
httpd (pid10175) is running...
#
apache服务成功安装!
配置apache服务.
查找apache的配置文件
# updatedb
# locatehttpd.conf
/etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.confbak
/home/software/httpd-2.2.22/docs/conf/httpd.conf.in
/usr/local/apache/conf/httpd.conf
/usr/local/apache/conf/original/httpd.conf
#
/etc/httpd/conf/httpd.conf 即为apache的配置文件.
修改/etc/httpd/conf/httpd.conf 文件
# vi/etc/httpd/conf/httpd.conf
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/apache"
将 DocumentRoot修改为DocumentRoot "/usr/local/apache/htdocs"
在客服端测试,直接在浏览器中输入http://ip
apache 搭建完成,并且能正确浏览内置页面.
异常处理:
执行./configure --prefix=/usr/local/apache --enable-so 报错》
#./configure --prefix=/usr/local/apache --enable-so --enable-proxy --enable-proxy-http --enable-proxy-balancer --enable-modules=all --enable-mods-shared=all
checking whether to enable mod_charset_lite... no
checking whether to enable mod_deflate... checking dependencies
checking for zlib location... not found
checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
解决方法: 安装zlib-devel
# ll | grep-izlib-devel
-r--r--r--. 211 root root 44740 Sep 262011 zlib-devel-1.2.3-27.el6.i686.rpm
-r--r--r--. 131 root root 44728 Sep 262011 zlib-devel-1.2.3-27.el6.x86_64.rpm
# rpm-ivh zlib-devel-1.2.3-27.el6.x86_64.rpm
warning: zlib-devel-1.2.3-27.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ###########################################
1:zlib-devel ###########################################
参考链接:
http://www.iyunv.net/LINUXjishu/39765.html
http://blog.sina.com.cn/s/blog_53cb817c01011a3o.html
http://www.linuxidc.com/Linux/2012-07/66029.htm
apache的配置:
http://wenku.baidu.com/view/6781e29951e79b89680226f2.html
页:
[1]