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 ...
随机推荐
- UML 中关系详解以及在visio中的表示
http://www.cnblogs.com/kittywei/archive/2013/05/15/3079536.html
- VC提交网页表单(一共八篇)
VC提交网页表单-自动评论留言(1)http://blog.csdn.net/wangningyu/article/details/4526357VC提交网页表单-自动评论留言(2)http://bl ...
- Android 删除指定文件代码
package com.tware.pdfdrop; import java.io.File; import android.app.Activity; import android.graphics ...
- Adobe Flash Builder 4.7下载地址及破解补丁(32位&64位)
Adobe FlashBuilder 4.7是开发flex的利器,能显著提高flex的开发效率.最新版的是4.7,去官网上下载时每次都要登录才能下载,特麻烦,这次下载时就把相关的下载地址给记录了下来, ...
- matlab使用reshape时按照列优先原则取元素和摆放元素
参考 http://blog.csdn.net/superdont/article/details/3992033 a=[1 2 3 4] 如果使用b=reshape(a,1,4),则得到的结果是 ...
- MySQL源码 数据结构array
MySQL源码中自己定义了许多数据结构,放在mysys的目录下,源码中通常都使用这些数据结构来组织存放数据,也更容易实现跨平台. 下面先来看下MySQL定义的动态数组: [源代码include/a ...
- 如何禁止anonymous用户访问nexus
nexus在默认情况下是允许anonymous用户浏览仓库,并下载仓库中的jar包的,如果我们搭建的私服是有公网IP的,必须要进行设置,使得anonymous用户的权限被禁用.操作步骤如下: 使用管理 ...
- WPA Supplicant 用法
本文译至:https://wiki.archlinux.org/index.php/WPA_Supplicant_%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29 ...
- selenium webdriver(4)---模拟鼠标键盘操作
webdriver提供Actions来模拟鼠标悬浮.拖拽和键盘输入等操作,详细代码见org.openqa.selenium.interactions.Actions.本文通过几个实例来说明Action ...
- PCB覆铜时的安全距离
覆铜的安全间距(clearance)一般是布线的安全间距的二倍.但是在没有覆铜之前,为布线而设置好了布线的安全间距,那么在随后的覆铜过程中,覆铜的安全间距也会默认是布线的安全距离.这样与预期的结果不一 ...