在 Centos7 上启用 Kerberos 后,Apache 中的 unixODBC 中断

在 Centos7 上启用 Kerberos 后,Apache 中的 unixODBC 中断

unixODBC 运行良好。我们决定实施 Kerberos 身份验证,将 Apache 中的不同站点锁定到特定用户组。启用此功能后,通过 Apache(使用 PHP)连接到数据库就不再有效。

我可以使用 sqlcmd 从同一个框中获得成功的连接。查看源代码时,我的输出是:

Teams: Could not connect.
Array
(
    [0] => Array
        (
            [0] => HYT00
            [SQLSTATE] => HYT00
            [1] => 0
            [code] => 0
            [2] => [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
            [message] => [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
        )

    [1] => Array
        (
            [0] => 08001
            [SQLSTATE] => 08001
            [1] => 10013
            [code] => 10013
            [2] => [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x271D
            [message] => [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x271D
        )

    [2] => Array
        (
            [0] => 08001
            [SQLSTATE] => 08001
            [1] => 10013
            [code] => 10013
            [2] => [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
            [message] => [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
        )

我已阅读了不少关于类似问题的文章,但似乎没有什么突出或有效的。

任何指导都将不胜感激。

-韦斯

答案1

我想到了!

我记得曾经弄乱过一些 SELinux 属性... 再次搜索后,我发现该值为httpd_can_network_connect_db。我getsebool对其执行了 ,发现它已关闭...

已执行:sudo setsebool httpd_can_network_connect_db 1一切都完美!

后续问题:每次重启后这是否会重置?

相关内容