1. 程式人生 > >CentOS 7上編譯安裝 apache 2.4.25

CentOS 7上編譯安裝 apache 2.4.25

安裝路徑 top ive fig config art 命令 con archive

在CentOS 7上編譯安裝 apache 2.4.25 源碼包,並啟動此服務.

配置環境

  • Systemctl disable firewalld
  • Systemctl stop firewalld
  • /etc/selinux/config 關閉selinux
  • Sed –i ‘s/SELINUX=enforcing/SELINUX=disable/’ /etc/selinux/config 重啟生效(getenforce查看是否生效)
  • yum install gcc apr-devel apr-util-devel pcre-devel openssl-devel
  • wget http://archive.apache.org/dist/httpd/httpd-2.4.25.tar.bz2 下載apache源碼包
  • tar –xvf httpd-2.4.25.tar.bz2
  • cd httpd-2.4.25.tar.bz2
  • ./configure –prefix=/app/httpd --sysconfdir=/etc/httpd –enable-ssl 預編譯config配置選擇安裝路徑 配置文件路徑
  • make && make install 編譯安裝
  • echo ‘PATH=/app/httpd/bin:$PATH‘ > /etc/profile.d/httpd.cdsh 添加全局環境變量執?命令寫?PATH
  • . /etc/profile.d/httpd.sh 生效新加路徑的環境變量
  • apachectl start啟動apachectl服務

CentOS 7上編譯安裝 apache 2.4.25