官方安装教程  http://httpd.apache.org/docs/2.4/install.html

一.下载安装包

进入https://httpd.apache.org/download.cgi#apache24

下载 tar.gz包

wget https://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.39.tar.gz

二.安装

1.解压

tar -xzvf  httpd-2.4..tar.gz mv httpd-2.4. httpd

正确的安装(这个是安装失败后的总)

wget http://us.mirrors.quenda.co/apache//apr/apr-1.7.0.tar.gz
wget http://us.mirrors.quenda.co/apache//apr/apr-util-1.6.1.tar.gz
wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
#解压后进入各自目录运行
cd /usr/local/httpd/srclib/apr
./configure
make
make install cd /usr/local/httpd/srclib/apr-util
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
make install

wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
mv pcre httpd/srclib/pcre
./configure --prefix=/usr/local/pcre
make
make install

./configure -with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre
make
make install
 

2.安装

 ./configure --enable-rewrite=shared

错误解决参考:https://blog.csdn.net/zhtking120/article/details/9762315

报错1. APR not found.  Please read the documentation.

sudo apt-get install libapr1-dev libaprutil1-dev

报错2. 还是报错

可能上一个问题没有解决: 进入这里  从Apache APR下载APR和APR-Util的最新版本,将它们解压缩到./srclib/apr和./srclib/apr-util(确保域名没有版本号;例如,APR分发必须在./srclib/apr/下

wget http://us.mirrors.quenda.co/apache//apr/apr-1.7.0.tar.gz
wget http://us.mirrors.quenda.co/apache//apr/apr-util-1.6.1.tar.gz
tar -xzvf apr-1.7..tar.gz
tar -xzvf apr-util-1.6..tar.gz
mkdir ./srclib
apr-1.7. ./srclib/apr
mv apr-util-1.6. ./srclib/apr-util cd /usr/local/httpd/srclib/apr
./configure
make
make install cd /usr/local/httpd/srclib/apr-util
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
make install

又报错ubuntu xml/apr_xml.c:35:10: fatal error: expat.h:

apt-get install libexpat1-dev

报错3. no acceptable C compiler found in $PATH

 apt-get install build-essential

报错4. configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
mv pcre httpd/srclib/pcre
./configure --prefix=/usr/local/pcre
make
make install

继续编译

./configure -with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre
make
make install

中途如有乱七八糟的报错将上面安装的东西删除重新装一边

安装成功

三.启动测试

ln -s /usr/local/apache2/bin/apachectl /sbin/
apachectl start

报错1. AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0

解决方法:进入apache的安装目录 编辑httpd.conf文件,搜索"#ServerName",添加ServerName localhost:80

ServerName localhost:80 #亦可以用域名

ubuntu 安装apache2 二进制包的更多相关文章

  1. ubuntu下mysql二进制包安装

    1.下载对应二进制包 cd /usr/local/srcsudo wget http://dev.mysql.com/downloads/file/?id=465030 2.解压并放在/usr/loc ...

  2. ubuntu 安装apache2,mysql,php5,phpmyadmin等软件

    1.安装apache2  sudo apt-get install apache2  输入Y回车  apache2 安装完成  检测:在浏览器输入localhost 出现It works则成功. 2. ...

  3. Linux_CentOS软件安装调试 源代码包编译安装和 二进制包配置

    Linux 下源代码(C 语言)如何编译(安装) 1. 先安装源代码编译的软件 gcc,make,openssl 如下: yum install -y gcc make gcc-c++ openssl ...

  4. red hat安装mysql二进制包

    数据包命名格式解释 mysql-5.7.15-linux-glibc2.5-x86_64.tar.gz 黑色粗体表示为包名称 蓝色表示linux系统二进制包 红色表示构架     1.上传mysql- ...

  5. shell安装MySQL二进制包

    现在解压MySQL二进制包,稍作配置,就能用了,安装速度快,安装来练习最好不过了,哈哈 该脚本只是安装二进制的MySQL包,my.cnf只修改了简单的选项,没有过多进行设置,若朋友们用我的脚本安装作为 ...

  6. ubuntu安装greenplum依赖包

    ubuntu安装greenplum的过程中有两个比较难找的包,特地写出来给大家分享一下: 错误提示1:configure: error: header file <ldap.h> is r ...

  7. UBUNTU 安装中文语言包命令

    本次在UBUNTU安装国外程序,需要中文包 才会是中文. apt-get install language-pack-zh-hans 解决.

  8. MYSQL三种安装方式--二进制包安装

    1. 把二进制包下载到/usr/local/src下 2. 如果是tar.gz包,则使用tar zxvf 进行解压 如果是tar包,则可以使用tar xvf 进行解压 3. $ mv mysql-5. ...

  9. centos安装nodejs二进制包

    1.下载nodejs的二进制包 wget https://nodejs.org/dist/v6.3.1/node-v6.3.1-linux-x64.tar.xz 2.解压下载的安装包 tar xf n ...

随机推荐

  1. vue中的render函数介绍

    简介:对于不了解slot的用法(参考:大白话vue-slot的用法)又刚接触render函数的同学来说,官网的解释无疑一脸懵逼,这里就整理下个人对render函数的理解 问题: 1.render函数是 ...

  2. GCD 和 NSOperationQueue 的差别

    http://stackoverflow.com/questions/10373331/nsoperation-vs-grand-central-dispatch http://www.cocoach ...

  3. PHP Trait特性

    php类的单继承性,无法同时从两个基类中继承属性和方法,为了解决这个问题,使用Trait特性解决. Trait是一种代码复用技术,为PHP的单继承限制提供了一套灵活的代码复用机制. 用法:通过在类中使 ...

  4. ruby类对象和对象

    class Box def initialize(w,h) @width,@height=w,h end def getArea puts "class of self #{self.cla ...

  5. xenserver添加静态路由

    xe network-list name-label= xe network-param-set uuid=48a64512-69e8-6534-f276-8d0c4555f946 other-con ...

  6. python判断字符串是否是json格式方法分享

    python判断字符串是否是json格式方法分享 在实际工作中,有时候需要对判断字符串是否为合法的json格式 解决方法使用json.loads,这样更加符合'Pythonic'写法 代码示例:   ...

  7. TensorFlow学习笔记1-入门

    TensorFlow学习笔记1-入门 作者: YunYuan *** 写在前面 本笔记是我学习TensorFlow官方文档中文版的读书笔记,由于尚未搭建好Github的个人博客的评论功能,故尚不方便与 ...

  8. C#后台获取当前时间并格式化

    最常用的:DateTime.Now.ToString("yyyy-MM-dd"); //今天DateTime.Now.Date.ToShortDateString(); //昨天, ...

  9. php的优势与缺点

    PHP即“超文本预处理器”,是一种通用开源脚本语言.PHP是在服务器端执行的脚本语言,与C语言类似,是常用的网站编程语言.PHP独特的语法混合了C.Java.Perl以及 PHP 自创的语法.利于学习 ...

  10. shell 删除项目日志

    删除半年之前的日志 find 后面紧跟目录 .为当前目录 -type f 指定查找的是文件 -mtime +180  查找180天之前的 -name  文件名筛选 -exec -rm -rf  执行的 ...