Linux安装Apache 2.2.3

今天本来打算安装在Linux下安装httpd-2.2.16.tar.bz2。

从网站下载压缩包,然后开始安装:

以 Tar.bz2 为扩展名的软件包,是用Tar程序打包并用Bzip2程序进行压缩的软件包。它的优点是压缩率非常高,需要使用 “bunzip2 httpd-2.2.16.tar.bz2”进行解压。

然后cd 到解压后的目录

然后执行tar xvf httpd-2.2.16.tar

./configure --prefix=/usr/local/apache --enable-so 设置安装目录和参数设置

    /usr/local/apache 为设置得安装目录

执行,结果出现报错:

configure: error: no acceptable C compiler found in $PATH

网上查找资料,说是少了gcc包,需要从安装盘上找如下包安装:

libf2c-3.3.2-1.i386.rpm
libstdc++-devel-3.3.2-1.i386.rpm
glibc-kernheaders-2.4-8.36.i386.rpm
glibc-headers-2.3.2-101.i386.rpm
glibc-devel-2.3.2-101.i386.rpm
gcc-objc-3.3.2-1.i386.rpm
binutils-2.14.90.0.6-3.i386.rpm
gcc-3.3.2-1.i386.rpm
gcc-c++-3.3.2-1.i386.rpm
automake14-1.4p6-7.noarch.rpm
但是我的安装盘里根本找不到这些文件,我的系统是CentOS5.4

有高手提供方法:如果Linux联网,可以用以下命令yum -y install gcc gcc-c++

高手提供,当然得试试,结果报错:

。。。。。。。。。。。。。。。

http://ftp.nsysu.edu.tw/Linux/CentOS/5.5/extras/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://ftp.tcc.edu.tw/Linux/CentOS/5.5/extras/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://ftp.cs.pu.edu.tw/Linux/CentOS/5.5/extras/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://ftp.stu.edu.tw/Linux/CentOS/5.5/extras/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://centos.mirror.cdnetworks.com/5.5/updates/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://mirrors.163.com/centos/5.5/updates/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://centos.ustc.edu.cn/centos/5.5/updates/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://mirror01.idc.hinet.net/CentOS/5.5/updates/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://ftp.twaren.net/Linux/CentOS/5.5/updates/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://ftp.nsysu.edu.tw/Linux/CentOS/5.5/updates/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://centos.tt.co.kr/5.5/updates/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://ftp.tcc.edu.tw/Linux/CentOS/5.5/updates/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://ftp.stu.edu.tw/Linux/CentOS/5.5/updates/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
http://mirror.khlug.org/centos/5.5/updates/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.i386 0:2.2.3-43.el5.centos set to be updated
--> Finished Dependency Resolutio

。。。。。。。。。。。。。省略部分内容。。。。。。。。。。。。。。。

Error Downloading Packages:
  httpd-2.2.3-43.el5.centos.i386: failure: CentOS/httpd-2.2.3-43.el5.centos.i386.rpm from base: [Errno 256] No more mirrors to try.

继续请教高手:

高手回复:

你的Linux是可以和外网联通 可是好像无法进行域名解析。
按我说的来试试
echo "nameserver 8.8.8.8" > /etc/resolv.conf

然后执行
yum clean all
再安装
yum -y install httpd

然后按照这个步骤继续安装,

..................

出现一系列下载画面

..................

成功。

启动apache:
/etc/init.d/httpd start

文件在/etc/httpd/目录下

访问http://127.0.0.1:80  一切OK。

通过yum安装的版本没问题的 稳定安全。