apache源码安装
1.apr和apr-util,下载地址: http://apr.apache.org/download.cgi
yum install gcc
yum install libtool
yum install expat-devel
yum install pcre-devel cd apr-1.6.3/
./configure --prefix=/opt/apr
出现以下错误
rm: cannot remove 'libtoolT': No such file or directory
或
include/arch/unix/apr_private.h is unchange
cp configure ./configure.bak
vi configure
#$RM “$cfgfile” #注释掉这行
:wq !./configure --prefix #重新执行上一次相同的命令
make -j 4 #四核运行
make install tar -zxvf apr-util-1.6.1.tar.bz2 #注意不要下载apr-util-1.6.1.tar.gz这个gz文件会出现安装错误
cd apr-util-1.6.1
./configure --prefix=/opt/apr-util --with-apr=/opt/apr
make && make instal
2. 下载安装pcre【如果以及yum安装则跳过此步】
wget https://ftp.pcre.org/pub/pcre/pcre2-10.30.tar.gz
tar -zxvf pcre2-10.30.tar.gz
cd pcre2-10.30
./configure --prefix=/opt/pcre
make && make install
或
yum -y install pcre-devel
3.安装apache
./configure --prefix=/opt/apache --with-apr=/opt/apr --with-apr-util=/opt/apr-util --with-include-apr --enable-so
make && make install
4.你会发现apache stop|restart|start都不成功
Could not reliably determine the server's fully qualified domain name
解决办法
vi httpd.conf
#ServerName www.example.com:
#修改为
ServerName localhost:
5.将apache设定为开机启动
注册Apache到Linux服务
在Linux下用源代码方式编译安装完Apache后,启动关闭Apache可以通过如下命令实现:
/opt/apache/bin/apachectl start|stop|restart
加入开机启动
cp /opt/apache/bin/apachectl /etc/rc.d/init.d/httpd
#链接文件的S61是启动时的序号。
#当init.d目录下有httpd脚本后,我们就可以通过service命令来启动关闭apache了。
ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc3.d/S61httpd
service httpd start | stop | restart
这时有个问题就是:虽然apache已经可以自动启动,但在linux的服务列表中却看不到它,要添加服务,一般通过chkconfig --add xxx来实现,但需要脚本中有相应的信息才行,否则chkconfig就会提示:xxx 服务不支持 chkconfig。所以我们首先编辑httpd脚本,在第2行(#!/bin/sh下面)添加如下注释信息(包括#):
vi /etc/rc.d/init.d/httpd
# chkconfig:
# description: Apache
第一行的3个参数意义分别为:在哪些运行级别启动httpd(3,5);启动序号(S61);关闭序号(K61)。注意:第二行的描述必须要写!保存后执行:
chkconfig --add httpd #所有开机模式下自启动,另外chkconfig httpd on 表示345模式下自启动
就将httpd添加入服务了。在rc3.d、rc5.d路径中将来就会出现S61httpd的链接,其他运行级别路径中会出现K61httpd的链接。
运行下面的命令查看服务,就可以看到httpd的服务了。
chkconfig --list
apache源码安装的更多相关文章
- apache源码安装 转载
转载 1.先进入/usr/local/中创建三个文件夹 apr apr-util apache cd /usr/local目录 mkdir apr mkdir apr-util mkdir apach ...
- 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 ...
- linux下源码安装apache服务
1.搭建静态网站是,我们只需要搭建apache服务即可满足要求. 例如:如果我再客户端游览器输入地址,他会找到192.168.1.100这个服务器,然后根据端口会找到apache服务器.apache他 ...
- 烂泥:php5.6源码安装与apache集成
本文由秀依林枫提供友情赞助,首发于烂泥行天下. apache对php的支持是通过apache的mod_php5模块来支持的,这点与nginx不同.nginx是通过第三方的fastcgi处理器才可以对p ...
- 烂泥:源码安装apache
本文由秀依林枫提供友情赞助,首发于烂泥行天下. 最近要开始学习nagios监控方面的知识了,但是nagios与apache结合的比较紧密,所以本篇文章就先把apache的源码安装学习下. 我们现在分以 ...
随机推荐
- [NHibernate] Guid 作主键速度超慢的背后
http://blog.csdn.net/educast/article/details/6602353 最近遇到了一个让人抓狂的性能问题.生产环境里有一张表的数据量目前达到了 70 万条.结果发现无 ...
- ElasticSearch概述及Linux下的单机ElasticSearch安装
原文链接:http://blog.csdn.net/w12345_ww/article/details/52182264 这两天在项目中要涉及到ElasticSearch的使用,就上网去搜索了一些这方 ...
- python 测试框架之---testtools
在tempest框架中,使用的是testtools为基础框架来运行接口自动化 一.初识 testools是属于python中诸多自动化框架中的一个,官方文档如下: http://testtools.r ...
- 使用curl进行s3服务操作
最近使用curl对s3进行接口测试,本想写个总结文档,但没想到已有前辈写了,就直接搬过来做个记录吧,原文见: http://blog.csdn.net/ganggexiongqi/article/de ...
- spring boot 部署
指定运行的内存 java -Xms10m -Xmx200m -jar xxx.jar spring boot 打包成war包: 让 SpringbootApplication 类继承 SpringBo ...
- iOS - View的抖动效果
/** * 抖动效果 * * @param view 要抖动的view */ - (void)shakeAnimationForView:(UIView *) view { CALayer *view ...
- mui---调用图像裁剪android
mui调用图像裁剪android: var IMAGE_UNSPECIFIED = "image/*"; //相册显示的文件类型 var PHOTOZOOM = 2; // 获取完 ...
- Linux下搭建hadoop开发环境-超详细
先决条件:开发机器需要联网 已安装java 已安装Desktop组 1.上传安装软件到linux上: 2.安装maven,用于管理项目依赖包:以hadoop用户安装apache-maven-3.0.5 ...
- 图论——最小生成树prim+邻接表+堆优化
今天学长对比了最小生成树最快速的求法不管是稠密图还是稀疏图,prim+邻接表+堆优化都能得到一个很不错的速度,所以参考学长的代码打出了下列代码,make_pair还不是很会,大体理解的意思是可以同时绑 ...
- 洛谷P4138 挂饰 背包
正解:背包dp 解题报告: 昂先放链接qwq 感觉还挺妙的,,,真的我觉得我直接做可能是想不到背包的,,,我大概想不出是个背包的QAQ 但是知道是背包之后觉得,哦,好像长得也确实挺背包的吼,而且其实是 ...