linux源码安装apache

linux源码安装apache

  1. 需要安装APR1、APR-Util1和PCRE2
安装APR
gzip  -d  apr-1.5.2.tar.gz
tar  -xf  apr-1.5.2.tar
ls  -l
cd  ./apr-1.5.2/
./configure
make
make install
安装APR-Util
gzip  -d  apr-util-1.5.4.tar.gz
tar  -xf  apr-util-1.5.4.tar
ls  -l
cd  ./apr-util-1.5.4/     //指定apr位置
./configure  --with-apr=/usr/local/apr
make
make install
安装PCRE
gzip  -d  pcre-8.36.tar.gz
tar  -xf  pcre-8.36.tar
ls  -l
cd  ./pcre-8.36/
./configure	//需要安装GCC 和GCC-C++; 命令:yum  install  -y  gcc  gcc-c++ 
make
make  install
  1. 安装apache
gzip  -d  httpd-2.4.17.tar.gz
tar  -xf  httpd-2.4.17.tar
ls  -l
cd  ./httpd-2.4.17/
./configure  --enable-mods-shared=all   //编译全部模块  --prefix=目录名 可指定安装目录
make
make  install

修改httpd.conf文件

ServerName : localhost:80

设置软连接

ln  -s  /usr/local/apache2/bin/apachectl  /mylinks/httpd。
ls  -l  /mylinks

启动apache

/mylinks/httpd  -k  start

关闭防火墙

systemctl  stop  firewalld
systemctl  disable  firewalld

转载地址:https://jingyan.baidu.com/article/7e4409533d7f0f2fc0e2ef91.html


  1. http://apr.apache.org apr,apr-util下载地址 ↩︎ ↩︎

  2. http://www.pcre.org pcre下载地址 ↩︎

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值