Try:
rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm –import ftp://mirrors.easynews.com//linux/centos/RPM-GPG-K
Try:
rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm –import ftp://mirrors.easynews.com//linux/centos/RPM-GPG-K
Before you do it
You will have to make sure that both Apache web servers are the same version, I didn’t and it caused some problems.
My hosting company also mentioned that both cPanels must be the same version too, but I’m not sure about this.
You will also need root access to both servers and an SSH client like putty, so go ahead and connect to both servers.
Manually Moving WHM/cPanel accounts
Follow these steps:
1 – In your old server do:
/scripts/pkgacct “username” <------- Don't type the quotes
2 - After the first step is done do:
scp /home/username.tar.gz root@IP:/home/ <------- Where IP is the IP of your destination server
You will be asked for the root password.
3 - In your destination server do:
cd /home
/scripts/restorepkg “username” <------- Don't type the quotes
Disclaimer
Do this at your own risk, it worked fine on my version of WHM/cPanel/CentOS.
If you follow the instruction here:
http://wiki.centos.org/HowTos/FreeNX
You will get an error message from NX client:
The nx service is not available or the nx access was disabled
To fix this, connect to your SSH and type:
cat /var/lib/nxserver/home/.ssh/client.id_dsa.key
Copy the text you get and in your NX client, on your login dialog box go to:
Configure… > General Tab > Key
And paste the text there and you will be fine
Here is a simple script that will show you what IP addresses are making how many requests to your server.
<?php ## Functions ## function getIP($line) { ereg("[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}",$line,$regMatch); $ip = $regMatch[0]; if($ip) return $ip; else return "false"; } function processString($string, $size = 18) { $string = "[ ".$string; $length = strlen($string); $toAdd = $size - $length; for($x = 0; $x < $toAdd; $x++) { $string = $string." "; } $string = $string."]"; return $string; } ## Code ## while (true) { $cmd = "netstat -n | awk '{ print $5 }'"; exec($cmd, $netstatArray); $ipArray = array(); foreach($netstatArray as $line) { $ip = getIP($line); if($ip != "false" && ip != "127.0.0.1") { if(array_key_exists($ip, $ipArray)) { $ipArray[$ip]+=1; } else // if not, count=1 { $ipArray[$ip] = 1; } } } asort($ipArray); system("clear"); foreach($ipArray as $ip => $count) { if ($count < 15) continue; echo processString($ip); echo "\t" .processString(gethostbyaddr($ip), 55); echo "\tTimes Accessed: " .$count ."\n"; } echo str_repeat("-", 50) ."\n"; exec("top -n 1", $top_str); preg_match("#load average:(.+)#i", $top_str[0], $match); echo "Load Average: " .$match[1] ."\n"; echo str_repeat("-", 50) ."\n"; echo 'Showing $count >= 15: (Escape with ctrl+c)' ."\n"; sleep(10); } ?>
After identifying the IP addresses that are sending many requests at once to crash your server, you can ban them using a firewall software. I personally recommend APF: http://rfxnetworks.com/apf.php
You can do:
apf -d THEIPADDRESS SOMECOMMENTLIKEPOSSIBLEDOS
This script was originally written by a former employee of Acenet Inc and was modified by me. Acenet Inc is a great web hosting company with great support and fantastic staff members who will help you 24×7.
Here is some info about Denial of Service attacks (DoS attacks).
http://en.wikipedia.org/wiki/Denial-of-service_attack
I hope this helps someone.
I hope someone will find this useful:
### # Hamid Alipour ### ### # Config ##################################################### urls = ['http://www.P U T Y O U R U R L S H E R E.com/'] url_timeout = 5 sleep_time = 5 * 60 failed_count_before_alarm = 10 sleep_time_on_failure = 15 ##################################################### import urllib2 import winsound import time class SiteMonitor: def __init__(self): pass def start(self): while True: for url in urls: if not self.check_url(url): if not self.is_it_live(url): self.alarm() self.sleep(sleep_time) def is_it_live(self, url): failed_count = 0 while failed_count < failed_count_before_alarm: if not self.check_url(url): failed_count += 1 else: return True self.sleep(sleep_time_on_failure) return False def check_url(self, url): print 'Checking...' + url + '...', try: urllib2.urlopen(url, timeout=url_timeout) except: print 'Failed!' return False print 'Done it\'s up!' return True def alarm(self): print 'Too many failures...' while True: print 'Alarm...' winsound.PlaySound("SystemExit", winsound.SND_ALIAS) def sleep(self, seconds): print 'Sleeping for ' + str(seconds) + ' second(s)...' time.sleep(seconds) print 'Waking up...' def main(): SiteMonitor().start() if __name__ == "__main__": main()
Save it as sitemonitor.py and run it like:
python sitemonitor.py
Or just double click on the file.
Please note: in order to run this, you will have to install Python:
http://www.python.org/download/
Here is how to install ffmpeg:
1 – Create a file named “dag.repo” (no quotes) in “/etc/yum.repos.d”
2 – Copy and paste these lines in it:
[dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=0 enabled=1
You will need a newline at the end of the file.
3 – Then run “yum install ffmpeg ffmpeg-devel” (no quotes)
This should install it with no issues, note that I set gpgcheck=0, if you search for it you will see a lot of people are suggesting: gpgcheck=1 which yields to something like:
warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID X
Here is how to fix this:
(Assume the name of my script is myscript)
1 – Copy your script into /etc/init.d folder
2 – cd /etc/init.d
3 – chmod +x myscript
4 – Add these lines, including #, right after #!/bin/bash or #!/bin/sh:
# chkconfig: 2345 95 20
# description: Some description
# What your script does (not sure if this is necessary though)
# processname: myscript
5 – chkconfig –level 2345 myscript on