码迷,mamicode.com
首页 > Web开发 > 详细

CentOS下编译安装Apache(httpd)

时间:2015-10-08 16:27:44      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:

官网下载最新版本的apache, apr, apr-util

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

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

 

VirtualBox下CenOS6.4

  apr-1.5.2.tar.gz

  apr-util-1.5.4.tar.gz

  httpd-2.4.16.tar.gz

 

 

1 安装gcc

yum install gcc

 

2 安装apr

./configure

make && make install

 

3 安装apr-util

./configure --with-apr=/usr/local/apr

make && make install

 

4 安装Apahce

./configure

如果在编译中出现
1 configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

执行yum install pcre pcre-devel

再次./configure

make && make install

 

开启服务 /usr/local/apache2/bin/apachetl start

报错:

AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using localhost.localdomain.

Set the ‘ServerName‘ directive globally to suppress this message

修改httpd.conf

vim /usr/local/apache2/conf/httpd.conf

添加 ServerName localhost.localdomain

重新开启服务

技术分享

 注:默认文件位于 /usr/local/apache2/htdocs/index.html

 

5 将自编译安装的Apache2添加为系统服务

转到该篇

 

CentOS下编译安装Apache(httpd)

标签:

原文地址:http://www.cnblogs.com/roronoa-sqd/p/4861140.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!