Friday, January 25, 2013

ImageMagick install in cPanel/WHM server

First we need to check ImageMagick is installed in the server.
[~]#/scripts/checkimagemagick
missing

[~]#/scripts/installimagemagick

Appending installation info to /usr/lib64/perl5/perllocal.pod
OK
Successfully installed Image-Magick-6.77
1 distribution installed
ImageMagick installed ok

[~]# convert --version
Version: ImageMagick 6.8.0-1 2013-01-24 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP 

WHM -> Software -> Module Installers -> PHP Pecl > click manage
Install a PHP Pecl box type " imagick "and click "Install Now"

[~]#/scripts/restartsrv_httpd

root@ajeesh [~]# /scripts/checkimagemagick
ok

Uninstalling
/scripts/cleanimagemagick
WHM -> Software -> Module Installers -> PHP Pecl and click uninstall Imagick.

Friday, January 11, 2013

Memory set for a Xen Node

After installing a Xen server we need to cap the Xen Node's total Moemory, If it is not set ,the Total memory of the server will assigned to "Domain-0" and we can not add new VPS on this newly created Xen Node.

We can cap the host node memory by editing /etc/grub.conf ,
Suppose we want to cap 512MB RAM then we should add dom0_mem=512m at the end of Kernel parameter.

title CentOS (2.6.18-308.24.1.el5xen)
        root (hd0,0)
        kernel /boot/xen.gz-3.4.4 dom0_mem=512m
        module /boot/vmlinuz-2.6.18-308.24.1.el5xen ro root=LABEL=/
        module /boot/initrd-2.6.18-308.24.1.el5xen.img

After this changed i have rebooted the server.

#] shutdown -r -f now

  Before capping :
[root@server.ajeesh ~]# free -m
total used free shared buffers cached
Mem: 3521 1386 2134 0 148 931
-/+ buffers/cache: 305 3215
Swap: 4094 0 4094


xm info
total_memory : 4094
free_memory : 4

After the capping :

 [root@server.ajeesh ~]# free -m
total used free shared buffers cached
Mem: 512 418 93 0 35 181
-/+ buffers/cache: 200 311
Swap: 4094 0 4094

Xm info
 total_memory : 4094
free_memory : 3013



Can not create VPS in Solsvm Xen

First we need to check the Xen logs here /var/log/xen/xend.log
root@server10.ajeesh]# tail -f /var/log/xen/

VmError: Kernel image does not exist: /boot/solus-vmlinuz

If you found this error simply execute the following commands and your vps get added.

php /usr/local/solusvm/includes/xenkernel.php

Thursday, January 3, 2013

Restarting MediaCore service

Please note down the steps to restart the mediaCore service.

Media core default port is 5000

1. change the directory to the installed location :
2. execute this command
source mediacore_env/bin/activate
You will get the Media core Environment
(mediacore_env)

3.
(mediacore_env)root@server [media core installed location]# paster serve --daemon --reload development.ini
Starting subprocess with file monitor
Entering daemon mode

4. root@server [/]# netstat -lpn | grep :5000
tcp 0 0 serverIP:5000 0.0.0.0:* LISTEN 11402/python

Tuesday, January 1, 2013

WHM/cPanel 500 error

Internal Server Error 500
No response from subprocess (whostmgr (cpanel)) with exit signal: 0

# tail -f /usr/local/cpanel/logs/error_log
warn [whostmgr10] Unable to write datastore file: /root/.cpanel/datastore/_usr_local_cpanel_cpanel_-F: target directory does not match uid 0 at /usr/local/cpanel/Cpanel/CachedCommand/Save.pm line 24
        Cpanel::CachedCommand::Save::_savefile('/root/.cpanel/datastore/_usr_local_cpanel_cpanel_-F', SCALAR(0x100ed20)) called at /usr/local/cpanel/Cpanel/CachedCommand.pm line 210
        Cpanel::CachedCommand::_cached_cmd('binary', '/usr/local/cpanel/cpanel', 'args', ARRAY(0x10479f0), 'mtime', 1356972302) called at /usr/local/cpanel/Cpanel/CachedCommand.pm line 27

I have seen some root files are in wrong file permission. After correcting this i have restarted my cPanel service in the server fixed my issue.

service cpanel restart

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