centos 6.3 源码安装apache

本文详细介绍了Apache服务器的安装步骤,包括安装SSL源码包、apr包、apr-util包及pcre包等依赖项,接着进行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是不是出现了一坨一坨东西了^-^,恭喜成功了!!

转载于:https://www.cnblogs.com/hilo/p/4553238.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值