Linux下编译,安装Apache httpd服务器
环境:ubuntu 16.0.4
Apache官网下载Apache httpd压缩包:httpd-2.4.27.tar.gz,安装之前请确定安装了make工具,我安装的是GNU make
- 解压文件
sudo tar -zxvf '/home/fanchao/桌面/share/apache http server/httpd-2.4.27.tar.gz' -C /etc/httpd
在解压后的文件目录下有个install文件,里面写着
For complete installation documentation, see [ht]docs/manual/install.html or
http://httpd.apache.org/docs/2.4/install.html - 通过查看文档,安装所需要的环境 :
安装 APR(其实不用安装,后面说明):下载 apr-1.6.2.tar.gz
解压:
sudo tar -zxvf '/home/fanchao/桌面/share/apache http server/apr-1.6.2.tar.gz' -C /etc/httpd
编译和安装:
sudo
cd /etc/httpd/apr-1.6.2 #进入解压后的文件目录
sudo ./configure #这里可以添加参数 --prefix=你要安装的目录,我这里没有加,默认安装在/user/loacl目录下 以下所有的./configure都可以添加这个参数
sudo make
sudo make install
安装APR-UTIL(其实不用安装,后面说明):下载 apr-util-1.6.0.tar.gz
解压:
sudo tar -zxvf '/home/fanchao/ 桌面/share/apache http server/apr-util-1.6.0.tar.gz' -C /etc/httpd
编译和安装
cd /etc/httpd/apr-util-1.6.
sudo ./configure --with-apr=/usr/local/apr/bin/apr--config
sudo make
这里报错
xml/apr_xml.c::: fatal error: expat.h: 没有那个文件或目录
compilation terminated.
/etc/httpd/apr-util-1.6./build/rules.mk:: recipe for target 'xml/apr_xml.lo' failed
make[]: *** [xml/apr_xml.lo] Error
make[]: Leaving directory '/etc/httpd/apr-util-1.6.0'
/etc/httpd/apr-util-1.6./build/rules.mk:: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error
解决办法就是安装libexpat1-dev
sudo apt-get install libexpat1-dev
重新输
sudo make
sudo make install
安装httpd所需要的prce库:下载prce-8.41.zip
解压:
sudo unzip '/home/fanchao/桌面/share/apache http server/pcre-8.41.zip' -d /etc/httpd
编译和安装:
cd /etc/httpd/pcre-8.41
sudo ./configure
sudo make
sudo make install
最后编译安装apache httpd
sudo ./configure --with-apr='/usr/local/apr/bin/apr-1-config' --with-apr-util='/usr/local/apr/bin/apu-1-config' --with-prce='/usr/local/bin/pcre-config' #这里还有其他参数可以配置,具体参照官方
sudo make
sudo make install
到现在按照官方文档的说明应该就已经安装好了,但是我到make这步就报错了
collect2: error: ld returned exit status
Makefile:: recipe for target 'htpasswd' failed
make[]: *** [htpasswd] Error
make[]: Leaving directory '/etc/httpd-2.4.27/support'
/etc/httpd-2.4./build/rules.mk:: recipe for target 'all-recursive' failed
make[]: *** [all-recursive] Error
make[]: Leaving directory '/etc/httpd-2.4.27/support'
/etc/httpd-2.4./build/rules.mk:: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error
我查了很多地方都没有遇到这个错误或者说这个错误是怎么发生的。这个错误是因为在httpd目录下的srclib目录里面没有apr和apr-util所导致的,但是./configure又不会报错,到make才会报错,所以把下载下来到apr和apr-util解压到srclib目录下到apr和apr-util目录,注意目录名字要一致。
这就是我之前说的不用安装apr和apr-util的原因,它会自动安装,手动安装后去指定安装路径是会报错的。
重新生成make文件和make
sudo ./configure --with-prce='/usr/local/bin/pcre-config' --with-included-apr #其他参数请参照官方
sudo make
sudo make install
现在就可以安装成功了,如果没有指定文件夹那么就会默认安装在 /usr/local/apache2
运行
sudo '/usr/local/apache2/bin/apachectl' -k start #启动
sudo '/usr/local/apache2/bin/apachectl' -k stop #停止
完结。
Linux下编译,安装Apache httpd服务器的更多相关文章
- Linux下编译安装Apache Http Server
Linux下编译安装Apache Http Server [TOC] 1.下载httpd-2.4.12.tar.bz2 wget http://mirror.bit.edu.cn/apache/htt ...
- Linux下编译安装Apache及模块
Apache是时下最流行的Webserver软件之中的一个,支持多平台,可高速搭建web服务,并且稳定可靠.并可通过简单的API扩充.就能够集成PHP/Python等语言解释器. 文章这里解说怎样在l ...
- Linux下编译安装Apache 2.4
Linux一般会自带httpd服务,但是版本一般不是最新,性能也不是最好,生产中建议手动安装官方源码包,安装Apache官方包之前首先要停止之前的httpd服务,停止后也可以卸载之前的版本 准备工作做 ...
- CentOS下编译安装Apache(httpd)
官网下载最新版本的apache, apr, apr-util http://httpd.apache.org/download.cgi#apache24 http://apr.apache.org/d ...
- linux下编译安装apache
在linux(CentOS6.5)上安装Apache,要首先确保以下程序事先安装 apr:The mission of the Apache Portable Runtime (APR) projec ...
- Linux下编译安装Apache报APR not found错误的解决办法
我在编译安装完Nginx.MySQL和PHP(见之前一篇博客:LNMP环境搭建详细教程)之后,进行apache的编译安装: cd /usr/local/src wget http:.tar.gz ta ...
- linux中编译安装Apache、PHP、MySQL(上)
1.简介 在阿里云买了个云服务器,一直没时间折腾.过了近十天了吧,才有时间好好玩玩这个云服务器.自己是做Web开发的,所以我需要的开发环境是LAMP.之前打算是采用yum安装,不过yum安装apach ...
- 在linux下手动安装 apache, php, mysql--终极版
在linux下手动安装 apache, php, mysql: 参考: http://www.cnblogs.com/lufangtao/archive/2012/12/30/2839679.html ...
- CentOS 下编译安装Apache
CentOS 下编译安装Apache 卸载原有的apache 首先从 http://httpd.apache.or 下载apache源码包httpd-2.4.4.tar.gz然后从 http://ap ...
随机推荐
- Thingworx SDK开发自定义Widget
Thingworx自带的图表数量有限,样式也很有限,在echarts上看到了这样一个非常简单的图表,下面将做一个简单的静态引入示范 首先创建Thingworx项目 然后右键ui新建widget 自动生 ...
- 学习ZBrush到底需不需要用数位板?
在学习ZBrush时,要控制下笔的力度,而这一点是鼠标办不到的.这时就需要拥有一块手绘板.手绘板可以控制笔刷的力度. 在雕刻之前,要先来了解CG设计领域广泛应用的硬件产品—数位板,如图所示. 数位板又 ...
- JSP Java服务器页面
大家好!好久不见!今日我们开始学习JSP了,一些记录基础性的知识在这里与大家分享. 先说下URL(Uniform Resource Locator 统一资源定位符). URL包括传输协议(http:/ ...
- xgboost学习
1.原理 https://www.cnblogs.com/zhouxiaohui888/p/6008368.html 2.实战 xgboost中比较重要的参数介绍: (1)学习率:learning r ...
- There are multiple modules with names that only differ in casing.
client?4c0e:153 ./src/components/Paginate.vue There are multiple modules with names that only differ ...
- python dns 服务器
import socketserver import struct import threading # DNS Query class SinDNSQuery: def __init__(self, ...
- Android开发进度04
1,今日:目标:实现登录和注册功能 2,昨天:完成登录和注册的界面以及后台数据库的操作 3,收获:会使用SQlite数据库的操作语句 4,问题:登录时出现问题(登录不上去)
- 小学生都能学会的python(深浅拷贝)
小学生都能学会的python(深浅拷贝) join() 把列表中的每一项用字符串拼接起来 # lst = ["汪峰", "吴君如", "李嘉欣&quo ...
- Virtual Box 新建一个虚拟机安装系统(补充:WIN7 64 bit 系统虚拟机无法安装 64 bit 系统问题)
1.安装Virtual Box好后,点击新建 2.配置内存大小,这个根据自己需要配置就好 3.创建虚拟硬盘 这里选择固定分配.动态分配都可以,接下来就分配硬盘大小了 4.新建好后我们点击刚才建立的虚拟 ...
- css3特效第一篇--旋转的背景&翻书效果
一.html遮盖层与css3的旋转动画 >效果图(加载可能会慢一点儿,请稍等...): >实现思路:在一个大的div中装入一个底层img和顶层的div(里面的内容按照以上图片呈现的样式布局 ...