centos 6.3 源码安装apache

1:先到openssl官网下个ssl源码包,http://www.openssl.org/source,然后解压:tar -zxf xxx.tar.gz,进入openssl目录,执行
./config --prefix=/usr/local/openssl,然后make && make install(这个可以用yum源安装:yum install -y openssl-devel,那下面的apache配置就不用加上--enable-ssl \--with-ssl=/usr/localable-ssl \--with-ssl=/usr/local/openssl \);

2:安装apr包,apr-util包,这两个可以到http://apr.apache.org/download.cgi下载,还有安装pcre包,可以到http://jaist.dl.sourceforge.net/project/pcre/pcre/8.35/
下载,注意顺序喔(如果不按顺序,出现错误仔细看)。
先安装apr包:
cd apr,
./configure --prefix=/usr/local/apr
make && make install

然后安装apr-util包:
cd apr-util
./configure --prefix=/usr/local/apr --with-apr=/usr/local/apr
make && make install

最后安装pcre包:
cd pcre
./configure --prefix=/usr/local/pcre
make && make install

3:好了,依赖安装完了,该apache出场了^-^,进入apache:
cd apache
./configure --prefix=/usr/local/apache \
--sysconfdir=/etc \
--enable-so \
--with-mpm=prefork \
--enable-ssl \
--with-ssl=/usr/localable-ssl \
--with-ssl=/usr/local/openssl \
--enable-rewrite \
--disable-autoindex \
--disable-userdir \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-pcre=/usr/local/pcre

make && make install;
4:apache安装完成了,接下来就是一些基本的设置了,
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd
在 "#!/bin/sh" 加上下面这两行(这个蛋痛死了,百度慢慢搜解释吧)
# chkconfig: 35 70 30
# description: Apache

chkconfig --add httpd

5:启动apache,service httpd start,ps aux | grep httpd是不是出现了一坨一坨东西了^-^,恭喜成功了!!

posted @ 2015-06-04 22:33  菜B  阅读(290)  评论(0编辑  收藏  举报