Saturday, December 31, 2011

WHMCS : CURL Error: 7 - couldn't connect to host

Setup > General settings > Security > API IP Access Restriction

I added both the IP's to the list. The main IP for the reseller account 10.10.10.10 was to be added onto the API list.

http://docs.whmcs.com/ResellerClub#CURL_Error:_7_-_couldn.27t_connect_to_host

However, this did not fix the issue.

The second fix was to check the settings for the server.

Setup > Products & Services > Servers > "Select the server" and click on edit settings button

Check whether all the settings are entered correctly and also check the settings for Secure access.

Check "Enable ssl mode for all connections"

This fixed the issue.

Friday, December 30, 2011

Skype installation

skype installation in Linux

recently i have installed skype on my fedora machine. please note my installation steps;

1. created a yum repository

[root@server1 ~]# cd /etc/yum.repos.d/
[root@server1 yum.repos.d]# cat skype.repo
[skype]
name=Skype Repository
baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/
gpgkey=http://www.skype.com/products/skype/linux/rpm-public-key.asc


[root@server1 yum.repos.d]# yum --nogpgcheck install skype
Dependencies Resolved

==============================================================================================
Package Arch Version Repository Size
==============================================================================================
Installing:
skype i586 2.1.0.81-fc10 skype 19 M

Transaction Summary
==============================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)

Total download size: 19 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 19 M
Transaction Test Succeeded
Running Transaction
Installing : skype-2.1.0.81-fc10.i586 1/1

Installed:
skype.i586 0:2.1.0.81-fc10

Complete!
=======================================

23-05-2013:


MicroSoft released Skype 4.2 version for Linux users

yum remove skype skype-bin
yum install alsa-lib.i686 libXv.i686 libXScrnSaver.i686 qt.i686 qt-x11.i686 pulseaudio-libs.i686 pulseaudio-libs-glib2.i686 alsa-plugins-pulseaudio.i686 qtwebkit.i686
cd /usr/local/src/
wget http://download.skype.com/linux/skype-4.2.0.11-fedora.i586.rpm
rpm -ivh skype-4.2.0.11-fedora.i586.rpm

Friday, December 16, 2011

wrong server load

Recently for the CloudLinux installed server the server load is shown wrongly

for example :

load average: 2136406556.03, 2136819086.23,

This is a known bug in lve0.8.36 kernel where it reports such numbers and the way it handles load on scripts that are seemingly using large I/O. This is corrected with the command `sysctl -w abi.vsyscall32=0`.

OR

sysctl -w kernel.full_loadavg=0

Where previously the variable by default is 1. But this will take some weeks to set the normal load value on your server.But as per the CloudLinux we can fix the issue by update kernel to newer version that is available via:

# yum update kernel
Do it your own risk :)

That is reboot into newer kernel (lve0.8.44).

Thank you,

Thursday, November 24, 2011

LiteSpeed admin pass

How to change the LiteSpeed admin password :

root@server [~]# /usr/local/lsws/admin/misc/admpass.sh

Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

User name [admin]: ajeesh

Please specify the administrator's password.
This is the password required to login the administration Web interface.

Password:
Retype password:
Administrator's username/password is updated successfully!

Friday, November 4, 2011

to clear memory cache

If your server using all your memory and you have no available memory you can safely run this command to clear the memory cache




sync; echo 3 > /proc/sys/vm/drop_caches

Thursday, October 6, 2011

http is not running

Apache not running, httpd is down
[~]# service httpd restart
httpd not running, trying to start


Then i have checked the http error lod and found the following error

