美文网首页我爱编程
centos6.5&7源码包安装apache

centos6.5&7源码包安装apache

作者: dotdiw | 来源:发表于2017-01-10 23:11 被阅读207次

简单介绍下源码包安装apache

1. 下载包及依赖包

2. 安装apr

  • sudo mkdir /usr/local/apache/apr
  • tar -zxvf apr-1.5.2.tar.gz
  • cd apr-1.5.2
  • ./configure --prefix=/usr/local/apache/apr/
  • sudo make
  • sudo make install

3. 安装apr-util

  • tar -zxvf apr-util-1.5.4.tar.gz
  • cd apr-util-1.5.4
  • sudo mkdir /usr/local/apache/apr-util
  • ./configure --prefix=/usr/local/apache/apr-util/ --with-apr=/usr/local/apache/apr/
  • sudo make
  • sudo make install

4. 安装 pcre

  • tar -zxvf pcre-8.39.tar.gz
  • cd pcre-8.39
  • sudo mkdir /usr/local/apache/pcre
  • ./configure --prefix=/usr/local/apache/pcre/
  • sudo make
  • sudo make install

5. 安装apache

  • tar -zxvf httpd-2.4.25.tar.gz
  • cd httpd-2.4.25
  • ./configure --prefix=/usr/local/apache/ --with-apr=/usr/local/apache/apr/ --with-apr-util=/usr/local/apache/apr-util/ --with-pcre=/usr/local/apache/pcre/
  • sudo make
  • sudo make install

6. 添加到服务中

  • cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
  • vim /etc/init.d/httpd 添加如下:

# chkconfig: 345 85 15
# description: Activates/Deactivates Apache Web Server

  • chmod +x /etc/init.d/apache
  • chkconfig --add apache
  • chkconfig --list 查看

恭喜你成功了!

相关文章

网友评论

    本文标题:centos6.5&7源码包安装apache

    本文链接:https://www.haomeiwen.com/subject/elylbttx.html