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 ...
随机推荐
- redis加入systemctl服务
来自:https://blog.csdn.net/weixin_41114593/article/details/82383716 第一步 安装redis去官网下载最新的redis版本 安装官网 ...
- SQL SERVER 中 sp_rename 用法
转自:http://www.cnblogs.com/no7dw/archive/2010/03/04/1678287.html 因需求变更要改表的列名,平常都是跑到Enterprise manager ...
- 依赖注入 php
依赖注入:将当前类依赖的对象,以参数的方式注入到当前类中,简称依赖注入 <?php class Mi { public function size() { return '5.99寸全面屏'; ...
- 12、rpm
1.什么是rpm 由红帽开发用于软件包的安装 升级 卸载 查询 2.rpm包是什么样? 组成部分是什么样的? zip-3.0-11.el7.x86_64.rpm #el7 zip-3.0-1. el6 ...
- Jansson库的使用简介
一.Jansson的安装: 二.jansson相关的API: https://jansson.readthedocs.io/en/latest/apiref.html#c.json_t string ...
- 解决Redis中文乱码问题
启动客户端的时候添加 --raw 选项即可 wangyulong@code-local:~$ redis-cli 127.0.0.1:6379> set key1 '上海' OK 127.0.0 ...
- typedef 返回类型(*Function)(参数表) ——typedef函数指针
//首先看一下函数指针怎么用 #include <iostream> using namespace std; //定义一个函数指针pFUN,它指向一个返回类型为char,有一个整型的参数 ...
- 【LeetCode】451-根据字符出现频率排序
题目描述 给定一个字符串,请将字符串里的字符按照出现的频率降序排列. 示例 1: 输入: "tree" 输出: "eert" 解释: 'e'出现两次,'r'和' ...
- CUDA, CUDNN 版本查询
CUDA 查询: cat /usr/local/cuda/version.txt 或者 nvcc -V (也可以看到版本信息) CUDNN 查询 cat /usr/local/cuda/include ...
- 关于tp5.0中对象数组转换普通数组使用助手函数collection而不是toArray
tp5.0新版的模型查询返回默认对象,系统默认增加了toArray方法,许多开发者在all或select尝试使用toArray来转换为数组,在此希望开发者能理解对象的概念,尝试使用对象进行数据的使用, ...