免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 12735 | 回复: 6
打印 上一主题 下一主题

[其他] Centos 6.4 安装Apache 2.4.x 无法启动 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-05-10 14:54 |只看该作者 |倒序浏览
我以前都可以的,但这次新装的mini centos,也清除了自带的apache,但错误依旧,编译代码:
1)清理并更新系统:

rpm -qa|grep  httpd
rpm -e httpd
rpm -qa|grep mysql
rpm -e mysql
rpm -qa|grep php
rpm -e php

yum -y remove httpd
yum -y remove php
yum -y remove mysql-server mysql
yum -y remove php-mysql

cd /usr/local/src
wget -c http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz
rpm -e libtool-1.5.22-7.el5_4  
tar -zxvf libtool-2.4.2.tar.gz  
cd libtool-2.4.2  
./configure  
make
make install  

cd ../  

/usr/sbin/groupadd www  
/usr/sbin/useradd -g www www -s /sbin/nologin   
chown -R www:www /home/www   


cd /usr/local/src
tar zxvf pcre-8.32.tar.gz
cd pcre-8.32
./configure --prefix=/usr/local/pcre
make && make install

cd /usr/local/src
wget -c http://www.us.apache.org/dist/apr/apr-1.4.6.tar.gz
tar zxvf apr-1.4.6.tar.gz
cd apr-1.4.6
./configure --prefix=/usr/local/apr
make && make install

cd /usr/local/src
wget -c http://www.us.apache.org/dist/apr/apr-util-1.5.2.tar.gz
tar zxvf apr-util-1.5.2.tar.gz
cd apr-util-1.5.2
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/ --with-mysql=/usr/local/mysql
make && make install

cd /usr/local/src
tar zxvf httpd-2.4.3.tar.gz
cd httpd-2.4.3

rm -f configure
./buildconf
./configure --prefix=/usr/local/apache \
--enable-headers \
--enable-expires \
--enable-so \
--enable-ssl \
--enable-rewrite \
--enable-deflate \
--enable-mime-magic \
--with-apr=/usr/local/apr/ \
--with-apr-util=/usr/local/apr-util/ \
--with-mysql=/usr/local/mysql \
--with-mpm=prefork \
--disable-userdir \
--enable-lib64 \
--libdir=/usr/lib64 \
--with-zlib \
--with-pcre=/usr/local/pcre/bin/pcre-config \
--disable-cgid \
--disable-cgi

设置开机启动:

echo '/usr/local/apache/bin/apachectl start ' >> /etc/rc.local

添加启动命令:

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

开启、重启、关闭 Apache:

service httpd start


第一次启动提示错误:
service httpd restart
AH00557: httpd: apr_sockaddr_info_get() failed for mgrei.imsyou
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message


我修改httpd.conf,将ServerName www.example.com:80 为 ServerName localhost:80

然后再次启动apache,无提示,但页面无法显示,看了下 error_log,错误代码是:
[Fri May 10 14:37:39.882347 2013] [mpm_prefork:notice] [pid 7200] AH00163: Apache/2.4.3 (Unix) configured -- resuming normal operations
[Fri May 10 14:37:39.882822 2013] [core:notice] [pid 7200] AH00094: Command line: '/usr/local/apache/bin/httpd'
[Fri May 10 14:38:22.870420 2013] [mpm_prefork:notice] [pid 7200] AH00173: SIGHUP received.  Attempting to restart
[Fri May 10 14:38:22.900531 2013] [mpm_prefork:notice] [pid 7200] AH00163: Apache/2.4.3 (Unix) configured -- resuming normal operations
[Fri May 10 14:38:22.900586 2013] [core:notice] [pid 7200] AH00094: Command line: '/usr/local/apache/bin/httpd'
[Fri May 10 14:38:56.360934 2013] [mpm_prefork:notice] [pid 7200] AH00173: SIGHUP received.  Attempting to restart
[Fri May 10 14:38:56.375561 2013] [mpm_prefork:notice] [pid 7200] AH00163: Apache/2.4.3 (Unix) configured -- resuming normal operations
[Fri May 10 14:38:56.375625 2013] [core:notice] [pid 7200] AH00094: Command line: '/usr/local/apache/bin/httpd'
[Fri May 10 14:39:28.263554 2013] [mpm_prefork:notice] [pid 7200] AH00169: caught SIGTERM, shutting down
[Fri May 10 14:39:31.730494 2013] [mpm_prefork:notice] [pid 7261] AH00163: Apache/2.4.3 (Unix) configured -- resuming normal operations
[Fri May 10 14:39:31.730939 2013] [core:notice] [pid 7261] AH00094: Command line: '/usr/local/apache/bin/httpd'



求助大侠们。。。这个该怎么办呐??换了2.4.2 2.4.3 2.4.4 都又这个问题。也试过不用“rm -f configure”这段代码,但问题也依旧。。。

论坛徽章:
0
4 [报告]
发表于 2013-05-19 14:25 |只看该作者
本帖最后由 abcfy2 于 2013-05-19 14:27 编辑

那两行不是报错信息,而是警告,无法通过域名解析到自己的主机名而已,配置ServerName强制指定自己的名字就不会有这个提示了。
AH00557: httpd: apr_sockaddr_info_get() failed for mgrei.imsyou这行是说有selinux,关掉selinux试试,如果能正常访问了,就设置一下上下文,用chcon -R就可以了,具体复制/var/www/html的selinux权限就行了。

http://vbird.dic.ksu.edu.tw/linu ... php#www_basic_start
鸟哥对这个问题有所叙述

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
2 [报告]
发表于 2013-05-16 17:14 |只看该作者
在论坛里找个装
apache的帖子吧。
这么简单的一个东西。怎么就搞不起来了呢?

论坛徽章:
0
3 [报告]
发表于 2013-05-19 14:25 |只看该作者
那两行不是报错信息,而是警告,无法通过域名解析到自己的主机名而已,配置ServerName强制指定自己的名字就不会有这个提示了。
AH00557: httpd: apr_sockaddr_info_get() failed for mgrei.imsyou这行是说有selinux,关掉selinux试试,如果能正常访问了,就设置一下上下文,用chcon -R就可以了,具体复制/var/www/html的selinux权限就行了。

论坛徽章:
0
5 [报告]
发表于 2013-05-19 22:52 |只看该作者
我照着LZ的编译参数(不过去掉了几个disable,那个几个参数我有用),完全可以运行,可以看到It works

论坛徽章:
0
6 [报告]
发表于 2013-05-20 16:52 |只看该作者
我的是内网环境,开始启apache的时候,也遇到LZ的问题

解决方法:在httpd.conf中添加ServerName localhost:80

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
7 [报告]
发表于 2013-05-31 19:05 |只看该作者
警告信息可以忽略,不用在意
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP