安装apr

下载解压apr-1.4.5

./configure --prefix=/usr/local/apr
make
sudo make install

安装apr-util

下载解压apr-util-1.5.2

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

安装pcre

下载解压pcre-7.8.tar.gz

./configure --prefix=/usr/local/pcre
make
sudo make install

安装httpd

下载解压httpd-2.4.12

./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --enable-so --enable-rewrite
make
sudo make install

--enable-so 支持DSO模式(动态模块加载方式)
--enable-rewrite 支持rewrite(地址重定向)

建立软链接

sudo ln -s /usr/local/httpd/bin/apachectl /usr/local/bin/apachectl

启动

sudo apachectl start

启动异常

$sudo ./apachectl start

AH00557: httpd: apr_sockaddr_info_get() failed for test10.125.8.116
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

原因:这个问题应该是没有在 /etc/httpd/conf/httpd.conf 中设定 ServerName。所以apache会用主机上的名称来取代,首先会去找 /etc/hosts 中有没有主机的定义。

解决:在/etc/httpd/conf/httpd.conf中添加上ServerName=****

验证

打开浏览器输入ip,显示It works! 表示成功了。

添加网页

文件:/usr/local/httpd/htdocs/test.html

内容

<html>
<body>
<h1>
Test works OK!
</h1>
</body>
</html>

重启服务

sudo apachectl restart

验证

配置

1. 修改Web站点目录

默认的Web站点目录:/usr/local/apache2/htdocs,如果修改,例如"/home/gyw/WebSite"的目录作为apache的站点目录

  找到DocumentRoot这一行修改为:DocumentRoot "/home/gyw/WebSite"

  找到 <Directory> 这一行修改为:<Directory "/home/gyw/WebSite">

  

Linux 源码安装httpd的更多相关文章

  1. Linux源码安装JDK1.8

    Linux源码安装Java 1.到官网下载 jdk-8u131-linux-x64.tar.gz 官网地址:http://www.oracle.com/technetwork/java/javase/ ...

  2. CentOS7.3环境下源码安装httpd

    CentOS7.3环境下源码安装httpd 本文在CentOS7.3下,源码安装apache服务httpd2.4. 1.下载好源码安装包 [root@localhost ~]#ll total 625 ...

  3. mysql-5.5 for linux源码安装

    mysql-5.5 for linux源码安装 1.使用Yum安装依赖软件包 # yum install -y gcc gcc-c++ gcc-g77 autoconf automake bison  ...

  4. Linux 源码安装apache 与常见错误解决

    文档原位置 一.编译安装apache 1.解决依赖关系 httpd-2.4.4需要较新版本的apr和apr-util,因此需要事先对其进行升级. 升级方式有两种,一种是通过源代码编译安装,一种是直接升 ...

  5. Linux源码安装软件

    Linux环境下 源码编译安装软件 ==== 1. 下载,步骤略 ==== 2. 验证,部分官方下载同时提供签名,MD5,sha1,sha256等校验信息. $ gpg --verify gnupg- ...

  6. Linux 源码安装 FFmpeg

    加班次数频繁,已经快一年没有写博了.由于此次在项目中使用到了 FFmpeg 来处理音视频,顾记录下在 Linux 系统中源码安装 FFmpeg 以便不时之需. 1. 安装 yasm yasm 是一个汇 ...

  7. linux源码安装mysql,shell编程学习,ubuntu

    一.mysql安装 以源码安装的方式编译和安装Mysql 5.6. 1.卸载旧版本 rpm -qa | grep mysql 检查是否有旧版本 查询结果:mysql-libs-5.1.73-7.el6 ...

  8. linux源码安装软件的一般方法

    rhel系统貌似安装不了xmgrace,配置的时候居然说要那个M*tif库.百度了一下,需要openmotif库,然后用root账户想要用yum安装一下这个库,搞了好久没搞懂.后面搞明白了,原因竟是因 ...

  9. Linux 源码安装Ansible 参考篇

    Ansible 源码搭建配置 近期在学习自动化运维相关技术,文章主要模拟内网情况下对Ansible的安装演示,源码安装较为繁琐.枯燥,尤其是在实际安装过程中可能出现各式各样的问题,所有在安装过程中尽量 ...

随机推荐

  1. PAT (Advanced Level) Practise 1003 Emergency(SPFA+DFS)

    1003. Emergency (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue As an emerg ...

  2. html5_d登陆界面_注册界面

    <!DOCTYPE html><html><head><script type="text/javascript">function ...

  3. Linux 执行ThinkPHP 文件的计划任务

    执行例如 http://192.168.1.32/index.php?s=/Home/Cron/yue 这样的 url 的计划任务 方式① */ * * * * curl http://192.168 ...

  4. eclipse不正常编译导致错误:Access denied for user 'root'@'localhost' (using password: YES)

    使用eclipse连接mysql报错:Access denied for user 'root'@'localhost' (using password: YES) 连接代码没有任何问题,网上找了很多 ...

  5. Python - 素数筛

    def shai(n): prim = list() check = list([1] * (n + 1)) for i in range(2, n + 1): if(check[i] == 1): ...

  6. 【转】简单的 Laravel 5 REST API

    Introduction Almost all successful internet based companies have APIs. API is an acronym for Applica ...

  7. oracle EBS 资产定义

    一.资产定义也就是江项目任务上的特定(能生成资产的)物料按照一定格式生成资产信息,其中每个独立物料生成一条资产,具体操作步骤如下: 1.省本部库存超级用户系统内生成领料单.审批领料单.最后进行出库处理 ...

  8. js判断ie版本号

     jQuery 2.0 去除了对浏览器版本号的判断(它推荐特性检测),这里是一个老外写的原生判断方法,这段代码着实巧妙!既简介.有向后兼容!一般做法都是:正则搜索 USER_AGENT :但因为历史原 ...

  9. angularJS自定义指令模板替换

    <html> <head> <meta charset="utf-8"/> <title></title> </h ...

  10. const 修饰函数

    At the very first ,I got a problem . Vector Vector::operator+(const Vector &v)const{ return Vect ...