Manually unban ip blocked by fail2ban

Well if you have an ip banned then you should deleted as this iptables -L --line-numbers And then run this where chain-name you should replace it with what name you have there for example fail2ban-ssh  iptables -D chain-name 2
read more

How To Restore a cPanel Server from old hard drive

First of all this is a tutorial that you run it on your risk . Any way if you are in this situation a reinstall was done, and you have a snapshot mounted or old hard drive . Also this is in case that you don’t have backup from whm and you can’t import them . We are assuming that your old hard drive is mounted as ‘old-drive’ We sync important configuration from etc . Please after this don’t log out and try to log on your server . Here we re sync also the shadow this mean you will log using old password cd /old-drive/etc/ rsync -avHz user* trueuser* domainips secondarymx...
read more

ERROR: `/var/tmp/geoip/configure’ failed

I am trying to install geoip using pecl install geoip And I get this error “ERROR: `/var/tmp/geoip/configure’ failed” The solution is to install yum install geoip-devel
read more

How to enable Core Dumps in CentOS

To enable core dumps for all daemon, please follow these steps: Edit the /etc/profile. At line 26 of the file, replace this line: ulimit -S -c 0 > /dev/null 2>&1 with this line: ulimit -c unlimited >/dev/null 2>&1 Replace this line (around line 138 ) in /etc/init.d/functions ulimit -S -c 0 >/dev/null 2>&1 with this: ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0} >/dev/null 2>&1 Enable core-dumping globally by editing the /etc/sysconfig/init file and adding the line: DAEMON_COREFILE_LIMIT=’unlimited’ Enable it for specific daemons by adding this line in the...
read more

Unique visitors from apache log file

Well if you ever want to find out from apache log how many unique visitors you have here is one command cat /usr/local/apache/domlogs/domain.log |awk '{print $1}' | sort | uniq | wc -l If you want to find out for a date cat /usr/local/apache/domlogs/domain.log  |  grep "\[05/Sep/2010" |awk '{print $1}' | sort | uniq | wc -l Unique referrers cat /usr/local/apache/domlogs/domain.log | awk '{print $11};' | awk -F / '{print $3}' | sort | uniq Number of hits cat /usr/local/apache/domlogs/domain.log | wc...
read more

Setting up HAProxy with SSL

Well today I was set up a haproxy to use ssl, and did’t figure out from first time how to get only one file for the pem. In haproxy you have only one file with all certificates. So the order is this: cat matrafox.info.key >> matrafox.info.pem cat matrafox.info.crt >> matrafox.info.pem cat intermediate.bundle >> matrafox.info.pem After this just add the bind *:443 ssl crt /etc/ssl/matrafox.info.pem And you will have the right one.
read more

« Previous Entries