Blbnik
Z KHnetWiki
(Rozdíly mezi verzemi)
Řádka 3: | Řádka 3: | ||
==Apache & non-localhost DB & SELinux== | ==Apache & non-localhost DB & SELinux== | ||
- | + | Všiml jsem si toho při instalaci Drupalu na CentOS 6.5 | |
SQLSTATE[HY000] [2003] Can’t connect to MySQL server on ‘xxx.xxx.xxx.xxx’ (13) | SQLSTATE[HY000] [2003] Can’t connect to MySQL server on ‘xxx.xxx.xxx.xxx’ (13) | ||
Řádka 16: | Řádka 16: | ||
to make it work. | to make it work. | ||
Of course, think twice because you make web server a bit less secure, so don’t do that unless you are sure you need it. | Of course, think twice because you make web server a bit less secure, so don’t do that unless you are sure you need it. | ||
+ | |||
+ | Apache má zjevně děsně restriktivní nastavení. Např. si ani nepošle email ... A nadává v podstatě postfix, že nemá přístup do ''/var/spool/postfix'' | ||
+ | |||
+ | setsebool -P httpd_can_sendmail=1 |
Verze z 19. 9. 2014, 18:29
MAC
Pokud někomu budeš dávat ručně MACku, tak opravdu musí začínat na 02: - to je pak "lokální", tedy by jsi se neměl trefit do existující.
Apache & non-localhost DB & SELinux
Všiml jsem si toho při instalaci Drupalu na CentOS 6.5
SQLSTATE[HY000] [2003] Can’t connect to MySQL server on ‘xxx.xxx.xxx.xxx’ (13) One of the things I wish I had found in Google faster when trying to figure out why PHP script refuses to connect to remote MySQL server issuing an error SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'xxx.xxxx.xxx.xxx' (13) I am able to connect from local shell, so first thought was if something wrong with recent Zend Framework upgrade, but after a while I figured out that answer is very simple – SELinux was blocking remote connections from PHP scripts executed by Apache web server. The error code (13) at the end of error message means “permission denied”, so that’s the indication to see if you have similar issue or not. Anyway, login as root and do setsebool -P httpd_can_network_connect=1 to make it work. Of course, think twice because you make web server a bit less secure, so don’t do that unless you are sure you need it.
Apache má zjevně děsně restriktivní nastavení. Např. si ani nepošle email ... A nadává v podstatě postfix, že nemá přístup do /var/spool/postfix
setsebool -P httpd_can_sendmail=1