安装apache2.4.x指南
2015-06-16 11:06
639 查看
该文章用于记录个人centOS 7安装apache2.4.x遇到的问题,写得不好勿喷。
1、首先到下载httpd-2.4.12.tar.bz2:# wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.12.tar.bz2
# tar jvxf httpd-2.4.12.tar.bz2
2、安装APR和APR-util:
# wget http://apache.dataguru.cn//apr/apr-1.5.2.tar.bz2
# wget http://apache.dataguru.cn//apr/apr-util-1.5.4.tar.bz2
# tar jvxf apr-1.5.2.tar.bz2
# tar jvxf apr-util-1.5.4.tar.bz2
将APR和APR-util源码下载,解压放到httpd-2.4.12/srclib里面,并去除版本号
cp -rapr-1.5.2 httpd-2.4.12/srclib/apr
cp -rapr-util-1.5.4 httpd-2.4.12/srclib/apr-util
如果不执行以上代码会出现以下错误:
configure: error: Bundled APR requested
but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.
3、安装pcre、gcc-c++和zlib-devel
yum install -y pcre pcre-devel //安装pcre
yum
install -y gcc gcc-c++ //没有权限请用root或sudo 不安装出现错误:configure: error: You need a C++ compiler for C++ support.
yum install -y zlib-devel //安装zlib-devel
4、配置一下apache参数:
# cd httpd-2.2.24
# sudo ./configure \
--prefix=/usr/local/apache2 \
--with-included-apr \
--enable-so \
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared \
--with-pcre
# sudo make
# sudo make install
*如果是root权限忽略前面的sudo
之后就配置apache,百度一下,跳过;
启动apache之前先检验配置文件是否正确:
# /usr/local/apache2/bin/apachectl -t //出现Syntax OK就是可以了
启动
# sudo /usr/local/apache2/bin/apachectl
start
相关文章推荐
- 分布式查询工具-Apache Drill
- Apache Tika
- Apache服务【手工编译安装】
- Apache Qpid 高可用集群
- CentOS安装\卸载 apache、mysql、php
- mac下apache和php的简要记录
- Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/Nestabl
- SVN与Apache整合
- 如何在同一台VPS上使用apache绑定多个域名(亲测可行!!!)
- Apache的配置技巧
- Apache连接PHP后无法启动问题解决思路
- Apache Hadoop安装部署
- Apache Shiro框架简介
- Apache Shiro框架简介
- ubuntu server 10.04 apache2:安装webalizer、awstats
- ubuntu server 10.04:apache1:安装ssl
- java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory的解决办法
- Mac内建Apache开机启动
- Apache 下网站首页设定
- Apache HBase快照介绍