编译安装apache

编译安装apache
install http (apache)(网页)
6 操作系统
方法:(两种)
第一种:
yum -y install httpd
开启
service httpd start|restart|stop
加入开机自启
chkconfig 服务 on|off
7 操作系统
systemctl start|restart|stop 服务名称
加入开机自启
systemctl enable | disable 服务名称
卸载某个服务
注意: 必须是yum方式安装的服务
yum -y remove httpd*
第二种:
源码安装:
规定: 所有源码安装软件包全部放到(/usr/local/)
安装apr
mkdir /usr/local/apache
mv apr-1.6.5.tar.gz apr-util-1.6.1.tar.gz httpd-2.4.35.tar.gz /usr/local/apache/
cd /usr/local/
655 cd apache/
656 ls
657 mkdir apr
658 tar xf apr-1.6.5.tar.gz -C apr
659 cd apr
661 cd apr-1.6.5/
663 ./configure --prefix=/usr/local/apache/apr
664 echo $?
667 make
668 echo $?
669 make install
安装 apr-util
cd /usr/local/apache/apr-util/
cd apr-util-1.6.1/
ls
./configure --prefix=/usr/local/apache/apr-util
./configure --prefix=/usr/local/apache/apr-util --with-apr=/usr/local/apache/apr
make
报错:make[1]: *** [xml/apr_xml.lo] Error
解决方案: yum -y install expat-devel pcre-devel
报错:make[2]: *** [htpasswd] Error 1
make[2]: Leaving directory /usr/local/apache/httpd-2.4.35/support' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/usr/local/apache/httpd-2.4.35/support’
make: *** [all-recursive] Error 1
解决方案:
cp -r apr-1.6.5 /usr/local/apache/httpd-2.4.35/srclib/apr
cd apr-util/
cp -r apr-util-1.6.1 /usr/local/apache/httpd-2.4.35/srclib/apr-util
cd /usr/local/apache/httpd-2.4.35
cd srclib/
cd apr
./configure --prefix=/usr/local/apache/apr
649 make
650 make install
651 cd …
652 cd apr-util/
653 ls
654 ./configure --prefix=/usr/local/apache/apr-util/ --with-apr=/usr/local/apache/apr
655 make
656 make install
cd /usr/local/apache/httpd-2.4.35
659 ls
661 ./configure --prefix=/usr/local/apache/ --with-apr=/usr/local/apache/apr --with-apr-util=/usr/local/apache/apr-util/
make && make install
启动 Apache
/usr/local/apache/bin/apachectl start|stop|relaod

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值