Friday, April 23, 2010

TypeError: rpmdb open failed

TypeError: rpmdb open failed
When you install or update a package using yum you will get this error.

solution:

#rm /dev/urandom
#mknod -m 644 /dev/urandom c 1 9




.

Wednesday, April 21, 2010

Transaction Check Error:

When you are running 'yum update' you will get the following error.

Transaction Check Error:
file /usr/share/emacs/site-lisp/psvn.el from install of subversion-1.4.6-0.1.el5.rf conflicts with file from package subversion-1.4.2-2.el5
file /usr/share/xemacs/site-packages/lisp/psvn.el from install of subversion-1.4.6-0.1.el5.rf conflicts with file from package subversion-1.4.2-2.el5
...................
......................


Solution:

# yum erase subversion

After that 'yum update' will work fine.


.

Sunday, April 18, 2010

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

first stop the mysql:
# service mysqld stop

enter into the mysql safe mode
# mysqld_safe --skip-grant-tables &

login as a root with no password
# mysql -uroot mysql

In mysql command prompt
> UPDATE user SET password=PASSWORD("newpassword") WHERE user="root";
> FLUSH PRIVILEGES;
> EXIT

restart the mysql
# /etc/init.d/mysqld restart

Now you can enter in to mysql using the root password "newpassword"



Thursday, April 15, 2010

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

"ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) "

When you restart the mysql you may got this error.

# ps ax | grep mysql

you will get two or more pid of mysql. kill all using the following command.

# kill -9 xxxx xxxx

Now restart the mysql.

.

how to install kloxo panel

how to install kloxo panel:

# wget http://download.lxlabs.com/download/kloxo/production/kloxo-install-master.sh
# sh ./kloxo-install-master.sh


Now you can login into the panel by "http://(ip):7778"
default username : admin
password : admin

.

thread.error: can't start new thread

"thread.error: can't start new thread"
When you try to install some package using yum you will get this error. Because yum-fastestmirror break the yum function. To run yum, disable the fastestmirror.


# vi /etc/yum/pluginconf.d/fastestmirror.conf

enabled=0 (default the value is '1' change it to '0')

# yum shell
Setting up Yum Shell
> update
> exit


Now you can install using yum.


.

Wednesday, April 14, 2010

How to check DDOS Attack on Server

How to check DDOS Attack on Server:

To list the IPs taking the most amounts of connections to a server:

#netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

To check active connections that are open to your server:

# netstat -n | grep :80 |wc -l



.

Saturday, April 10, 2010

How to find the hostname, domainname, ip and os installed in linux

To find the hostname:
You can find the host name using following commands

# hostname
OR
# uname -n
OR
# cat /proc/sys/kernel/hostname
OR
# sysctl kernel.hostname


To find the domainname:
You can find the domainname by

# dnsdomainname

To find the ip address:
You can find the ip address by

# ifconfig

OR

#route -n

To find which OS is installed in linux

# cat /etc/*release*
Or
#cat /etc/issue


.

PRNG is not seeded

Starting sshd: PRNG is not seeded

# service sshd start

starting sshd : PRNG is not seeded


Solution:

# cd /dev/
# ./MAKEDEV generic


Install PhpMyadmin

How to install PhpMyadmin(CentOS)

# yum install phpmyadmin
# service httpd restart

To Test:

http://localhost(or ip)/phpmyadmin

You will get the PhpMyadmin home page. Using Mysql root password you can login.



                        ==============================


Error:


If you got error message when you open the phpmyadmin in webpage like, " 404 page not found....."



You must add the following 'include' and 'alias' in the bottom of the apache configuration file.

Include /etc/phpmyadmin/apache.conf
Alias /phpmyadmin /usr/share/phpmyadmin


Restart the apache and try again...

.

Friday, April 9, 2010

Unable to set capability on running container

Unable to set capability on running container:

# vzctl set 101 --capability net_admin:on --save

Unable to set capability on running container
WARNING: Some of the parameters could not be applied to a running container.
Please consider using --setmode option
Saved parameters for CT 101

Solution:
Restart the vps

#vzctl restart 101

Then do all the steps again.

.

Enable TUN/TAP

How to Enable TUN/TAP
How to configure TUN/TAP

You should do the following steps on the 'node'
To check the tun module has been already loaded on the node.
# lsmod | grep tun
If it is not loaded
# modprobe tun

Allow your container to use the tun/tap device
# vzctl set 101 --devices c:10:200:rw --save
# vzctl set 101 --capability net_admin:on --save

create the character device file inside the container
# vzctl exec 101 mkdir -p /dev/net
# vzctl exec 101 mknod /dev/net/tun c 10 200
# vzctl exec 101 chmod 600 /dev/net/tun


vzctl set {vps_id} --iptables
"iptable_filter iptable_mangle ipt_limit ipt_multiport ipt_tos ipt_TOS
ipt_REJECT ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_LOG ipt_length
ip_conntrack ip_conntrack_ftp ip_conntrack_irc ipt_conntrack ipt_state
ipt_helper iptable_nat ip_nat_ftp ip_nat_irc" --save