./configure配置Nginx连环失败

先看完再操作 千万不要一边看一边跟着做,中间有多余出错的步骤

1、BUG1:启动配置文件出错

在这里插入图片描述
./configure
./configure配置Nginx连环失败_第1张图片
./configure配置Nginx连环失败_第2张图片

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

2、BUG1解决办法

安装pcre-devel解决问题
yum -y install pcre-devel

3、BUG2:yum源 镜像出错

[root@localhost yum.repos.d]# yum -y install pcre-devel
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
 * base: ftp.sjtu.edu.cn
 * extras: ftp.sjtu.edu.cn
 * updates: mirrors.163.com
http://mirrors.163.com/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.163.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.ustc.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.ustc.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.bupt.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.bupt.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.dgut.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.dgut.edu.cn; 未知的错误"
正在尝试其它镜像。
http://ftp.sjtu.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: ftp.sjtu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.huaweicloud.com/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.huaweicloud.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.neusoft.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.neusoft.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.cn99.com/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cn99.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.njupt.edu.cn/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.njupt.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.aliyun.com/centos/7.9.2009/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"
正在尝试其它镜像。
https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"
正在尝试其它镜像。


 One of the configured repositories failed (Docker CE Stable - x86_64),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=docker-ce-stable ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable docker-ce-stable
        or
            subscription-manager repos --disable=docker-ce-stable

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=docker-ce-stable.skip_if_unavailable=true

failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.
https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"

4、BUG2解决办法(未解决)

重新安装源:
方法1:
修改/etc/yum.repos.d/CenOS-Base.repo文件内容
不行:进行方法2:
删除原有的文件: rm -f /etc/yum.repos.d/CentOS-Base.repo
然后重新下载阿里的:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
无法解决 出现BUG3
但是:
ps:如果上述方法没有解决,尝试下面:

删除yum.repos.d目录下所有文件
rm -f /etc/yum.repos.d/*
然后重新下载阿里的:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
依然无法解决还是BUG3

5、出现BUG3:wget无法解析阿里云源

[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2021-11-25 17:41:50--  http://mirrors.aliyun.com/repo/Centos-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 失败:未知的名称或服务。
wget: 无法解析主机地址 “mirrors.aliyun.com”

6、最终发现(已解决)

原来是网络的问题

  1. 修改你的ip和网卡: vim /etc/sysconfig/network-scripts/ifcfg-ens33
    ./configure配置Nginx连环失败_第3张图片
    比如我的问题就是这个gateway出现问题了,我原本的是192.168.0.1
    尝试ping www.baidu.com 如果ping不通,就说明是这个网络的问题了

  2. 修改网络为NAT,并查看网关ip
    ./configure配置Nginx连环失败_第4张图片
    ./configure配置Nginx连环失败_第5张图片
    将上面图1的GEATWAY改成 这里的网关ip192.168.153.2
    然后就发现可以ping通了
    然后就可以尝试上面的BUG1解决办法
    yum -y install pcre-devel
    如果还是不行
    就尝试
    清理缓存:yum clean all
    再重新下载阿里的镜像源:
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    然后就发现下载成功了

测试下载安装:
yum install gcc
也可以 之后就继续下载
yum -y install pcre-devel
然后就成辣

你可能感兴趣的:(分布式微服务,bug,java,sql,数据库)