Error: === [root@host ~]# yum update Loading “installonlyn” plugin Setting up Update Process Setting up repositories Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=i386&repo=os error was [Errno 4] IOError: Error: Cannot find a valid baseurl for repo: base Fix: === This error is due to the disabled recursion queries in /etc/named.conf file. \ From: ==== options { directory [...]
Archive for the ‘GENERAL’ Category
Yum Update Error
Posted in Dns, GENERAL, LINUX, VPS on January 1, 2009 | Leave a Comment »
Change server time in VPS.
Posted in GENERAL, LINUX, VPS on January 1, 2009 | Leave a Comment »
How to change server time in VPS. ====================== Actually it is not possible to to change time inside the VPS however it is possible to change timezone. The timezone can be changed using standard Linux method by replacing the /etc/localtime with correct timezone which we want. This can be done by just copying the required [...]
Removing audit.d – can hang your server:
Posted in GENERAL, LINUX, SCRIPT, SERVICES on December 31, 2008 | Leave a Comment »
Stoping audit: ========= 1. chkconfig audit off 2. service audit stop Make sure it’s stopped: =============== ps -ef | grep auditd It also involves a kernel module (named “auditd”), which you may also want to disable. Doing so will prevent the userspace tools that support auditing from generating errors when they can no longer find [...]
Cleaning ghosts Apache semaphores:
Posted in Apache, GENERAL, LINUX on December 31, 2008 | Leave a Comment »
Symptoms: ======== Apache hangs with semget: No space left on device error message on /etc/httpd/logs/error_log Cause: ===== About every system semaphore is used. Apache 1.3.27 can leave them used if killed. Resolutions: ======== Close these semaphores. Checking out which proccess is using Semaphores: ============================== # ipcs -s If there is lots of lines owned by [...]
Yum error: unable to open database file
Posted in GENERAL, LINUX, SERVICES on December 31, 2008 | Leave a Comment »
Symptoms: ======= ‘yum update’ result File â/usr/lib/python2.4/site-packages/yum/repos.pyâ, line 200, in populateSack sack.populate(repo, with, callback, cacheonly) File â/usr/lib/python2.4/site-packages/yum/yumRepo.pyâ, line 91, in populate dobj = repo.cacheHandler.getPrimary(xml, csum) File â/usr/lib/python2.4/site-packages/yum/sqlitecache.pyâ, line 100, in getPrimary return self._getbase(location, checksum, âprimaryâ) File â/usr/lib/python2.4/site-packages/yum/sqlitecache.pyâ, line 93, in _getbase self.updateSqliteCache(db, parser, checksum, metadatatype) File â/usr/lib/python2.4/site-packages/yum/sqlitecache.pyâ, line 382, in updateSqliteCache cur.execute(âDELETE FROM â+table+ â [...]
Replacing /var/named domains IP addresses with perl
Posted in Dns, GENERAL, LINUX, SCRIPT on December 31, 2008 | Leave a Comment »
Sometimes you moved a domain from one server to another and you do need to change DNS quickly. Perl: === To do it: perl -i.bak -pe “s/0.0.0.0/1.2.3.4/g” /var/named/domain.com.db This example shows how to change from IP 0.0.0.0 to 1.2.3.4 It do also make a backup of /var/named/domain.com.db as /var/named/domain.com.db.bkp If you do not want backup [...]
Recoving a corrupted Postgres Database Index
Posted in GENERAL, LINUX, Mysql on December 31, 2008 | Leave a Comment »
Symptom: ======= * Postgres database make server slow. With “ps auxw | grep postgres” you’ll get a almost 100% CPU use from “postgres: postgres DATABASE [local] SELECT” line * with a pg_dump DATABASE you’ll get: “Attempt to lock table failed. ERROR: cannot open segment 2 of relation pg_class_relname_nsp_index No such file or directory” Problem: ===== [...]
Linux system runlevel:INIT
Posted in GENERAL, LINUX, tagged LINUX on July 2, 2008 | Leave a Comment »
If the system is already up and running, you can use the init command to start/stop the status of the system. Options: 0 halt system 1 single user mode (for maintenance purposes, won’t allow others to login) 3 multi-user mode (normal mode) 5 multi-user mode with GUI started (normal level for [...]
DDOS check via number of connections
Posted in GENERAL, LINUX, SECURITY, tagged LINUX on July 2, 2008 | Leave a Comment »
A quick and usefull command for checking if a server is under ddos is That will list the IPs taking the most amount of connections to a server. It is important to remember that the ddos is becoming more sophistcated and they are using fewer connections with more attacking ips. If this is the case [...]
How to automatically sync date and time on remote server
Posted in GENERAL, LINUX, SERVICES, tagged LINUX, SERVICES on July 2, 2008 | Leave a Comment »
Here’s how we do it on RHEL: Logged in as root: * Create file at /etc/cron.hourly/clockset * with these two lines only: rdate -s time-a.nist.gov > /dev/null hwclock –systohc > /dev/null * chmod 700 /etc/cron.hourly/clockset OR make a crontab entry: 0 6 * * * /etc/cron.hourly/clockset open firewall ports: rdate is for port 37. NTP [...]