Tag Archives: Linux

PHP cannot exec ping

In httpd error_log, it got icmp open socket: Permission denied It is because the seLinux blocking the httpd for security reason. Two solutions: 1. Disable seLinux (high risk) 2. Build a custom policy to unblock partial permission for httpd To build custom policy, use audit2allow command (may require install) Ref.: http://wiki.centos.org/HowTos/SELinux 1. install audit2allow module… Read More »

MySql status shell script

ref.: http://www.linuxquestions.org/questions/linux-newbie-8/shell-script-to-check-whether-mysql-server-is-running-or-not-721940/ #!/bin/sh if [[ -z `service mysqld status | grep running ` ]] then echo 0 else echo 1 fi