apache源码安装 转载
1.先进入/usr/local/中创建三个文件夹 apr apr-util apache
cd /usr/local目录
mkdir apr
mkdir apr-util
mkdir apache
2.再进入 src中 cd src
3.在 src中 下载apr-1.6.5 apr-util-1.6.1 httpd-2.4.37源码包
wget http://archive.apache.org/dist/apr/apr-1.6.5.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz
wget http://archive.apache.org/dist/httpd/httpd-2.4.37.tar.gz
4.分别解压它们
tar -zxvf apr-1.6.5.tar.gz
tar -zxvf apr-util-1.6.1.tar.gz
tar -zxvf httpd-2.4.37.tar.gz
5. 先不要急着安装,先确保它所依赖的库是否有,怎样查看软件是否安装(rpm -q xxx),如果没有安装依赖则进行安装(笔者一般安装依赖库直接使用yum 默认安装,这样在软件安装的时候就不需要知道依赖库的安装路径,省去不少麻烦)
需要安装的依赖包有 gcc expat-devel openssl-devel pcre pcre-devel
在src目录下 yum install gcc
yum install -y expat-devel
yum install openssl-devel
yum install -y pcre pcre-devel
yum install pcre-devel
6.接下来就是编译安装了,步骤四步: 下载wget --- 加压tar ------ 编译 make ----安装 make install
进入 apr-1.6.5目录中
cd apr-1.6.5
./configure --prefix=/usr/local/apr/
make && make install
(此时没有报任何error错误)
7. 退出apr-1.6.5目录,进入 apr-util-1.6.1目录中
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make && make install
(此时也没有任何error错误)
8.下面开始对Apache进行安装配置,可以使用
cd httpd-2.4.37
./configure \
--prefix=/usr/local/apache/ \
--with-apr=/usr/local/apr/ \
--with-apr-util=/usr/local/apr-util/ \
--enable-so \
--enable-ssl\
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared \
--enable-static-support
检查无误,然后开始编译安装
make && make install
9.等安装完以后进入到安装目录,开启apache服务
cd /usr/local/apache/bin/
./apachectl start
10. 哎,发现报错
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
额,原来就是配置文件中没有serverName,那就在httpd.conf 中增加 ServerName
11. vim /usr/local/apache/conf/httpd.conf
#增加
ServerName wx.xxxx.club (就是增加域名)
12. 完了之后再重新启动apache,发现一切正常,然后我们访问下看看是否OK
当输入域名时显示it works! ,就表示apache源码安装就此完成,
记住 想要重启apache 必须切换到
cd /usr/local/apache/bin/ 目录
使用
./apachectl start 开启apache
./apachectl restart 重启apache
./apachectl configtest 检测apache配置文件语法是否正确
apache源码安装 转载的更多相关文章
- apache源码安装必须依赖的库apr----/etc/ld.so.conf 文件介绍
Apache所依赖的库,封装了各个系统相关的API等.虽然都是Apache开发的,但是现在最新版本的Apache和APR源码是分开的.要编Apache就必须使用APR. /etc/ld.so.conf ...
- Apache源码安装--httpd-2.2.34
一.下载源码包 二.将源码包移动/usr/src/目录 三.解压源码包,并进入目录:tar -xzvf httpd-2.2.34.tar.gz,cd httpd-2.2.34 四.安装依赖包:yum ...
- centos apache源码安装过程记录
1.下载相关源文件 wget http://mirror.bjtu.edu.cn/apache/httpd/httpd-2.4.18.tar.gzwget http://mirrors.hust.ed ...
- win7 php5.5 apache 源码安装 imagick扩展
最近公司项目有用到php 的imagick,折腾了好长时间才把扩展装上,最主要的就是最新的不一定是最合适的,最开始一直找最新包安装,一直都不成功,经过google了好长时间,终于找到一个有用的,灵机一 ...
- Apache 源码安装
8.20]# make[root@yahoo pcre-8.20]# make install 二.安装apache1.下载httpd-2.4.3.tar.gz,地址是:http://httpd.ap ...
- apache源码安装
1.apr和apr-util,下载地址: http://apr.apache.org/download.cgi yum install gcc yum install libtool yum inst ...
- linux下源码安装apache服务
1.搭建静态网站是,我们只需要搭建apache服务即可满足要求. 例如:如果我再客户端游览器输入地址,他会找到192.168.1.100这个服务器,然后根据端口会找到apache服务器.apache他 ...
- CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境【转载】
本文转载自 园友David_Tang的博客,如有侵权请联系本人及时删除,原文地址: http://www.cnblogs.com/mchina/archive/2012/11/28/2778779.h ...
- 烂泥:php5.6源码安装与apache集成
本文由秀依林枫提供友情赞助,首发于烂泥行天下. apache对php的支持是通过apache的mod_php5模块来支持的,这点与nginx不同.nginx是通过第三方的fastcgi处理器才可以对p ...
随机推荐
- CentOS7搭建FastDFS V5.11分布式文件系统(二)
1.CentOS7 FastDFS搭建 前面已下载好了要用到的工具集,下面就可以开始安装了: 如果安装过程中出现问题,可以下载我提供的,当前测试可以通过的工具包: 点这里点这里 1.1 安装libfa ...
- c++ 类的继承和多态例子
类的继承例子: 以上个动态银河系的制作为例,假设我们定义了一个星星的类如下: class Star { public: Star(){} ~Star(){} void Init(); void Mov ...
- Arch Linux 安装rust
Arch Linux 安装rust 0. 参考 Rust Toolchain 反向代理使用帮助 1. 安装 安装rustup和toolchain yaourt -S rustup rustup ins ...
- mysql 存储过程(二)
存储过程(Stored Procedure): 一组可编程的函数,是为了完成特定功能的SQL语句集,经编译创建并保存在数据库中,用户可通过指定存储过程的名字并给定参数(需要时)来调用执行. 优点(为什 ...
- php禁止个别ip访问网站
PHP禁止个别IP访问自己的网站,可以看看下面的方法. function get_ip_data(){ $ip=file_get_contents("http://ip.taobao.com ...
- zencart通过产品id 批量添加推荐产品
1.修改 admin/featured.php 查找 pre_add_confirmation 将 pre_add_confirmation 与 break; 之间的代码,用下面的代码替换即可 &l ...
- inode、软硬链接
关于inode是什么,可以看这篇文章:http://www.cnblogs.com/adforce/p/3522433.html 如何查看inode ll -di /boot / /app查看文件和文 ...
- 前端面试题-clearfix(清除浮动)
一.浮动的概念 浮动的框可以向左或向右移动,直到它的外边缘碰到包含框或另一个浮动框的边框为止.由于浮动框不在文档的普通流中,所以文档的普通流中的块框表现得就像浮动框不存在一样. 二.浮动的影响 1. ...
- NOIP2017提高A组模拟10.6】Biology
题目 trie 暴力就是对于每个询问的T个字符串 第i个和第i+1个直接个从后暴力枚举每位是否相同, 但这个方法TLE 我们考虑是否可以用更快的方法来求出两个字符串的最长公共后缀. 我们把所有的字符串 ...
- yum 源的搭建
repos和epel的关系 https://blog.csdn.net/fantaxy025025/article/details/84918199 配置阿里云的yum源 https://www.cn ...