apache源码编译安装详解
查看是否安装 rpm -qa httpd
如果已安装,则卸载:rpm -e 卸载 --nodeps 不考虑意外
下载 wget http://mirrors.sohu.com/apache/httpd-2.2.31.tar.gz
查看大小 ll -sh
解压 tar xvf
查看文件readme、install以了解该软件安装方式。
编译环境部署及若干参数解析:
./configure
--prefix=/application/apache2.2.31 //安装的目录
--enable-deflate //压缩 对文本压缩
--enable-expires //过期 浏览器缓存多久
--enable-headers //激活头
--enable-modules //激活大多数模块
--enable-so //
--with-mpm=worker //由进程生成的线程(worker)提供服务
--enable-rewrite //激活rewrite功能(伪静态)
查看错误:echo $? 或error
configure: error: in `/root/httpd-2.2.31/srclib/apr':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
configure failed for srclib/apr
解决办法:yum -y install gcc
再次检查部署环境,还有错误
checking for zlib location... not found
checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
解决办法:yum -y install zlib-devel
make
make install
创建软链接:ln -sv apache2.2.31 apache
查看安装目录 ls (emeditor软件)
检查语法:/application/apache/bin/apachectl -t
启动:/application/apache/bin/apachectl start
或:/application/apache/bin/httpd -k start
存在以下错误,不过没关系:
httpd: apr_sockaddr_info_get() failed for min
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
查看是否启动:lsof -i :80 或 ps -ef | grep httpd
root 30976 1 0 07:51 ? 00:00:00 /application/apache2.2.31/bin/httpd -k start
daemon 30977 30976 0 07:51 ? 00:00:00 /application/apache2.2.31/bin/httpd -k start
daemon 30978 30976 0 07:51 ? 00:00:00 /application/apache2.2.31/bin/httpd -k start
daemon 30979 30976 0 07:51 ? 00:00:00 /application/apache2.2.31/bin/httpd -k start
daemon 30980 30976 0 07:51 ? 00:00:00 /application/apache2.2.31/bin/httpd -k start
root 31064 1464 0 07:54 pts/0 00:00:00 grep httpd
从结果来看已经启动。
在浏览器上访问主机ip,显示 It works!
如果错误,按照以下方式检查:
1、检查iptables防火墙
2、检查selinux getenforce
3、检查端口 80
4、检查进程
5、wget或curl
查看已经生效的模块:/application/apache/bin/apachectl -l
重点查看以下模块:
/application/apache/bin/apachectl -l|egrep "so|rewrite|header|expire|deflate"
mod_deflate.c
mod_expires.c
mod_headers.c
mod_rewrite.c
mod_so.c
跟踪进程使用情况 strace
strace /application/apache/bin/apachectl -M
部署站点:
cd /application/apache
cd conf/ //查看配置文件
grep -i documentroot httpd.conf //查看网站的根目录
DocumentRoot "/application/apache2.2.31/htdocs"
进入网站的根目录,放入网站文件
刷新浏览器,成功。
apache源码编译安装详解的更多相关文章
- linux http服务源码编译安装详解
相信大家大多都听过linux 的编译安装,但它到底是怎么把源代码变为自己电脑里可以应用的软件哪?今天,小编就以httpd 为例详细讲解一下. 什么是编译安装——编译:将源代码变为机器可执行的代码文件. ...
- apache源码编译安装
源码安装apche 下载apache的源码包文件 访问http://mirror.bit.edu.cn/apache/httpd/,复制如下gz文件的链接地址,并使用wget下载到本地 wget -P ...
- 基于cdh5.10.x hadoop版本的apache源码编译安装spark
参考文档:http://spark.apache.org/docs/1.6.0/building-spark.html spark安装需要选择源码编译方式进行安装部署,cdh5.10.0提供默认的二进 ...
- Apache源码编译安装脚本
Apache是开源的的.最流行的Web服务器软件之一,它快速.可靠并且可通过简单的API扩充,将Perl/Python/PHP等解释器编译到服务器中.Apache的模块超多,以及具有运行稳定,强大 ...
- QGIS源码编译步骤详解——官方新方案
目录 源码下载 环境下载 Cygwin64 OSGeo4W CMAKE Visual Studio 2017 环境配置 配置 编译 方案详细可见源码文件中INSTALL.md. 源码下载 QG ...
- centos 7.1 apache 源码编译安装
Apache编译安装 一,需要软件: http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gz 1.apr-1.5.2.tar.gz http://mi ...
- 源码编译安装MySQL8.0.20
1 概述 本文章主要讲述了如何从源码编译安装MySQL社区版8.0.20,首先会介绍一些编译安装的相关知识,然后开始编译安装 2 源码编译安装的相关知识 2.1 make与configure make ...
- centos7源码编译安装lamp/lnmp
centos7源码编译安装lamp/lnmp 进程:是包工头(相当于是个门,只管开门关门,不管门内的事儿) 线程:是各种工种(cpu调度的是线程) 进程 是一件事情, 线程 是 同一个时间范围内 同时 ...
- Centos7.X 源码编译安装subversion svn1.8.x
说明:SVN(subversion)的运行方式有两种:一种是基于Apache的http.https网页访问形式:还有一种是基于svnserve的独立服务器模式.SVN的数据存储方式也有两种:一种是在B ...
随机推荐
- WebService调用http://www.webxml.com.cn中的一些服务示例
1.打开http://www.webxml.com.cn网站下的“全部WebService”,会看到如下图的图片 2.点击打开WSDL连接,如下图,并保存为一个后缀名为wsdl文件,放在项目的根目录下 ...
- Rewriting History with Git Rebase
http://code.tutsplus.com/tutorials/rewriting-history-with-git-rebase--cms-23191 1. Rebasing for a Li ...
- oracle热点表online rename
对于在线的繁忙业务表的任何操作都可能带来意想不到的风险.一张业务表,对partition key进行升位,其步骤是: rename原表 新建临时表 交换分区到临时表 升位临时表的字段的长度 交换临时表 ...
- Python生成器 yield
迭代器与list相比较,就for in句型循环拿数据而言: 用list写很简洁,但如果list数据过大,会很消耗资源. 用iteration 迭代器写,则不会消耗那么多资源.他会随用随取,用一个拿一个 ...
- JavaScript高级程序设计59.pdf
dropEffect和effectAllowed 利用dataTransfer对象,传输数据.确定被拖动元素以及作为放置目标的元素能够接受什么操作,为此需要访问对象的两个属性dropEffect和ef ...
- [ZETCODE]wxWidgets教程一:介紹
本教程原文链接:http://zetcode.com/gui/wxwidgets/introduction/ 翻译:瓶哥 日期:2013年11月26日星期二 邮箱: 414236069@qq.com ...
- HW4.23
public class Solution { public static void main(String[] args) { double sum = 0; for(int i = 1; i &l ...
- hdoj 3836 Equivalent Sets【scc&&缩点】【求最少加多少条边使图强连通】
Equivalent Sets Time Limit: 12000/4000 MS (Java/Others) Memory Limit: 104857/104857 K (Java/Other ...
- hdoj 1286 找新朋友【欧拉函数】
找新朋友 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submis ...
- oc学习之路----多级指针的使用和内存分析
---恢复内容开始--- 精髓:要熟悉指针的使用,首先要熟悉指针的各种状态存得是什么数据.(以一级指针 int *p1 二级指针:int **p2 三级指针:int ***p3为例) 一级指针:*p1 ...