Friday, October 26, 2012

[ERROR] Can't start server : Bind on unix socket: Permission denied

chown mysql:mysql /var/lib/mysql
chown mysql:mysql /var/lib/mysql/*
chmod 660 /var/lib/mysql/*
chown mysql:mysql /var/lib/mysql/mysql
chmod 700 /var/lib/mysql/mysql
chown mysql:mysql /var/lib/mysql/mysql/*
chmod 660 /var/lib/mysql/mysql/


restorecon -Rv /var/lib/mysql

Tuesday, October 16, 2012

How To Setup Iptables On Centos/RHEL

Copy this in file
: /etc/sysconfig/iptables

------------------------------------------------------------------------------
# Generated by iptables-save v1.3.5 on Thu Aug 30 16:57:39 2012
*filter
:INPUT ACCEPT [28:1620]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1359:3919374]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p esp -j ACCEPT
-A RH-Firewall-1-INPUT -p ah -j ACCEPT
-A RH-Firewall-1-INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
#-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
#-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -s 10.0.12.0  -p tcp -m tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -s 99.22.344.21 -p tcp -m tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
---------------------------------------------------------------------------------

Restart the Service:
/etc/init.d/iptables start