执行命令:

getsebool -a|grep httpd

发现 
httpd_can_network_connect off

解决: 

setsebool httpd_can_network_connect  && setsebool httpd_can_network_connect_cobbler  && setsebool httpd_can_network_connect_db  && setsebool httpd_can_network_relay 

需要重新启动httpd

systemctl restart httpd.service

 

centos7 centos中apache运行php需要连接mysql一直连不上,telnet访问mysql出错Connection closed by foreign host的更多相关文章

  1. XShell 连接虚拟机中的服务器 失败 、连接中断(Connection closed by foreign host.)

    在使用XShell连接虚拟机中的服务器时,报以下错误并断开连接,之前连接还是挺稳定的,忽然就这样了 Last login: Thu Aug :: from 192.168.1.102 [root@no ...

  2. xshell连接不了虚拟机处理方法(错误提示:Connection closing...Socket close.Connection closed by foreign host.Disconnected from remote host(localhost) at 08:47:23.)

    一.问题描述:xshell连接不了虚拟机,出现错误提示:Connection closing...Socket close.Connection closed by foreign host.Disc ...

  3. linux篇-xshell连接突然报Connection closed by foreign host.

    1问题描述报错 Connection closed by foreign host. Disconnected from remote host(yaoGS) at 155513. 2登入虚拟机 在l ...

  4. CentOS7.1 Xshell 经常掉线 Connection closed by foreign host

    XShell如果经常对CentOS掉线,则VNC肯定连接不上 但是ping CentOS的IP又能ping通,主要原因还是因为sshd的设置问题 #进入ssh目录 cd /etc/ssh #修改ssh ...

  5. CentOS7服务器中apache、php7以及mysql5.7的安装配置代码

    CentOS7服务器中apache.php7以及mysql5.7的配置代码如下所示: yum upgradeyum install net-tools 安装apache (http://m.86822 ...

  6. 【centOS】【xshell】xshell连接虚拟机上的centOS,操作途中突然断开连接,报错:connect closed by foreign host

    如题  xshell连接虚拟机上的centOS,操作途中突然断开连接,报错:connect closed by foreign host 快捷解决方法: 在虚拟机上centOS重新启动网络,即可解决问 ...

  7. Spring Boot连接MySQL长时间不连接后报错`com.mysql.cj.core.exceptions.ConnectionIsClosedException: No operations allowed after connection closed.`的解决办法

    报错:com.mysql.cj.core.exceptions.ConnectionIsClosedException: No operations allowed after connection ...

  8. centos中apache自用常用额外配置记录(xwamp)

    xwamp套件中apache配置,记录下,以免忘记. 配置路径 ${wwwroot_dir}/conf/httpd.conf 配置内容 <ifmodule mod_deflate.c> D ...

  9. CentOS中Apache虚拟主机(virtualHost)设置在/home目录下的若干问题

    在Ubuntu中安装LAMP是非常简单的意见事情.但是在CentOS中却遇到了很多问题. 首先是CentOS中必须手动配置iptables,把80端口开放出来,不然,是访问不到的,开放80端口在/et ...

随机推荐

  1. 数值分析之Neville's Algorithm

        Neville插值方法详解 牛顿的插值方法涉及两个步骤:计算系数,随后评估多项式. 如果插值运作良好使用相同的多项式在x的不同值处重复执行. 要是一点是内插,一种单步计算插值的方法,如Nevi ...

  2. unity3d 射线的原理,基础用法

    射线:射线是3D世界中一个点向一个方向发射的一条无终点的线,在发射轨迹中与其他物体发生碰撞时,它将停止发射 . Ray射线类和RaycastHit射线投射信息类是射线中常用的两个工具类. 用途:射线多 ...

  3. AJAX传输——以XML文件传输为例

    此文档解决以下问题: 一.responseText获取数据 1.AJAX异步传输,get请求方式/post请求方式,输出全部xml数据 二.responseXML获取数据 2.AJAX异步传输,get ...

  4. grep/pgrep/egrep/fgrep

    Differences between grep, pgrep, egrep, and fgrep (Linux): grep grep is an acronym that stands for & ...

  5. exited abnormally with signal 11: Segmentation fault 的相关处理

    前一阵子遇到一个问题,程序打包后,在某个界面总是崩溃,device log只打印了exited abnormally with signal 11: Segmentation fault 网上找了下相 ...

  6. Android 面试题 MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

  7. 【Spark】榨干Spark性能-driver、exector内存突破256M

    榨干Spark性能-driver.exector内存突破256M spark driver memory 256m_百度搜索 Spark executor.memory - CSDN博客 sparkd ...

  8. WPF背景图

    方法一:xaml中:<控件>  <控件.Background><ImageBrush ImageSource="/程序集;component/images/xx ...

  9. centos7.4 开启ftp服务

    1.安装vsftpd yum install -y ftp vsftpd 2.配置/etc/vsftpd/vsftpd.conf 修改项如下: #不允许匿名访问 anonymous_enable=NO ...

  10. hihocoder第237周:三等分带权树

    题目链接 问题描述 给定一棵树,树中每个结点权值为[-100,100]之间的整数.树中包含结点总数不超过1e5.任选两个非根节点A.B,将这两个结点与其父节点断开,可以得到三棵子树.现要求三棵子树的权 ...