Apache 在Linux上的安装

1、获取源码

  wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.37.tar.gz

2、卸载centos自带的apache

  

  

3、解压apache目录

  tar -zxvf apache-2.4.37

4、./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi

  --prefix  #安装目录
  --enable-so  #启用加载状态模块
  --enable-rewrite  #启用网页地址重写功能
  --enable-charset-lite  #启用字符集支持
  --enable-cgi  #启用CGI脚本程序支持
  
5、安装apr
  wget http://mirrors.hust.edu.cn/apache//apr/apr-1.6.5.tar.gz
  wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
  
  安装pcre
  yum -y install pcre 
  yum -y install pcre-devel 
  yum -y install openssl-devel 
6、./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
  make && make install
  

7、开启httpd

  

  

 
 
原文地址:https://www.cnblogs.com/yang-2018/p/10261474.html