Linux下编译安装Apache及模块
文章这里解说怎样在linux下编译 Apache,以及怎样编译Apache模块。
linux下编译Apache
|
$ wget http://apache.fayea.com//httpd/httpd-2.4.12.tar.gz
$ tar -zxf httpd-2.4.12.tar.gz
$ cd httpd-2.4.12
$ ./configure --prefix=/usr/local/apache/
$ make && make install
|
|
$ ./configure --prefix=/usr/local/apache/
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... no
configure: error: APR not found. Please read the documentation.
|
这里是由于Apache编译依赖 apr。没找到 apr 就无法正常安装。另外,Apache还依赖 apr-util 和 pcre
编译Apache依赖
|
$ wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
$ tar -zxf apr-1.5.2.tar.gz
$ cd apr-1.5.2
$ ./configure --prefix=/usr/local/apr
$ make && make install
|
|
$ wget http://archive.apache.org/dist/apr/apr-util-1.5.3.tar.gz
$ tar -zxf apr-util-1.5.3.tar.gz
$ cd apr-util-1.5.3
$ ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
$ make && make install
|
|
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
$ tar -zxf pcre-8.37.tar.gz
$ cd pcre-8.37
$ ./configure --prefix=/usr/local/pcre
$ make && make install
|
|
$ ./configure --prefix=/usr/local/apache/ \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-pcre=/usr/local/pcre
$ make && make install
|
编译Apache模块
|
$ wget http://apmod.googlecode.com/svn/trunk/mod_concatx/mod_concatx.c
$ ln -s /usr/local/apache/bin/apxs /usr/local/bin/apxs
$ apxs -c mod_concatx.c
|
|
$ apxs -iac mod_concatx.c
|
|
$ /usr/local/apache/bin/httpd -k start
|
假设想关闭Apache, 就使用下面命令:
|
$ /usr/local/apache/bin/httpd -k stop
|
|
$ /usr/local/apache/bin/httpd -M
Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_event_module (static) authn_file_module (shared) authn_core_module (shared) authz_host_module (shared) authz_groupfile_module (shared) authz_user_module (shared) authz_core_module (shared) access_compat_module (shared) auth_basic_module (shared) reqtimeout_module (shared) filter_module (shared) mime_module (shared) log_config_module (shared) env_module (shared) headers_module (shared) setenvif_module (shared) version_module (shared) unixd_module (shared) status_module (shared) autoindex_module (shared) dir_module (shared) alias_module (shared) concatx_module (shared) |
Apache无法正常执行的解决的方法
1. 80port被占用
|
$ netstat -anp | grep :80
|
2. 防火墙默认禁用80port
|
$ vi /etc/sysconfig/iptables
|
|
$ service iptables restart
|
Linux下编译安装Apache及模块的更多相关文章
- Linux下编译安装Apache Http Server
Linux下编译安装Apache Http Server [TOC] 1.下载httpd-2.4.12.tar.bz2 wget http://mirror.bit.edu.cn/apache/htt ...
- Linux下编译安装Apache 2.4
Linux一般会自带httpd服务,但是版本一般不是最新,性能也不是最好,生产中建议手动安装官方源码包,安装Apache官方包之前首先要停止之前的httpd服务,停止后也可以卸载之前的版本 准备工作做 ...
- linux下编译安装apache
在linux(CentOS6.5)上安装Apache,要首先确保以下程序事先安装 apr:The mission of the Apache Portable Runtime (APR) projec ...
- Linux下编译安装Apache报APR not found错误的解决办法
我在编译安装完Nginx.MySQL和PHP(见之前一篇博客:LNMP环境搭建详细教程)之后,进行apache的编译安装: cd /usr/local/src wget http:.tar.gz ta ...
- linux中编译安装Apache、PHP、MySQL(上)
1.简介 在阿里云买了个云服务器,一直没时间折腾.过了近十天了吧,才有时间好好玩玩这个云服务器.自己是做Web开发的,所以我需要的开发环境是LAMP.之前打算是采用yum安装,不过yum安装apach ...
- 在linux下手动安装 apache, php, mysql--终极版
在linux下手动安装 apache, php, mysql: 参考: http://www.cnblogs.com/lufangtao/archive/2012/12/30/2839679.html ...
- Linux下编译安装qemu和libvirt
目录 [hide] 1 安装qemu 1.1 qemu介绍 1.2 下载源文件 1.3 编译安装 2 安装libvirt 2.1 libvirt介绍 2.2 下载libvirt 2.3 编译安装 3 ...
- Linux下编译安装qemu和libvirt【转】
转自:http://www.cnblogs.com/findumars/p/5679742.html 目录 [hide] 1 安装qemu 1.1 qemu介绍 1.2 下载源文件 1.3 编译安装 ...
- CentOS 下编译安装Apache
CentOS 下编译安装Apache 卸载原有的apache 首先从 http://httpd.apache.or 下载apache源码包httpd-2.4.4.tar.gz然后从 http://ap ...
随机推荐
- IIS7.5 提示未在本地计算机上注册“Microsoft.Jet.OleDb.4.0”提供程序
在WIN7 X64平台IIS7.5,使用Asp.net连接access数据库时候,提示:未在本地计算机上注册“Microsoft.Jet.OleDb.4.0”提供程序. 说明: 执行当前 Web 请求 ...
- 自定义圆形imageview
import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapShader ...
- 记一次T-SQL查询优化 索引的重要性
概述 在一次调优一个项目组件的性能问题时,发现SQL的设计真的是非常的重要,所以写一篇博文来记录总结一下. 环境介绍 这个项目组件是一个Window服务,内部在使用轮循机会在处理一个事件表中的事件,将 ...
- sql server 导出
http://ssat.codeplex.com/SourceControl/latest 用于连接sql server
- shell 中 2>&1 的使用
一 相关知识 1)默认地,标准的输入为键盘,但是也可以来自文件或管道(pipe |). 2)默认地,标准的输出为终端(terminal),但是也可以重定向到文件,管道或后引号(backquotes ` ...
- The partial sum problem
算法:搜索 描述 One day,Tom's girlfriend give him an array A which contains N integers and asked him:Can yo ...
- asp.net能不托管吗?
弱弱地问一句,整个部署在IIS中的asp.net项目能不托管吗? 或者说有没有用纯粹的非托管语言(比方说C语言)写的非托管asp.net项目?
- golang 阻塞的坑
1.写go程序的时候一定要牢记主线程不能阻塞,一旦阻塞就崩溃,就怕那种某种情况下偶尔会出现几下阻塞的,一定要杜绝.2.select case的执行顺序是乱的,不确定的3.写入管道的时候,一定要保证管道 ...
- 1.1HTML的基本概念
1.WWW有3个基本的组成部分,分别是URL(统一资源定位器),HTTP(超文本传输协议),HTML(本文本标记语言). 2.一个HTML文件是由一系列的元素和标签组成的,元素不区分大小写. 3.&l ...
- (function(){})(jQuery)的功能和用途?
1.为什么开发插件都这么写? 2.为什么要穿jQuery进去?在方法中直接用jquery的方法什么的不行吗? 1 首先(function(){})()这种写法 是创建了一个匿名的方法并立即执行(fun ...