[Wed Oct 25 00:00:00 2011] [error] (17)File exists: Cannot create SSLMutex with file `/usr/local/apache/logs/ssl_mutex'
Configuration Failed

Solution:
cd /usr/local/apache/logs/
mv ssl_mutex ssl_mutex_ajeesh
service httpd restart

This fixed my issue.

Sunday, September 11, 2011

mail sending failed

2011-09-10 16:30:09 lowest numbered MX record points to local host: tuxunited.com (while verifying from host mail-yx0-f179.google.com [125.12.125.125])
2011-09-10 16:30:10 H=mail-yx0-f179.google.com [125.12.125.125] F= temporarily rejected RCPT >: lowest numbered MX record points to local host

Solution:

First need to remove the particular domain name from

/etc/remotedomains

and add the domain name in

/etc/localdomains

That is all fixed my issue

Tuesday, September 6, 2011

can not use due to limits - cpanel package

For cpanel new package create you will throw out some error like
"can not use due to limits"

This is mainly when you are trying to add some unlimited package.

So please note that for unlimited package add do not use "unlimited" instead of that use "99999" like that. This fixed my issue.

Softaculous error (Solved) - vtiger

Softaculous error
Installation package could not be found.

This error i got with vtiger installation.

cd /var/softaculous/

I have found that vtiger folder is not gave vtiger.zip file. I have copy that particular folder "vtiger" from another server and fixed my issue.

Saturday, August 20, 2011

Easy Apche can not run

A.
!! Creating backup of working apache in '/usr/local/apache.backup'. !!
!! Symlink encountered (/usr/local/apache/etc), preserving target (conf)... !!
!! Backup of working apache complete. !!

!! Start: Silent httpupdate request !!


!! End: Silent httpupdate request !!

Checking that all tarballs are present and up to date.
Checking that all packages are present and up to date.
!! Trying to auto repair package system !!
!! Package system can not be repaired automatically !!
!! Please visit http://www.cpanel.net/support/could_not_ensurepkgs.htm for help with this error. !!
!! Restoring original working apache !!
!! Executing '/scripts/initsslhttpd' !!
!! Restarting 'httpd' ... !!
!! 'httpd' restart complete. !!
Building global cache for cpanel...Done
!! Executing '/scripts/initfpsuexec' !!
!! Executing '/scripts/initsslhttpd' !!
!! Executing '/scripts/update_apachectl' !!
Compiling report...
Sending report. As some of the attached files may be quite large, this could take a few minutes. Thanks for your patience.
!! If you want to create a support ticket with cPanel regarding this please reference 'BuildAP Report Id': '6207501' !!
Report processed.
!! Feel free to submit a support ticket at https://tickets.cpanel.net/submit/index.cgi?reqtype=tickets !!
!! Verbose logfile is at '/usr/local/cpanel/logs/easy/apache/build.1313811394' !!

While yum update

root@server [/]# yum update
Loaded plugins: fastestmirror, priorities
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/lib64/python2.4/threading.py", line 416, in start
_start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

But for the
yum --disableplugin=fastestmirror update
Worked for me

So i have increased the RAM for my server and tried the easy apache fixed my issue

B. bash-3.2# /scripts/easyapache
Can't locate CDB_File.pm in @INC (@INC contains: /usr/local/cpanel /var/cpanel/perl/easy /scripts /usr/local/lib/perl5/5.8.8/i686-linux /usr/local/lib/perl5/5.8 8.8 /usr/local/lib/perl5/site_perl/5.8.8/i686-linux /usr/local/lib/perl5/site_per rl/5.8.8 /usr/local/lib/perl5/site_perl .) at /usr/local/cpanel/Cpanel/Locale/Uti ils.pm line 12.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/Locale/Utils.pm line 12.
Compilation failed in require at /usr/local/cpanel/Cpanel/Locale.pm line 17.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/Locale.pm line 17.
Compilation failed in require at /usr/local/cpanel/Cpanel/Template.pm line 40.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/Template.pm line 40.
Compilation failed in require at /usr/local/cpanel/Cpanel/AdvConfig.pm line 9.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/AdvConfig.pm line 9.
Compilation failed in require at /var/cpanel/perl/easy/Cpanel/Easy/Utils/HttpdConf.pm line 11.
BEGIN failed--compilation aborted at /var/cpanel/perl/easy/Cpanel/Easy/Utils/HttpdConf.pm line 11.
Compilation failed in require at (eval 32) line 3.
...propagated at /usr/local/lib/perl5/5.8.8/base.pm line 85.
at (eval 30) line 3
at /var/cpanel/perl/easy/Cpanel/Easy.pm line 18
BEGIN failed--compilation aborted at /var/cpanel/perl/easy/Cpanel/Easy.pm line 18.
Compilation failed in require at (eval 1) line 3.
...propagated at /usr/local/lib/perl5/5.8.8/base.pm line 85.
BEGIN failed--compilation aborted at /var/cpanel/perl/easy/Cpanel/Easy/Apache.pm line 8.
Compilation failed in require at /scripts/easyapache line 23.

Solution : Upgrade the cpnale /scripts/upcp --force

Sunday, August 14, 2011

memcache installation

Installing Memcache in Cpanel server/ Linux Servers

Memcache is a memory caching system to get the memory for where you required more and it used your system memory to a better way

First we need to install the libeven. This API will helps to execute a callback functon when a specific event accure. This is useful when there is a timeout is occured for a particular process.

Installtion is covered in three steps

Step 1: Libevent
#cd usr/src/
#wget http://monkey.org/~provos/libevent-2.0.12-stable.tar.gz
#tar -xvf libevent-2.0.12-stable.tar.gz
#cd libevent-2.0.12-stable
#./configure
#make
#make install
: You have to note down the libeven installation location from the above installation. In most cases this will be on /usr/local/lib
Then you need to update the libeven shared libraries for that we want to edit the /etc/ld.so.conf.d
#vi /etc/ld.so.conf.d/libevent.conf --> /usr/local/lib
write and quit from this file
and execute the command
#ldconfig
# ldconfig -v |grep libevent
ibevent_pthreads-2.0.so.5 -> libevent_pthreads.so
libevent_openssl-2.0.so.5 -> libevent_openssl.so
libevent_core-2.0.so.5 -> libevent_core.so
libevent_extra-2.0.so.5 -> libevent_extra.so
libevent-2.0.so.5 -> libevent.so

Step 2 : memcache

Now we can install memcache
#cd /usr/src
#wget http://memcached.googlecode.com/files/memcached-1.4.6.tar.gz
#tar -xvf memcached-1.4.6.tar.gz
#cd memcached-1.4.6
#./configure
#make
#make install
You can confirm the memcache is stalled on your server using the command
#which memcached

Step3: Memcache for php module

#cd /usr/src
#wget http://pecl.php.net/get/memcache-2.2.6.tgz
#tar -xvf memcache-2.2.6.tgz
#cd memcache-2.2.6
#phpize
#./configure
#make
#make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
Now we need to edit the php.ini for the memcache exention. Please confirm the above locaton is your default extension extension_dir. For my this is the same location in my php.ini
So I have added the line [ extension = "memcache.so" ] without the [ ] symbols.
write and quite the php.ini file and restarted the apache server
#/scripts/restartsrv_httpd
Now we can confirm memcache php module has been installed or now using the command
#php -m | grep memcache
and aso touch a info.php file and check the memcache module is listed or now

Thats it you have finished ...

Friday, August 5, 2011

Wordpress timthumb.php Vulnerability

There is a major security vulnerability reported for the wordpress web sites.


This is using the unauthorised themes and plugins from the internet. timthumb.php vulnerability allow your web site visitors to upload files. This vulnerability is insecure , platform independent . This is due to the authors include the script using without any security measures.


Fix -1

1. remove the file named timthumb.php

2. we can find out this using the command " find . -name ‘timthumb.php "

OR

1. change the permission to 000 " chmod 000 timthumb.php "

Fix -2:This is the best way:

By editing the file name we can fix this issue

a.vi timthumb.php

b. Go to line 27

c. Change it to remove all the sites listed like “blogger.com” and “flickr.com”. Once you’re done the line should look like this $allowedSites = array();

Tuesday, July 19, 2011

CloudLinux

CloudLinux Installation in cpanel server With CentOS
wget http://repo.cloudlinux.com/cloudlinux/sources/cln/cpanel2cl
screen -S CL
sh cpanel2cl -k [activation_key]
Check /etc/grub.conf kernel has come or not
shutdown -r -f now -> -r for reboot and -f for fast rboot
recompile Apache with MPM-Worker

Configuration File
etc/container/ve.cfg

After editing this configuration file you need to restart the lve service
/etc/init.d/lvectl reload


1. Useful commands.

A. Scripts for assingin the default memory settings to all the accounts in the cpanel server
for i in `ls /var/cpanel/users|xargs -n1 id -u`; do lvectl set $i; done

B. To enable memory limits
lvectl ubc enable --save

C. Monitoring Commands
lvetop , cat /proc/lve/list , lveinfo -d -l500


1. 503 error / LVE enter -7 in apache error log

lveinfo --period=1d --by-fault=mep --display-username

2. Cannot allocate memory : Could not create child process
Check it out whether the particular user exceeds the memory limit.

++++
I have faced an issue with the installation in one server and which was fixed by creating a simlink

 /etc/grub.conf -> ../boot/grub/grub.conf
 ========

3. No display for   lveinfo

    [~]# lveinfo -d --period=1d -o total_mem_faults
    Error while reading lve_version from database

 Solution :
     service lvestats stop
    mv /var/lve/lveinfo.db /var/lve/lveinfo.db.back
    service lvestats start
 

Saturday, June 25, 2011

loading Apache default page

If you are the web site owner, it is possible you have reached this page because:

* The IP address has changed.
* There has been a server misconfiguration.
* The site may have been moved to a different server.

If you are the owner of this website and were not expecting to see this page, please contact your hosting provider.


Fix:
In my case there was no content on my apache configuration file
1. take a backup of my apache conf file
#cp httpd.conf httpd.conf_bkp_25June11
2./scripts/updateuserdomains
3./scripts/rebuildhttpdconf
4. Restart your apache service httpd restart OR /scripts/restartsrv_httpd

Friday, June 24, 2011

Squirrel mail error

ERROR: Connection dropped by IMAP server.
Query: FETCH 1133:1138,1121,1152,1244:1145,1167,1125,1166:1167,1175 (FLAGS UID RFC822.SIZE INTERNALDATE BODY.PEEK[HEADER.FIELDS (Date To Cc From Subject X-Priority Importance Priority Content-Type)])


Jun 24 00:31:52 ajeesh dovecot: IMAP(ajeesh@tuxunited.com): Disconnected: BUG: Unknown internal error bytes=302/1920


#cd /home/tuxunited/mail/ajeesh@tuxunited.com/cur/

i have seen some unwanted folders. Once i removed those folders from that location fixed my issue.

Wednesday, June 22, 2011

Cannot remove email account from cpanel

If we got an error while removing email account from cpanel. So we have to remove it manually.

These steps help us to remove an email account manually.

1st step :

# cd /home//mail//

We can see all email accounts directories in that location.

Just remove the directory of particular email account from there.

If you want to remove test@tuxunited.com

# cd /home/tuxunited/mail/tuxunited.com

# rm -rf test/

2nd step :

# cd /home/tuxunited/etc/tuxunited.com/

# vi passwd

Remove the entry of ” test ” account.

# vi shadow

Remove the entry of ” test ” account.

3rd step:

# cd /home/tuxunited/.cpanel

# vi email_accounts.cache // cpanel cache for email accounts

Clean that file by removing all entries.

# vi email_accounts.yaml

We can see details of all email accounts . We have to remove entries of that particular account.

Eg: test:

diskquota: 104857600

diskused: 224180

mtime: 1273750383

Then restart cpanel

# service cpanel restart

Check the email account from Cpanel –> Email accounts. It will be removed.

Cannot login all of the email accounts in cpanel

Cannot login all of the email account of a particular domain in cpanel server

We can see the email accounts details of a particular domain under /home//etc//

Eg: ( /home/tom/etc/tuxunited.com )

In that directory we can see all of the email accounts in passwd file. The Passwords are pointed to shadow file .

Eg: /home/tom/etc/tuxunited/passwd

 /home/tom/etc/tuxunited/shadow

In shadow file the 2nd entry is encrypted password. If there is an entry *LOCKED* with the encrypted password , that email account has been locked.

Eg: # vi /home/tuxunited/etc/tuxunited.com/shadow

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

ajeesh:*LOCKED*$1$JbPEsgb7$tyQYmQ7MaPmNyvQNyGZ1p1:14734::::::

anuraj:*LOCKED*$1$PZqJn5iW$Z7yLqlJOdfYHp8dV8OdMo/:14741::::::

ratheesh:*LOCKED*$1$DMc67Xil$uwf66mI1TNuiVA5FRp/ZI1:14746::::::

rajesh:*LOCKED*$1$Y839ThXi$oQIPjz563yOJpJxnNZkd11:14755::::::
=============================================================

The encrypted password should starts with $ . So we need to remove this  *LOCKED* entry from that file. Before doing that take a backup of that shadow file. Then remove these entry.

# vi /home/tuxunited/etc/tuxunited.com/shadow


:%s/*LOCKED*//g

This will removed all of the locked entries from that file. Save the file and retry to login into any of the email account.

Tuesday, June 14, 2011

server Hardening

Linux server/cpanel/VPS Hardening for security

1. Install or compile the missing modules in php & apache , Install or compile the missing modules in php & apache

2. Install Fantastico Deluxe

#cd /usr/local/cpanel/whostmgr/docroot/cgi
#wget -N http://files.betaservant.com/files/free/fantastico_whm_admin.tgz
#tar -xzpf fantastico_whm_admin.tgz
#rm -rf fantastico_whm_admin.tgz
Go to WHM, login as root and click on Tweak Settings, then you should ensure that both the Ioncube loader is selected for the backend copy of PHP. Save changes. >>> not done that time installatiom. i didn't do that time

Now go here:
WHM -> Plugins (orAdd-Ons) -> Fantastico De Luxe WHM Admin (scroll down the left menu).

Upon loading, Fantastico De Luxe WHM Admin will auto-update your existing installation (if existing). All admin files (masterfiles, tarballs, settings etc) will be moved to or created at /var/netenberg.

After the installation complete go to settings
PHPsuexec (*): VERY ESSENTIAL!!! Changing this value will not install or de-install phpsuexec for you.
we have to check phpsuexec is installed or not on the server
# httpd -V
-D SUEXEC_BIN="/usr/local/apache/bin/suexec" >>> so we can put PHPsuexec : as INSTALLED

3. Install CSF
cd /usr/src
wget http://www.configserver.com/free/csf.tgz
tar -xvf csf.tgz
cd csf
sh install.sh
sh remove_apf_bfd.sh
vi /etc/csf/csf.conf change testing mode to "0"
service csf restart

4. Check /tmp, /usr/tmp and /var/tmp permissions. Should be chmod 1777
Check /tmp, /usr/tmp and /var/tmp ownership . Should be owned by root:root

5. Check /etc/resolv.conf for localhost entry. You should not specify 127.0.0.1 or localhost as a nameserver

6. Check php for enable_dl. You should modify /usr/local/lib/php.ini and set:
enable_dl = off This prevents users from loading php modules that affect everyone on the server.

7. Add the following disable_functions to the PHP.INI
disable_functions = ini_alter,system,passthru,shell_exec,leak,listen,chgrp,apache_setenv,define_syslog_variables,openlog,syslog,ftp_exec,
posix_getpwuid,posix_getpwnam

8. Set the following for the open_basedir via PHP configuration:
/home:/tmp:/usr

9. To stop the /tmp directory filling up, you can set the following cron job to have files older than x hours deleted:
0 0 * * * /usr/sbin/tmpwatch --mtime --all 48 /tmp

10. Turn off unwanted services from startup

11. install chkrootkit
cd /usr/src/
wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
tar zxvf chkrootkit.tar.gz
cd chkrootkit-0.49/
make sense
cd /etc/cron.daily
vi chkrootkit.sh
chmod 755 chkrootkit.sh
content :
#!/bin/bash
cd /usr/src/chkrootkit-0.49/
./chkrootkit | mail -s "Daily chkrootkit from server1.tuxunited.com" ajeesh@tuxunited.com

12. INstall rkhunter

Tuesday, June 7, 2011

exim update

In cpanel it is very easy to update Exim mail server

just execute the script : /scripts/eximup

Error:
#While sending emails through squirrel mail
Connection refused 111 Can't open SMTP stream. in exim

#service exim restart
Shutting down exim: [FAILED]
Shutting down spamd: [FAILED]

#service exim status
exim dead but subsys locked

Solution:-
First remove /etc/eximdisable

then /scripts/eximup --force this fixed my issue.

Sunday, June 5, 2011

ssh login failed

[root@ajeesh ~]# ssh root@192.16.15.18
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
a3:d6:34:8d:81:74:aj:ee:sh:B:ka:nn:an:2a:2d:95.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:18
RSA host key for 192.16.15.18 has changed and you have requested strict checking.
Host key verification failed.

Solution:
[root@ajeesh ~]# ssh-keygen -R 192.16.15.18
/root/.ssh/known_hosts updated.
Original contents retained as /root/.ssh/known_hosts.old

suppose you are trying to connect to the server using hostname
Solution:-
[root@ajeesh ~]# ssh-keygen -R server1.ajeesh.com

Saturday, June 4, 2011

ssl login for cpanel

SSL encryption is required for access to this server.


# vi /var/cpanel/cpanel.config

change following
requiressl=1 to requiressl=0
alwaysredirecttossl=1 alwaysredirecttossl=1

finally run the following


# /usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings

Wednesday, June 1, 2011

DNS only cpanel installation

Root login to your server

# cd /usr/src/
# wget http://layer1.cpanel.net/cpanel-dnsonly-install.sea
# chmod 755 cpanel-dnsonly-install.sea
# sh cpanel-dnsonly-install.sea

Friday, May 27, 2011

WHMCS Site URL

If you are changing your WHMCS files to some other location you need to change your Site URL link too on your WHMCS database.

Suppose you have installed your WHMCS on tuxunited.com and now you want to change this software to another subdomain location called tuxunited.com/clients


You can easily change this using PHPMyadmin.
1. First you need to transfer all files and folders for WHMCS to /clients directory
2. Login to PHPMyadmin
3. Select the database which will be get from your configuration.php
4. Select tblconfiguration
5. SystemURL change http://www.tuxunited.com to http://www.tuxunited.com/clients

That is all page will be loaded same as before.

Thursday, May 26, 2011

klipper installation

Kilpper is a cut and paste history(clip board) utility in linux. Which reduced a lot of time for copying and pasting.

# yum install kdebase-workspace*

++++++++++++++++++++++++
Installing:
kdebase-workspace x86_64 4.6.3-5.fc14 /kdebase-workspace-4.6.3-5.fc14.x86_64 30 M
Installing for dependencies:

Transaction Summary
===============================================================
Install 13 Package(s)

Total size: 35 M
Total download size: 5.0 M
Installed size: 43 M

++++++++++++++++++++++++++

SSH login for LDAP users

Login for Ldap users we need to set some small settings on sshd configuration file

1. open your sshd configuration file
vi /etc/ssh/sshd_config file

2. PAMAuthenticationViaKbdInt yes

3. after that restart ssh service
service sshd restart

/usr/sbin/lfd: FAILED

Message:-

The following list of files have FAILED the md5sum comparison test. This means that the file has been changed in some way. This could be a result of an OS update or application upgrade. If the change is unexpected it should be investigated:

/usr/sbin/lfd: FAILED

Executable:

/usr/bin/php


Command Line (often faked in exploits):

/usr/bin/php /home/tuxunited/public_html/page.php

00400000-0087b000 r-xp 00000000 08:03 328849 /usr/bin/php
00a7a000-00ad7000 rw-p 0047a000 08:03 328849 /usr/bin/php
00ad7000-00e6f000 rw-p 00000000 00:00 0 [heap]
360c800000-360c802000 r-xp 00000000 08:03 196871 /usr/lib64/libXau.so.6.0.0
360c802000-360ca01000 ---p 00002000 08:03 196871 /usr/lib64/libXau.so.6.0.0
360ca01000-360ca02000 rw-p 00001000 08:03 196871 /usr/lib64/libXau.so.6.0.0
360cc00000-360cd05000 r-xp 00000000 08:03 196875 /usr/lib64/libX11.so.6.2.0
360cd05000-360cf05000 ---p 00105000 08:03 196875 /usr/lib64/libX11.so.6.2.0
360cf05000-360cf0c000 rw-p 00105000 08:03 196875 /usr/lib64/libX11.so.6.2.0
360d800000-360d810000 r-xp 00000000 08:03 197687 /usr/lib64/libXpm.so.4.11.0

==================================
This is because of your firewall(LFD) software has been updated automatically. If you are sure about the particular file and this was uploaded by you on your account and also you are no more interested to getting this mail anymore please do the following steps

go into WHM, and click on Configserver Firewall at the bottom of the left menu, then scroll down and add the following line to the "ignore list":

cmd:/usr/bin/php /home/tuxunited/public_html/page.php

Google Chrome - installing

Google Chrome - installing from Source

1. First we need to download the source file from
http://www.google.com/chrome/eula.html
2.so you will get a rpm file named google-chrome-stable_current_x86_64.rpm
3. execute the following command

yum install google-chrome-stable_current_x86_64.rpm --nogpgcheck

==============================================================================================
[root@localhost yum.repos.d]# file /usr/bin/passwd
/usr/bin/passwd: setuid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped

[root@localhost yum.repos.d]# cat google-chrome.repo
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1


[root@localhost yum.repos.d]# yum install google-chrome-stable
Loaded plugins: langpacks, presto, refresh-packagekit
google-chrome | 951 B 00:00
rpmfusion-free-updates | 3.3 kB 00:00
skype | 1.2 kB 00:00
updates/metalink | 6.0 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
.
.
.
Total size: 54 M
Total download size: 37 M
Is this ok [y/N]: y
Downloading Packages:


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

thats all you have now installed Google Chrome on your Linux(fedora,centos) machine.

Monday, May 2, 2011

VPS to VPS migration

* If we want to migrate a vps from one hardware node to another hardware node.

For example:-
In Hardware Node 1 VPS :- 999 3 running 10.10.1.10 www.ajeesh.com

I want to transfer this VPS to Hardware Node 2[10.10.6.5]

1. For vzmigrate first make a password less ssh login from HN1 to HN2. Using the ssh key method we can achieve this.

-bash-3.2# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
57:31:fb:ac:5f:6f:36:0f:62:f5:88:09:76:73:47:1a root@Hardwarenode1.com

/]# cat id_rsa.pub
ssh-rsa Adfgdfgdfgdfgdfgdfgdfgdfgdf8P9XlxUtlgdfgdfE4hEduw5ir7oxsnDW9EM0/pm6w5iDpVcU0adoJypzcsNCrsFn/3hwJ2RsWJJzEUy+vYOXS2WdfgdfgdfgdfgdfgSywtHShkIU4jUF4MHNjWmx45StqrAr36IzjwniK9larIs9jCASDFDSFDFS/0ZXjnJgyRSQiju1rSGdYSDFSDFSDFSDFSDFSD== root@Hardwarenode1.com

Next SSH into Hardware Node 2and paste this key to /root/.ssh/authorized_keys

Next:- in screen here 10.10.6.5 is the IP address of HardwareNode2
-bash-3.2# vzmigrate --online -v 10.10.6.5 999
OPT:--online
OPT:-v
OPT:10.10.6.5
Starting online migration of CT 999 to 10.10.6.5
OpenVZ is running...
Loading /etc/vz/vz.conf and /etc/vz/conf/999.conf files
Check IPs on destination node: 10.10.1.10 192.168.0.10
Preparing remote node
Copying config file
999.conf 100% 1709 1.7KB/s 00:00
Saved parameters for CT 999
Creating remote container root dir
Creating remote container private dir
Initializing remote quota
Quota init
Turning remote quota on
Syncing private
Live migrating container...
Suspending container
Setting up checkpoint...
suspend...
get context...
Checkpointing completed succesfully
Dumping container
Setting up checkpoint...
join context..
dump...
Checkpointing completed succesfully
Copying dumpfile
dump.999 100% 514KB 513.6KB/s 00:00
Syncing private (2nd pass)
Syncing 2nd level quota
Dumping 2nd level quota
Copying 2nd level quota
quotadump.999 100% 21 0.0KB/s 00:00
Load 2nd level quota
Undumping container
Restoring container ...
Starting container ...
vzquota : (warning) Quota is running for id 999 already
Container is mounted
undump...
Adding IP address(es): 10.10.1.10 192.168.0.10
Setting CPU units: 1000
get context...
Container start in progress...
Restoring completed succesfully
Resuming container
Resuming...
Times:
Suspend + Dump: 0.53982
Copy dump file: 0.483621
Second rsync: 1.58368
2nd level quota: 0.631729
Undump + Resume: 0.685746
Total time: 3.92459
Cleanup
Killing container
Killing...
Container is unmounted
Removing dumpfiles
Destroying container
Destroying container private area: /home/vz/private/999
Container private area was destroyed

If you don't want to destroy the source vps please execute the following command

# vzmigrate -r no --online -v 10.10.6.5[HN2] 999[VEID of your VPS]

==========================================================
But this migration is only good for same Datacentre(on their LAN). Different Data centre and public transfer it is not a right choice.

rsync -vare ssh HN1:/* /vz/private// --progress --numeric-ids --exclude="/proc/*" --exclude="/dev/*"

HN to HN
rsync -vare ssh HN1(old serverIP):/vz/private//* /vz/private// --progress --numeric-ids
=============================================================

Friday, April 29, 2011

How to detect usb devices

lsusb is a nice tool to check for the usb divices, we can used this to check which are the usb devices currently connected/detected to your Linux Machine. Suppose id you are trying to connect your mobile broadband devices this will help a lot.

[root@tech29 ajeesh]# lsusb
bash: lsusb: command not found
[root@tech29 bus]# which lsusb
/usr/bin/which: no lsusb in (/usr/lib/ccache:/usr/lib/ccache:/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/src/jre1.6.0_24/bin:/home/users/ajeesh/bin:/usr/src/jre1.6.0_24/bin:/usr/src/jre1.6.0_24/bin)

This means that you have not install the lsusb utility on your machine. usbutils will brings lsusb .

[root@tech29 bus]# yum search usbutils
Loaded plugins: presto
========================================================================== Matched: usbutils ===========================================================================
usbutils.i686 : Linux USB utilities

[root@tech29 bus]# yum install usbutils

[root@tech29 bus]# lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Monday, April 18, 2011

Mail server Ip has been black listed

Suppose all our particular range of IPs have been blocked(black listed) in Yahoo/hotmail/etc... In this case we will insist to change the datacentre.

Exim has a wonderful way to solve this issue without changing the datacentre. That is routing the emails through another server. If you have a server in another data centre we can route all the yahoo (or required domains) to our remote server.

In this case we can use EXIM's Routing mailserver using smarthost function. Which means we can route all the emails related to particular domain(suppose YAHOO) through another server. Which IP is not black listed in Yahoo.

Please note down the Routing mail server configuration for EXIM

under "ROUTERS CONFIGURATION" in exim.conf

smarthost:
driver = manualroute
domains = ^yahoo\.* : btinternet.com
transport = remote_smtp
route_data = "host name of the remote server"

After that on your new routing server we need to relay IP for the server in /etc/relayhosts
Otherwise it will throws out an error message

error:-
2011-04-11 14:45:29 H=your.server.com [IP] F= rejected RCPT : your.server.com [IP] is currently not permitted to relay through this server. Perhaps you have not logged into the pop/imap server in the last 30 minutes or do not have SMTP Authentication turned on in your email client.

Saturday, March 12, 2011

RAID - Hardware checking

Continuously check the RAID auditing on your server to avoid to loss of data. Your data center will not monitor your RAID device health.

Here iam trying to explain how to monitor your RAID hardware on your freeBSD as well as Linux

We can check hardware RAID conditions using various commands. These commands are with respect to the RAID hardware manufacturer.

So first we need to understand which hard drive your server is using

dmesg | grep -i RAID

~]# pciconf -lv :- in freeBSD

server [~]# lspci :- In Linux

You will get a out put like

RAID bus controller: 3ware Inc 9xxx-series SATA-RAID

Now we can check the RAID status for this server.

For 3ware
[~]# tw_cli /c0 show

If this software is not installed on your server you need to install .. you can get the full details from the vendor

For Megacli

# MegaCli -LDInfo -LAll -aAll

For Adaptec
[~]# lspci
02:00.0 RAID bus controller: Adaptec AAC-RAID (rev 09)
[~]# grep aac /proc/devices
253 aac

Adaptec AAC raid Monitoring command:
/usr/StorMan/arcconf GETCONFIG 1


Thank you,

Tuesday, March 8, 2011

connecting to clam service

You have successfully installed clamAV service on your WHM. But while scanning your server it will show " connecting to clam service ... " just kept hanging on....

To avoid this error you need to to the following steps

1. WHM > tweat Settings and then change Max cPanel process memory from 256 or 512 to 1024

2. uninstall then reinstall clamAV from WHM > manage plug-in

3. WHM > tweat Settings and then change Max cPanel process memory to " previous value " from 1024

This fixed my issue .....

.htaccess view

Sometimes you can not view your .htaccess files through your cpanel file manager. On that time you can do the following settings to view this hidden file.

Step 1: Go to www.yoursite.com/fileman/fileman.cgi?

Step 2: Select the 'web' folder

Step 3: Select Preferences from the tools menu.

Step 4: Tick the 'File Display' -' Do you want to show hidden files?' checkbox (NB: The directory will refresh showing the hidden files.)

Tuesday, February 15, 2011

mod_wsgi setup

Installing mod_wsgi

For the installation of mod_wsgi first you need to install mysql-python

"yum install python26-devel"

By using the easyapache script you can install this module on your cpanel servers. Basically if you run easyapache script this module is not on the list. To make list this module on your easyapache script you need execute the following command

wget http://easyapache.cpanel.net/optmods/$NAME.tar.gz
tar -C /var/cpanel/easy/apache/custom_opt_mods -xzf $NAME.tar.gz

Here it is

tar -C /var/cpanel/easy/apache/custom_opt_mods -xzf ModWSGI.tar.gz

You can find all the custom module on http://docs.cpanel.net/twiki/bin/view/EasyApache3/CustomMods

Once you do this then mod_wsgi will be list on your easyapache script

Friday, February 4, 2011

redirection

Using .htaccess we can do the redirection

Regular Expression:-
. (full stop) - match any character
* (asterix) - match zero or more of the previous symbol
+ (plus) - match one or more of the previous symbol
? (question) - match zero or one of the previous symbol
\? (backslash-something) - match special characters
^ (caret) - match the start of a string
$ (dollar) - match the end of a string

redirect abc.com to abc.com/blog/
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.abc.com$
RewriteRule ^/?$ "http\:\/\/www\.abc\.com\/blog" [R=301,L]

redirecting abc.com/def.com to xyz.com[ie primarydomain.com/addondomain.com to anotherdomain/any]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc\.com\/def\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.abc.com\/def\.com$ [OR]
RewriteRule ^/?$ "http\:\/\/www\.xyz\.com\/404.php" [R=301,L]


Redirecting parked domain to another website
RewriteEngine on
RewriteCond %{HTTP_HOST} ^parkedomain.com$
RewriteRule ^(.*)$ http://anydomain.com/$1 [R=301]

OR
RewriteCond %{HTTP_HOST} ^parkeddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.parkeddomain.com$
RewriteRule ^/?$ "http\:\/\/www\.otherdomain\.com" [R=301,L]

Friday, January 28, 2011

customize cpanel

If you want to customize your cpanel Sometimes it is very safe to restrict limited icons to your client cpanel to avoid some messes.

If you have a WHM account you can make a feature list and which can be add to your package. Here i am explaining how to enable a feature list and which is added to the particular domain.

1. Login to your WHM.
2. Click on Feature Manager menu
3. Type a new feature list name and hit the Add button.
4. Select which all are the icons you want, and deselect which icons you don't want.
5. Hit the Save button
6. After that click Edit Package menu
7. Select the package name which your particular domain is using, and then click Edit button.
8. Go to the bottom where you can see Feature List and a drop down option.
8. Select the new feature list name(which you have made on step 3) and click the Save Changes button.

Thanks,

Thursday, January 27, 2011

Virus in Windows

There is one type of virus that we are all seen in windows machine is Folders inside the folder. Some time these folders we can not delete because of the invalid file name. In Windows based machine we can not make any files with invalid words. But viruses can make this folders on your windows machine :)

Once we have these issue, we will use antivirus such as Nod32 and AVG etc ...These antivirus packages can delete these invalid files.

But without installing these Antivirus we can delete these folders using DOS commands

For deleting

rd /S "\\?\c:\path to your folder/file name"

here we use "rd" command instead of using "del" command.

Friday, January 21, 2011

wget for windows

wget Command

Most us know "wget" is a command which is monopoly to unix based OS. We can use wget command now in wondows based systems also. Using wget you can download and retrieve files softwares using the protocol such as http and ftp. Why iam introducing this if any one don't know about this, use at least one genuine software on your windows machine :-) . wget is a free open software which you can use your own property.

Windows users can get more information here :
http://gnuwin32.sourceforge.net/packages/wget.htm

After installing this software you can retrieve files on your DOS prompt
usage : wget download path
wget http://download.admod.net/ezeelogin_4.9.34_debug.bin

Saturday, January 1, 2011

myisam_sort_buffer_size

Database error: Invalid SQL: select * from members where email='
ajeeshbkannan@gmail.com' and password='ajeeshbkanan'
*MySQL Error*:144 Table './table name' is marked as crashed
and last (automatic?) repair failed

This is may due to myisam_sort_buffer_size is too small. I have increased mysql buffer size from 64Mb to 256Mb, and fixed my issue.

You can verify table by using the command,
mysql> check table tablename;

All your comments are welcomed ...