Wednesday, December 12, 2012

Flush ARP cache

Recently one of my vps is not responded to the out side internet. This issue was resolved after clearing my arp cache in the main node.

 Please check the commands I have issued
[root@server.ajeesh.com]# ip neigh flush all;arp -n


After this I could able to ping the server and Internet is active on my vps.

Saturday, December 1, 2012

Issue with yum

Please check how i have fixed my yum issue on my vps.

[root@ldap /]# yum -y install openldap-servers openldap-clients
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 309, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 178, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 345, in doCommands
    self._getTs(needTsRemove)
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 101, in _getTs
    self._getTsInfo(remove_only)
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 112, in _getTsInfo
    pkgSack = self.pkgSack
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 662, in
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 502, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 232, in populateSack
    self.doSetup()
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 79, in doSetup
    self.ayum.plugins.run('postreposetup')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 179, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/fastestmirror.py", line 181, in postreposetup_hook
    all_urls = FastestMirror(all_urls).get_mirrorlist()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 333, in get_mirrorlist
    self._poll_mirrors()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 376, in _poll_mirrors
    pollThread.start()
  File "/usr/lib64/python2.4/threading.py", line 416, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread


I have tried with the following command but the issue was not fixed.

[root@ldap /]# yum clean all
Loaded plugins: fastestmirror
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@ldap /]# rm -f /var/lib/rpm/__db*
[root@ldap /]# rpm --rebuilddb

Solution :

[root@ldap /]# rm /dev/urandom
rm: remove character special file `/dev/urandom'? y
[root@ldap /]# mknod -m 644 /dev/urandom c 1 9
[root@ldap /]# logout

exited from CT 3001
You have new mail in /var/spool/mail/root
[root@openvz ~]#
[root@openvz ~]# vzctl restart 3001

[root@ldap /]# yum update

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iitm.ac.in
 * epel: ftp.neowiz.com
 * extras: ftp.iitm.ac.in
 * remi: remi-mirror.dedipower.com
 * updates: ftp.iitm.ac.in
base                                                                                                                                                      | 1.1 kB     00:00    
base/primary                                                                                                                                              | 1.2 MB     00:09    
base                                                                                                                                                                   3591/3591
epel                                                                                                                                                      | 3.7 kB     00:00    
epel/primary_db                                                                                                                                           | 3.8 MB     00:19

open .chm files in Linux

For reading .chm document you need xCHM  application. chm is a Microsoft compressed HTMl application.

ajeesh@tech3:~$ sudo apt-get install xchm
[sudo] password for ajeesh:

The following NEW packages will be installed:
  libchm1 xchm

After this operation, 905 kB of additional disk space will be used.
Do you want to continue [Y/n]? y


After this installation xCHM will be on your Applications => "Office"  section.

Tuesday, November 27, 2012

MySQL Daemon failed to start

[root@server /]# tail -f /var/log/mysqld.log

121126 22:43:33 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
121126 22:43:33 [Note] Plugin 'FEDERATED' is disabled.
121126 22:43:33 InnoDB: The InnoDB memory heap is disabled
121126 22:43:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121126 22:43:33 InnoDB: Compressed tables use zlib 1.2.3
121126 22:43:33 InnoDB: Using Linux native AIO
121126 22:43:33 InnoDB: Initializing buffer pool, size = 128.0M
121126 22:43:33 InnoDB: Completed initialization of buffer pool

InnoDB: Error: pthread_create returned 11

121126 22:43:33 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

I have fixed this by using the following way.

1. Increased my vps RAM from 512 to 1024MB
2. [root@server /]# ulimit -s unlimited
3. [root@server /]# service mysqld start

Wednesday, November 21, 2012

block web sites

we can block web sites using the following methods.

You can block web sites like facebook.com , orkut.com youtube.com etc using this way.

1. Using Anti-virus (Kaspersky)

     Step:1 Login to Parental Control
     Step:2 Seetings > Web=browsing


2. Using your Cisco Router

      ajeesh@tech3:~$ ping youtube.com
      PING youtube.com (74.125.236.38) 56(84) bytes of data.
      64 bytes from maa03s04-in-f6.1e100.net (74.125.236.38): icmp_req=1 ttl=52   time=160 ms

     ajeesh@tech3:~$ whois 74.125.236.38 | grep -E "NetRange|CIDR"
           NetRange:       74.125.0.0 - 74.125.255.255
           CIDR:           74.125.0.0/16


     Step1  : Router> enable
     Step2  : Router# configure terminal
   Step3  : Router(config)#
     Step4  :Router(config)# Ip route 74.125.0.0 255.255.0.0 Null0

Sunday, November 18, 2012

Awstats Direct URL installation for cPanel

 Awstats Direct URL installation for cPanel


For illustrative purposes we are assuming the following:
server hostname: server.example.com
awstats url : http://www.example.com/aw
cPanel primary domain: www.example.com
cPanel account name: example
subfolder where we are installing awstat: aw

Installation Steps:

 root@server [~]# mkdir -p /home/example/public_html/aw

 root@server [~]# cd /home/example/public_html/

 root@server [~]# wget http://www.awstats.org/files/awstats-7.1.tar.gz

(substitute wget link with latest version)

 root@server [~]# tar -zxf  awstats-7.1.tar.gz

 root@server [~]#  rsync -avp awstats-7.1/wwwroot/cgi-bin/     /home/example/public_html/aw/

 root@server [~]# mkdir -p /home/example/public_html/images

 root@server [~]# rsync -avp awstats-7.1/wwwroot/icon/  /home/example/public_html/images/

 root@server [~]# chown -R example.example /home/example/public_html/aw

 root@server [~]# chown -R example.example /home/example/public_html/images

 root@server [~]# chmod 755 /home/example/public_html/aw/*.pl

create .htaccess file with following entries
++++++++++++++++++++++++++++
AddHandler cgi-script .cgi .pl
Options +ExecCGI
+++++++++++++++++++++++++++
 root@server [~]# chmod 755 /home/example/public_html/aw/.htaccess

 root@server [~]# cp -p /home/example/tmp/awstats/awstats.example.com.conf
 /home/example/public_html/aw/

 root@server [~]# chown example.example  /home/example/public_html/aw/awstats.example.com.conf

 root@server [~]# chmod 755  /home/panorami/public_html/aw



Now the awstat output of the domain example.com should be accessible using
the following link

 http://www.example.com/aw/awstats.pl?config=example.com

ref:
http://www.thewebhostinghero.com/tutorials/access-awstats-outside-cpanel.html

Sunday, November 11, 2012

Installating vztop - openvz tools

You can install OpenVz monitoring tools and these utilities are available on OpenVz web site:

http://download.openvz.org/contrib/utils/

For example if you need to install vztop , you can done this by executing a single command.


Ajeesh~]# rpm -ivh http://download.openvz.org/contrib/utils/vzprocps-2.0.11-6.13.swsoft.i386.rpm

Retrieving http://download.openvz.org/contrib/utils/vzprocps-2.0.11-6.13.swsoft.i386.rpm
warning: /var/tmp/rpm-xfer.Z2tESG: Header V3 DSA signature: NOKEY, key ID 2425c37e
Preparing...                ########################################### [100%]
   1:vzprocps               ########################################### [100%]
You have new mail in /var/spool/mail/root

[root@Ajeesh ~]# vztop