您的位置:首页 > 运维架构 > Apache

CentOS下编译安装Apache2(新)

2015-10-13 21:31 585 查看
官网下载apache,apr, apr-util,pcre

httpd-2.4.16.tar.gz    http://httpd.apache.org/download.cgi#apache24

apr-1.5.2.tar.gz      http://apr.apache.org/download.cgi
apr-util-1.5.4.tar.gz   

pcre-8.37.tar.gz      http://www.pcre.org/
1 yum安装gcc

yum -y install gcc


2 源码安装apr,apr-util

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

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make
make install


3 源码安装pcre

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


4 源码安装apache

./configure --prefix=/usr/local/apache2/ --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/
make
make install


5 启动服务

/usr/local/apache2/bin/apachectl 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

不影响,浏览器输入虚拟机IP,出现It works! 说明成功。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: