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

个人总结Linux centos7 下载Apache 出现的问题总结

2020-07-14 05:58 381 查看

目前时间2020年4月24日,使用Linux安装apache。

1,yum安装:

简单粗暴省心少报错(搞完压缩包安装再用yum,我哭了@……@)

yum install httpd* -y

 

2,压缩包安装:

使用到的镜像网站:http://mirror.bit.edu.cn/apache/httpd/

                                https://mirrors.tuna.tsinghua.edu.cn/apache//apr/

[code]使用码源安装:
下载压缩包:    wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.43.tar.gz

        解压:          tar –xvf httpd-2.4.43.tar.gz

       进入目录:    cd httpd-2.4.43

创建目录: mkdir /usr/local/ apache2

安装:./configure --prefix=/usr/local/apache2/

这里有报错缺少依赖包,configure: error: APR not found.  Please read the documentation.

下载apr码源:wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.5.tar.gz

解压:tar -xvf  apr-1.6.5.tar.gz

[code]cd apr-1.6.5
[code]mkdir /usr/local/apr
[code]./configure --prefix=/usr/local/apr

在这里出了一个报错:-bash: ./configure: No such file or directory

原因是 为找到目录 解决    find -name configure 再次进入  cd  /apr-1.6.5/

[root@TestServer apr-1.6.5]# ./configure --prefix=/usr/local/apr      

make &&make install     

再次安装仍有报错configure: error: APR-util not found.  Please read the documentation.

安装apr-util

wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz

tar apr-util-1.6.1.tar.gz

mkdir /usr/local/apr-util

cd apr-util-1.6.1

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config

make &&make install

一个报错configure: error: APR could not be located. Please use the --with-apr option. 要加上--with-apr=/usr/local/apr

出现一个报错:xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory

解决:

 yum install expat-devel

安装

yum -y install gcc

yum -y install openssl

yum -y install openssl-devel

yum -y install curl

yum -y install curl-devel

yum -y install pcre

yum -y install pcre-devel

yum -y install bzip2

yum -y install bzip2-devel

再次安装:

./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
[root@TestServer httpd-2.4.43]# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

    Server Version: 2.4.43
    Install prefix: /usr/local/apache2
    C compiler:     gcc -std=gnu99
    CFLAGS:          -g -O2 -pthread  
    CPPFLAGS:        -DLINUX -D_REENTRANT -D_GNU_SOURCE  
    LDFLAGS:           
    LIBS:             

    C preprocessor: gcc -E

----------------------------------------------------------------------------------------------------------------------------------------------------------

make  &&make install
-----------------------------------------------------------------------------------------------------------------------------------------------------------

-bash: httpd: command not found   路径PATH未设置

PATH=$PATH:/usr/local/apache2/bin

永久更改  vim /etc/profile  里面加上  PATH=$PATH:/usr/local/apache2/bin 即可。

查看是否安装成功:httpd -t

 

 

 

 

 

 

 

 

                

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: