Centos

在 Centos7 上啟用 Kerberos 後,Apache 中的 unixODBC 損壞

  • January 30, 2019

讓 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.
       )

雖然我已經閱讀了很多關於類似問題的文章,但似乎沒有什麼特別突出或有效。

任何指導將不勝感激。

-韋斯

我想到了!

我記得不得不弄亂一些 SELinux 屬性……再次搜尋後,我發現該值為httpd_can_network_connect_db. 我對其進行了getsebool操作,發現它已退出…

已執行:sudo setsebool httpd_can_network_connect_db 1一切正常!

後續問題:每次重啟後都會重置嗎?

引用自:https://serverfault.com/questions/951584