- 论坛徽章:
- 0
|
我以前都可以的,但这次新装的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
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”这段代码,但问题也依旧。。。 |
|