http://httpd.apache.org/download.cgi

httpd-2.4.29.tar.gz

#创建httpd用户
groupadd httpd
useradd -g httpd -s /sbin/nologin -M httpd tar zxvf httpd-2.4..tar.gz
cd httpd-2.4.
./configure --prefix =/usr/local/apache
make && make install

编译apache时可能会出错:
#./configure --prefix……检查编辑环境时出现:
checking for APR... no
configure: error: APR not found . Please read the documentation
解决办法:

安装 apr  apr-util  pcre

https://apr.apache.org/download.cgi

apr-1.6.3.tar.gz

./configure --prefix=/usr/local/apr
make && make install

apr-util-1.6.1.tar.gz

./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config
make && make install

编译apr-util时报错:make[1]: *** [xml/apr_xml.lo] Error 1

解决方法:yum -y install expat-devel

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/

pcre-8.38.zip

./configure --prefix=/usr/local/pcre

make && make install

然后安装Apache:

./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

/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_ParserCreate'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_GetErrorCode'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_SetUserData'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_ErrorString'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_SetEntityDeclHandler'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_ParserFree'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_SetElementHandler'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_StopParser'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_Parse'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_SetCharacterDataHandler'
collect2: ld returned exit status
make[]: *** [htpasswd] Error
make[]: Leaving directory `/root/zhouw/package/httpd-2.4./support'
make[]: *** [all-recursive] Error
make[]: Leaving directory `/root/zhouw/package/httpd-2.4./support'
make: *** [all-recursive] Error

make 时上面报错,尝试用 apr-1.5.2 版本

下载地址: http://archive.apache.org/dist/apr/

wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz

wget http://archive.apache.org/dist/apr/apr-util-1.5.2.tar.gz

安装方法与上面 1.6版本一样,果然成功了。应该是 CentOS7 才支持 apr-1.6 版本。

安装完成后,切到安装目录,/usr/local/apache

# vim conf/httpd.conf  #配置“Listen”和“ServerName”属性;

Listen 80

ServerName localhost

# ./bin/apachectl configtest

Syntax OK

# 启动httpd

/usr/local/apache/bin/apachectl start | stop | restart

或者:

cp /usr/local/apache/bin/apachectl /etc/init.d/httpd

/etc/init.d/httpd start

Linux上安装Apache服务器的更多相关文章

  1. 【转】如何在win10(64位系统)上安装apache服务器

    如何在win10(64位系统)上安装apache服务器 今天装了Apache服务器,下面是我总结的方法: 一,准备软件 1.64位的apache版本 传送门:http://www.apacheloun ...

  2. [运维] 如何在 Linux 上安装 Nginx 服务器(一)

    原因 因为小程序对素材的大小是由要求的, 所以为了简化小程序上的内存要求, 在Linux上安装nginx来作为静态资源服务器, 这篇为第一篇, 主要介绍怎么在Linux上安装nginx, 下一篇将会介 ...

  3. 如何在win10(64位系统)上安装apache服务器

    今天装了Apache服务器,下面是我总结的方法: 一,准备软件 1.64位的apache版本 传送门:http://www.apachelounge.com/download/ 2.VC11运行库 下 ...

  4. linux上安装apache

    1 安装aprtar -zxvf apr-1.4.2.tar.gz cd apr-1.4.2.tar.gz ./configure  --prefix=/usr/local/aprmake  & ...

  5. linux上安装apache以及httpd.conf基本配置

    1.yum安装apache #yum install httpd -y 2.随系统自启动 #chkconfig httpd on 3.开启apache #service httpd start PS: ...

  6. [转]CentOS6 Linux上安装ss5服务器

    本文章转自:http://blog.csdn.net/cuiyifang/article/details/10346239 最后我增加了添加防火墙规则的部分.感谢作者. ss5是常见的socks5 p ...

  7. linux 上安装apache 出现 configure: error: APR not found. Please read the documentation错误

    今日编译apache时出错: #./configure --prefix……检查编辑环境时出现: checking for APR... noconfigure: error: APR not fou ...

  8. 在Linux系统上查看Apache服务器的错误日志

    错误日志和访问日志文件为系统管理员提供了有用的信息,比如,为 Web 服务器排障,保护系统不受各种各样的恶意活动侵犯,或者只是进行各种各样的分析以监控 HTTP 服务器.根据你 Web 服务器配置的不 ...

  9. 在Linux上用Apache搭建Git服务器

    在Linux上用Apache搭建Git服务器   最近在学Linux,终于在Linux上用Apache搭建起了Git服务器,在此记录一下. 服务器:阿里云服务器 Linux版本:CentOS 6.5 ...

随机推荐

  1. Java 内存模型及GC原理

    一个优秀Java程序员,必须了解Java内存模型.GC工作原理,以及如何优化GC的性能.与GC进行有限的交互,有一些应用程序对性能要求较高,例如嵌入式系统.实时系统等,只有全面提升内存的管理效率,才能 ...

  2. re.sub用法

    re.sub功能是对于一个输入的字符串,利用正则表达式,来实现字符串替换处理的功能返回处理后的字符串 re.sub共有五个参数 三个必选参数pattern,repl,string 两个可选参数coun ...

  3. Database: coursera assignment 1

    q.1: Find the titles of all movies directed by Steven Spielberg. select title from moviewhere direct ...

  4. nginx高可用配置

    可参考资料: http://www.cnblogs.com/holbrook/archive/2012/10/25/2738475.html http://blog.csdn.net/e4210834 ...

  5. 图形绘制处理逻辑VC

    // 逻辑1:先从资源中读取背景资源,然后将绘图对象与DC绑定,通过绘图对象绘出背景 // 逻辑2:先从资源中读取背景资源,新建一个MEMDC,将绘图对象与MEMDC绑定,并且 // 通过绘图对象在内 ...

  6. C++ 构造函数+析构函数

    3-2 构造函数的调用 Time Limit: 1000MS Memory limit: 65536K 题目描述 通过本题目的练习可以掌握构造函数和析构函数的调用: 创建类A:类中仅包含构造函数和析构 ...

  7. java入门了解05

    1.模板模式 (一)需求:解决默写事情有固定模式,但有时内部会发生变化,此时就需要应用模板模式编写此过程 从而解决事情的流程依然可以别使用,这就是模板模式的好处(类似我们的个人简历模板) (二)步骤: ...

  8. eclipse批量修改package、import中的包名

    问题:想把以前开发的包,用到新项目中,怎么操作呢? 解决方案: 把文件夹复制到新项目包中,同时需要更改很多package.import中的包名第一步:打开一个java文件,选中要替换的字段: 第二步: ...

  9. C#高性能Socket服务器SocketAsyncEventArgs的实现(IOCP)

    网址:http://blog.csdn.net/zhujunxxxxx/article/details/43573879 引言 我一直在探寻一个高性能的Socket客户端代码.以前,我使用Socket ...

  10. L93

    Three Days to See(Excerpts) All of us have read thrilling stories in which the hero had only a limit ...