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 ...
随机推荐
- hdu 5108
//题意是给一个数N,然后让你求M,使得N/M为素数,并且M的值最小 //思路呢,大概有两种,一个是遍历素数求解的,不过数据太大不现实 //另外一种就是质因数求解,for循环是遍历质因数,然后whil ...
- JQuery图片轮换 nivoSlider图片轮换
效果图: 第一步:添加引用 <script src="jquery-ui-1.9.2.custom.min.js" type="text/javascript&qu ...
- JS相关链接
给开发者提供的 35 款 JavaScript 图形图表库: http://news.cnblogs.com/n/201518/ 主题:[前端必看]JavaScript推荐资料合集: http://w ...
- GDI+基础(1)
转载:http://www.cnblogs.com/peterzb/archive/2009/07/19/1526555.html System.Drawing 命名空间提供了对 GDI+ 基本图形功 ...
- Hyper-V下的Linux虚拟机网卡丢失问题原因及解决办法
Hyper-V下的Linux虚拟机网卡丢失问题原因及解决办法 虚拟化大势所趋 公司推行了虚拟化,全部用的是Microsoft Windows 2008 R2 Enterprise with Hyp ...
- [转]C++强制类型转换
dynamic_cast: 通常在基类和派生类之间转换时使用,run-time castconst_cast: 主要针对const和volatile的转换. static_cast: ...
- Secure CRT 如何连接虚拟机里面的CentOS系统——当主机使用无线网的时候 作者原创 欢迎转载
第一步:设置自己的无线网,并且分享给VM8这个虚拟网卡 第二步:查看VM8网卡的IP地址,如图是192.168.137.1 第三步:设置虚拟机的配置:选择VM8网卡并且是NAT的 第四步:设置虚拟机里 ...
- 细说PHP优化那些事
我们在用PHP编程的时候,总是想要使自己的程序占用资源最小,运行速度更快,代码量更少.往往我们在追求这些的同时却失去了很多东西.下面我想讲讲我对PHP优化的理解.优化的目的是花最少的代价换来最快的运行 ...
- 淘宝接口实现ip归属地查询
<?php header('content-type:text/html;charset=utf-8'); /*获取当前ip归属地 调用淘宝接口 */ function get_ip_place ...
- arclist标签和list标签区别
很多站长朋友在刚入门织梦的时候对织梦的标签存在很多的困惑,关于arclist标签和list标签,甚至不知道啥时候用arclist,啥时用list标签.arclist 为自由列表,全局模板中都生效,一般 ...