linux下Apache源码安装

1、配置源码安装环境

  • yum install -y gcc gcc-c++ make expat-devel

2、四个压缩包上传并解压

  • 1.第一个
  • tar zxf apr-1.7.0.tar.gz
  • cd apr-1.7.0/
  • ./configure --prefix=/usr/local/apr ///配置文件
  • make && make install //编译
  • 2.第二个
  • tar zxf apr-util-1.6.1.tar.gz
  • cd apr-util-1.6.1/
  • ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
  • make && make install
  • 3.第三个
  • tar zxf pcre-8.44.tar.gz
  • cd pcre-8.44/
  • ./configure --prefix=/usr/local/pcre && make install
  • 4.第四个
  • tar zxf httpd-2.4.43.tar.gz -C /usr/src
  • cd /usr/src/httpd-2.4.43/
  • ./configure --prefix=/usr/local/apache --sysconfdir=/etc --enable-so --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
  • make -j 4 && make install
  • 5.处理防火墙

+ firewall-cmd --permanent --add-service=http
+ firewall-cmd --reload
+ setenforce 0
+ vim /etc/hosts
+ 写ip bogon

  • 6.启动apche
  • ln -s /user/local/apache/bin/* /usr/sbin/
  • /usr/local/apache/bin/apachectl start
  • vim /etc/httpd.conf
  • //修改ServerName 将#去掉 193行 217行
  • 改ServerName www.bogon.com
  • //启动apche
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。