Pages

Sunday, April 21, 2013

Error While installing FFMPEG on CentOS server “ffmpeg: error while loading shared libraries: libavdevice.so.52:”

After  installing FFMPEG on one of my client server,  I faced following error :

Error :

=========================================================================================
 ffmpegffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory
=========================================================================================

Solution :
Solution on the issue is very simple as follows, Just change your library path by running  below command :
=========================================================================================

root@ip[~]# export LD_LIBRARY_PATH=/usr/local/lib/
=========================================================================================
Its done!

Fatal error: Call to undefined function mb_strtolower() on cPanel server

I was facing following error on my site :
=======================================================
Fatal error: Call to undefined function mb_strtolower() in
=======================================================
Cause :
The error was due to mbstring php module  was not installed.
Solution:
To resolve this issue need to recompile apache with Multibye string(mbstring) module.
Once apache is compiled your error should be gone…Cheers!

yum upgade/update “Transaction Check Error:”

Today While updating yum on one of Centos server I got the following error :
Error :
———————————————————————————————-

Transaction Check Error:file /usr/share/man/man1/xdelta.1.gz from install of xdelta-1.1.4-1.el5.rf.x86_64 conflicts with file from package xdelta-1.1.3-20.i386
Error Summary

———————————————————————————————-

I’ve checked the xdelta package on the server by running the following command :

Error connecting to MySQL: Access denied for user: ‘da_admin@localhost’ (Using password: YES):

Today When connecting to the MySQL in DirectAdmin , I got this error and that would indicated that the “da_admin” user has not been setup correctly. To resolve this I did following:
1) You need to Make sure the root mysql password works. If you know it, Go to mysql,  If you don’t..  then mysql root password can be found in the /usr/local/directadmin/scripts/setup.txt , if it has not been deleted.
It’s under the header “mysql=”.
If it cannot be found, then mysqld will have to be restarted with the –skip-grant-tables option as follows :

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

# [root@test ~]# service mysqld stop
# [root@test ~]# mysqld_safe –skip-grant-tables &

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

This will  start up mysql without the need for a root password. Then run

ModSecurity: Rule execution error – PCRE limits exceeded (-8)

Today while working on one of client’s issue of getting blank page while browsing the website and apache error logs were showing following logs (tail -f /usr/local/apache/logs/error_log):

Error :

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

[Wed 08 12:15:37 2010] [error] [client XX.XX.XX.XX] ModSecurity: Rule execution error – PCRE limits exceeded (-8): (null). [hostname "www.testing.com"] [uri "/forum/login.php"] [unique_id "TDMQWW3LaKoAAGiQ0EYAAAAP"]

==============================================================================
Solution :

In order to solve this error I followed the steps given below :
1) Login to the server as root.
2)Go to directory /usr/local/apache/conf.
Run :

How to install the GeoIP plugin to show country information in Awstats cPanel

Follow these instructions to install and enable the GeoIP plugin in awstats:
Requirement :
1.Root access to server (ssh access)
2. Install GNU Compiler Collection (gcc)
3.Install the GeoIP by executing the following commands in SSH:
Commands :

# wget http://maxmind.com/download/geoip/api/c/GeoIP.tar.gz
# tar xzvf GeoIP.tar.gz
# cd GeoIP*
# ./configure && make && make install

Install the GeoIP Perl module using CPAN :

Friday, April 12, 2013

How to install php.ini manager plugin in WHM

How to install php.ini manager plugin in WHM

PHP.ini Manager (phpinimgr) is a WHM plugin designed to help you manage custom php.ini files for your users. It will list all php.ini files in the users root and www folder. If you are using suPHP, you can laso use PHP.ini Manager to activate, edit and update custom php.ini files for your users.

Installation instructions

To install PHP.ini Manager, open a SSH connection to your server and execute the following commands:

    cd /usr/local/cpanel/whostmgr/docroot/cgi
    wget -O addon_phpinimgr.php http://download.how2.be/whm/phpinimgr/addon_phpinimgr.php.txt
    chmod 700 addon_phpinimgr.php

How to install Installatron Plugin in cpanel/WHM

Installing without a license will install the free edition. This edition is full-featured, includes all applications, and there is no time limit. The only limitation is that the free edition will only work for the first domain that it’s used with.
Installation

For servers that support the RPM packaging standard, execute this command from the SSH root command prompt:

    rpm -Uvh http://data1.installatron.com/installatron-plugin-cpanel-latest.noarch.rpm

For all other servers, execute these commands from the SSH root command prompt:

How to install ConfigServer Mail Queues (cmq)

The product provides you with a full featured interface to the cPanel exim email queues from within WHM.

The ConfigServer Mail Queues can be an essential tool for:

    Determining why inbound or outbound email delivery is failing
    Deleting bounce emails
    Deleting frozen (undeliverable) emails
    Forcing queue runs (especially useful for Smart Router emails to Exchange servers that are intermittently online)
    Integrates with MailScanner, if installed, to offer views/deletion of email in both the Pending and Delivery queues
    Searching for and viewing/deleting emails to/from specific domains and addresses
    Viewing the email history from the exim mail logs for specific emails
    Retry delivery for specific emails

Installation

How to install google apps plugin for cpanel

Go to the below path where you want to download the tar file.

    cd /usr/local/src/

Download the tar file.

    root@testserver.com [/usr/local/src]# wget http://google-apps-wizard-cpanel-plugin.googlecode.com/files/gaw-2.0.tar

    –2012-09-24 15:59:34– http://google-apps-wizard-cpanel-plugin.googlecode.com/files/gaw-2.0.tar
    Resolving google-apps-wizard-cpanel-plugin.googlecode.com… 74.125.31.82, 2404:6800:4008:c00::52
    Connecting to google-apps-wizard-cpanel-plugin.googlecode.com|74.125.31.82|:80… connected.
    HTTP request sent, awaiting response… 200 OK
    Length: 184320 (180K) [application/octet-stream]
    Saving to: `gaw-2.0.tar’

   

How to Uninstall MySQL Governor

Run the below commands to uninstall MySQL Governor



    /usr/share/lve/dbgovernor/install-mysql.py –delete
    yum erase db-governor db-governor-mysql

Upgrading MySQL Governor on CPanel, Plesk and DirectAdmin server

Run the below command to update MySQL Governor

    yum update db-governor db-governor-mysql –enablerepo=cloudlinux-updates-testing

Run the below command to restart the service

    service db_governor restart

How to install MySQL Governor on CPanel, Plesk and DirectAdmin

MySQL governor is set of utilities to monitor and restrict MySQL usage in shared hosting environment. The monitoring is done via USER_STATISTICS table that is available in CloudLinux version of MySQL as well as via tracking of slow queries.

To install MySQL governor on cPanel server

    yum install db-governor –enablerepo=cloudlinux-updates-testing
    /usr/share/lve/dbgovernor/install-mysql.py –install

Note :

MySQL on cPanel servers will be updated from CloudLinux RPMs.

MySQL Governor is compatible only with MySQL 5.x

Upgrade ssh on Linux

#!/bin/bash
#Configuration:
temp_working_directory=/usr/local/src
openssh_source_link=http://filedump.se.rit.edu/pub/OpenBSD/OpenSSH/portable/openssh-5.6p1.tar.gz
install_prefix=/usr

#Saving old sshd init script:
cp -a /etc/rc.d/init.d/sshd /etc/rc.d/init.d/sshd.save

#Uninstall OS installed SSH
rpm -e openssh openssh-clients openssh-server
##Installing OpenSSH 5.6p1 from source:

Too many redirects error with password proted directories for WP-ADMIN from cPanel

You can fix the issue by adding the line “ErrorDocument 401 default” on the main .htaccess file of WordPress

Thread: T=remote_smtp defer (-53): retry time not reached for any host

You can solve this issue on cPanel servers as follows :

/usr/sbin/exim_tidydb -t 1d /var/spool/exim retry > /dev/null
/usr/sbin/exim_tidydb -t 1d /var/spool/exim reject > /dev/null
/usr/sbin/exim_tidydb -t 1d /var/spool/exim wait-remote_smtp > /dev/null

/scripts/courierup — force
/scripts/eximup –force

Unable to use phpmyadmin to search on tables

You have a complex bug fix to this  

open file

/usr/local/cpanel/base/3rdparty/phpMyAdmin/js/tbl_select.js

and replace this:

if(a["fields["+d+"]“]==”")

with this:

if(a["fields["+d+"]“]==”" || a["fields["+d+"]“]==undefined)

Done the trick

phplist is sending 2 mails

This is very simple to fix.

Open the mailing_list_name/config/config.php

in the config file, find define(‘SEND_ONE_TESTMAIL’,0);
change the value from 0 to 1

You did i

Securing PHP

Now a days PHP is an essential part of Web Develop environment, so try to secure from a System Admin’s perspective.

Hardening with php.ini

1) open_basedir = /dir

When the open_basedir parameter is enabled, PHP will be able to access only those files, which are placed in the specified directories

2) expose_php = Off

Turning off the “expose_php” parameter causes that PHP will not disclose information about itself in HTTP headers that are being sent to clients in responses to web requests.

3) register_globals = Off

How to change the primary IP address on cPanel

Edit /etc/sysconfig/network-scripts/ifcfg-eth0

    Change the IPADDR and GATEWAY lines to match the new IP and Gateway for the new ip

Edit /etc/sysconfig/network

    Change the GATEWAY line here if it does not exist in the ifcfg-* file.

Edit /etc/ips

    Remove the new primary IP from this file if it is present
    Add the old primary IP to this file with the format <IP address>:<Net Mask>:<Gateway>

Edit /var/cpanel/mainip

    Replace the old primary IP with the new primary IP

Reinstall Horde on Plesk, because of misbehaving (like authentication issue, broken images)

Please take a backup of the Horde database first to avoid any sort of data loss.

/usr/local/psa/admin/bin/webmailmng --remove --name=horde
rpm -e --nodeps psa-horde psa-imp psa-ingo psa-kronolith psa-mimp psa-mnemo psa-turba
mv /usr/share/psa-horde{,.$(date +%s)}
/usr/local/psa/admin/bin/autoinstaller --select-release-current --select-product-id plesk --install-component horde --reinstall-patch
/usr/local/psa/admin/bin/webmailmng --install --name=horde
/usr/local/psa/admin/bin/webmailmng --enable --name=horde
/usr/local/psa/admin/bin/httpdmng --reconfigure-all

Changing the Webmail Subdomain

Create a custom virtualhost template directory (if one does not already exist):

mkdir -p /usr/local/psa/admin/conf/templates/custom

Then, copy the current webmail configuration template:

cp /usr/local/psa/admin/conf/templates/{default,custom}/domainWebmail.php

Modify the custom template according to the customer’s needs:

subdomain=mail; sed -i.$(date +%s) "s/\(ServerAlias.*\"\)webmail.\(.*\)/\1$subdomain\2/g" /usr/local/psa/admin/conf/templates/custom/domainWebmail.php

IMAP authentication / SASL errors (warning: localhost.localdomain[127.0.0.1]: SASL LOGIN authentication failed: authentication failure)

Plesk 11.x have fix for this but you can fix this error on 10.x also as below :)

mv /usr/lib64/sasl2/smtpd.conf /usr/lib64/sasl2/smtpd.conf.$(date +%s)
cat <<'SASL_CONF_EOF'>/usr/lib64/sasl2/smtpd.conf
pwcheck_method: auxprop saslauthd
auxprop_plugin: sql_sqlite3
saslauthd_path: /var/spool/postfix/private/plesk_saslauthd
mech_list: DIGEST-MD5 CRAM-MD5 PLAIN LOGIN
auto_transition: yes
sql_engine: sqlite3
sql_hostnames: localhost
sql_database: /var/spool/postfix/plesk/passwd.db
sql_select: SELECT `%p` FROM domains d, users u WHERE u.name='%u' and d.name='%r' and d.status=0 and u.status=0 and u.dom_id=d.id
sql_verbose: yes
log_level: 9
SASL_CONF_EOF
service saslauthd restart
service postfix restart

cannot chdir to domain dir domain.com: Permission denied (Plesk postfix)

My nice finding with my previous company MyHosting .com

This error appears when the permissions on the user mail directories are incorrect, which usually shows up after a transfer. You can check the permissions under /var/qmail (even if the mail server is postfix), and his is what correct permissions look like:

# ll /var/qmail
total 8
drwxr-xr-x 7 root    root    4096 Jun 15 18:15 mailnames
drwxr-xr-x 3 popuser popuser 4096 Jun  2 02:48 popuser

# ll /var/qmail/mailnames/
total 16
drwxr-x--- 6 popuser popuser 4096 Jun  2 18:33 plesknew.prepgator.com
drwxr-x--- 2 popuser popuser 4096 Jun 15 18:09 test1.plesknew.prepgator.com
drwxr-x--- 2 popuser popuser 4096 Jun 15 18:09 test2.plesknew.prepgator.com

To fix it, you only need to fix the permissions:

Installation of WildCard SSL on cPanel

1. Make sure domain has dedicated IP

2. Install for the primary domain first in WHM.

3. Navigate in SSH to /var/cpanel/userdata/$username

– Notice the default domain now has a _SSL file for it as well

4. Copy this _SSL file to the next subdomain to install SSL on

–  cp $domain_SSL $sub.domain_SSL

5. Edit the copied file

– Change documentroot, serveralias, and servername

– Save

6. Run /scripts/rebuildhttpdconf && /scripts/restartsrv_httpd

Fild IP address associated with teh server

1)

/sbin/ifconfig | grep “inet addr” | awk -F: ‘{print $2}’ | awk ‘{print $1}’

2)

ip addr | awk ‘/inet / {sub(/\/.*/, “”, $2); print $2}’
To find the public IP address

3)

wget -qO- http://ipecho.net/plain
or
curl http://ipecho.net/plain

4)

curl ifconfig.me

Cpanel backend files

IMPORTANT CPANEL BACKEND FILES AND LOG FILES

/var/cpanel

accounting.log – Contains a list of accounting functions performed such as account removal and creation

cpanel.config – Tweak settings for whm can be done in this file

mainip – Main ip of the server is specified in this file

maxemail – Maximum emails per hour for a domain can be specified here The format is like the following domainname=number

Run the script /scripts/build_maxemails_config after editing this file This will create a file named after the corresponding domain name inside the directory maxemailsperdomain with the value specified in it.

HOW-TO: finding “Nobody” spammer

In this script we will change the sendmail binary with a custom script, because php is using the sendmail to send the mails through script. So the spammer is calling this script instead, which is then logging the user info into a log file before calling the now renamed sendmail.

After installation check /var/log/formmail.log to find spammer activity.
Installation:

Note:- Place take a backup before moving the file to prevent any sort of data loss issue.
mv /usr/sbin/sendmail /usr/sbin/sendmail.act

vim /usr/sbin/sendmail (paste the below code into it)
chmod +x /usr/sbin/sendmail
echo > /var/log/formmail.log
chmod 777 /var/log/formmail.log

Using “imapcopy” to transfer the mails

MAPcopy is a small utility that will help you migrate from one IMAP e-mail message store to a another one.

1) wget http://home.arcor.de/armin.diehl/imapcopy/imapcopy.tar.gz

2) tar -xzvf imapcopy.tar.gz

3) cd imapcopy

4) Edit the file “ImapCopy.cfg”

Adjust the source and destination server. Add the source and destination users and passwords. The following sample copys the users “foo” and “bar” from server source.imap.com port 143 to server dest.imap.com port 145. Passwords for foo are “foosrcpw” and “foodestpw”, for bar “barsrcpw” and “bardstpw”. The folders “Trash”, “Sent” and “Sent Objects” will not be copied.

SourceServer source.imap.com
SourcePort 143
DestServer dest.imap.com
DestPort 145

#CreateEmptyFolders

skipfolder INBOX.Trash
skipfolder INBOX.Sent
skipfolder "INBOX.Sent Objects"

#       SourceUser SourcePassword   DestinationUser DestinationPassword
Copy    "foo"       "foosrcpw"         "foo"          "foodestpw"
Copy    "bar"       "barsrcpw"         "bar"          "bardestpw"

Now verify that all users and passwords are correct:

imapcopy -t

You can also show some information about the used servers:

imapcopy -i

You can copy the mails as:

imapcopy

Mail transfer with IMAPSYNC

It is a tool to sync, migrate copy mails from source IMAP server to the destination servers.

1) Installation (this need Perl module Mail::IMAPClient supports)

yum install imapsync

2) for more details please use the command ‘imapsync –help’

3) You can transfer mails as follows : (you can use for loop with this)

imapsync --host1 imap.src.fr  --user1 buddy --password1 secret1 --host2 imap.dest.fr --user2 max   --password2 secret2

or

imapsync --host1 server1.example.com --user1 sales@example.com --passfile1 /et

Spam filtering with Exim filter on cPanel

1) touch /var/log/filter.log
2) chmod 0644 /var/log/filter.log

3) cp /etc/cpanel_exim_system_filter /etc/cpanel_exim_system_filter_new
Then paste the following code into last of the file “/etc/cpanel_exim_system_filter_new” and save.
—————————————————————————————–
# START
# Filters all incoming an outgoing mail
logfile /var/log/filter.log 0644
## Common Spam
if
# Header Spam
 $header_subject: contains "Pharmaceutical"
 or $header_subject: contains "Viagra"
 or $header_subject: contains "Cialis"
 or $header_subject: contains "RE: DISCOUNT 80% 0FF on Pfizer !"
 or $header_subject: is "The Ultimate Online Pharmaceutical"
 or $header_subject: contains "***SPAM***"
 or $header_subject: contains "[SPAM]"

Installing Master Openvz SolusVM (vps management Control panel) On linux server

Introduction to SolusVM:
Solus Virtual Manager (SolusVM) is a powerful GUI based VPS management control panel with full OpenVZ, Xen Paravirtualization. SolusVM allows you and your clients to manage a VPS cluster with security & ease
1. Basic Requirements :
CentOS 5+ based linux operating system
OpenVZ – Ensure you are running an OpenVZ Kernel
PHP 5.1.6

2.Installing OpenVz Kernal :
Login as root
# cd /usr/local/src
Download latest version of openvz from the link : http://wiki.openvz.org/Download/kernel/2.6.18/028stab056.1 suitable you architecture. I’ve downloaded for x86_64
#wget http://download.openvz.org/kernel/branches/2.6.18/028stab056.1/kernel-2.6.18-ovz028stab056.1.x86_64.rpm
# rpm -ivh kernel-2.6.18-ovz028stab056.1.x86_64.rpm
As well as you can install openvz kernal using Yum, to install openvz kernal using  yum, you should set up OpenVZ yum repository first :
3.Download openvz.repo file and save it to your “/etc/yum.repos.d/” repository as follows :

Fantastico shows error ‘You cannot install more than one script in the root directory of a domain’

In order to solve this issue you should follow these steps:

1. Log in cPanel and click on File Manager;

2. Navigate to .fantasticodata in your Home Directory;

3. Delete the file installed_in_root.php.

This will ensure there is no Fantastico information remaining from previous installations.

Phpmyadmin error : “The Configuration File Now Needs A Secret Passphrase (blowfish_secret)”

After installing phpmyadmin on one of my client server (Centos), I had to face above error after login into phpmyadmin at the bottom of the phpmyadmin page.

Error :
====================================================

”The Configuration File Now Needs A Secret Passphrase (blowfish_secret)”

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

I tried this Soution which resolved the issue :

Solution :
Copy sample Configuration File To Real Configuration File:
# cp -p config.sample.inc.php config.inc.php

If you have already copied the file just locate it and go to the file :
#vi config.inc.php

Find the below line :

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

$cfg['blowfish_secret']  ’ ‘; /* YOU MUST FILL IN THIS FOR COOKIE AUTH!  */

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

Probably on the line number 16 or 18.
You can see its not set, so you need to update  the Blowfish Secret here.
After doing this, Try to visit your phpmyadmin url again and you will see the error is disappeared.

Njoy!!!

Error While installing FFMPEG on CentOS server “ffmpeg: error while loading shared libraries: libavdevice.so.52:”

After  installing FFMPEG on one of my client server,  I faced following error :

Error :

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

root@ip[~]# ffmpegffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

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

Solution :
Solution on the issue is very simple as follows, Just change your library path by running  below command :

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

root@ip[~]#
root@ip[~]# export LD_LIBRARY_PATH=/usr/local/lib/

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

Its done.

Fatal error: Call to undefined function mb_strtolower() on cPanel server

I was facing following error on your site :
=======================================================

Fatal error: Call to undefined function mb_strtolower() in

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

Cause :
The error was due to mbstring php module  was not installed.

Solution:
To resolve this issue need to recompile apache with Multibye string(mbstring) module.
Once apache is compiled your error should be gone.

Error connecting to MySQL: Access denied for user: ‘da_admin@localhost’ (Using password: YES):

Today When connecting to the MySQL in DirectAdmin , I got this error and that would indicated that the “da_admin” user has not been setup correctly. To resolve this I did following:
1) You need to Make sure the root mysql password works. If you know it, Go to mysql,  If you don’t..  then mysql root password can be found in the /usr/local/directadmin/scripts/setup.txt , if it has not been deleted.
It’s under the header “mysql=”.
If it cannot be found, then mysqld will have to be restarted with the –skip-grant-tables option as follows :

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

# [root@test ~]# service mysqld stop
# [root@test ~]# mysqld_safe –skip-grant-tables &

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

This will  start up mysql without the need for a root password. Then run

ModSecurity: Rule execution error – PCRE limits exceeded (-8)

Today while working on one of client’s issue of getting blank page while browsing the website and apache error logs were showing following logs (tail -f /usr/local/apache/logs/error_log):

Error :

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

08 12:15:37 2010] [error] [client XX.XX.XX.XX] ModSecurity: Rule execution error – PCRE limits exceeded (-8): (null). [hostname "www.testing.com"] [uri "/forum/login.php"] [unique_id "TDMQWW3LaKoAAGiQ0EYAAAAP"]

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

Solution :

cPanel error “not a reference at /usr/local/cpanel/Cpanel/DIp/MainIP.pm line 198, Carp::croak(‘not a reference’) called at /usr/lib/perl5/site_perl/5.6.2/x86_64-linux/Storable.pm line 76″

Today I encountered an  error when I log into cpanel and click on “expand stats” as below :
Error :

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

not a reference at /usr/local/cpanel/Cpanel/DIp/MainIP.pm line 198
Carp::croak(‘not a reference’) called at /usr/lib/perl5/site_perl/5.6.2/x86_64-linux/Storable.pm line 76
Storable::logcroak(‘not a reference’) called at /usr/lib/perl5/site_perl/5.6.2/x86_64-linux/Storable.pm line 244

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

Solution :

How to install the GeoIP plugin to show country information in Awstats cPanel

Follow these instructions to install and enable the GeoIP plugin in awstats:
Requirement :

1.Root access to server (ssh access)
2. Install GNU Compiler Collection (gcc)
3.Install the GeoIP by executing the following commands in SSH:

Commands :
# wget http://maxmind.com/download/geoip/api/c/GeoIP.tar.gz
# tar xzvf GeoIP.tar.gz
# cd GeoIP*
# ./configure && make && make install
Install the GeoIP Perl module using CPAN :

How to install extension Managers on Cpanel Server

Installing extension managers like Zend Optimizer or Ion Cube loader without compiling apache on cPanel server is so easy, you can install them using just one script, and the script is located under the normal /scripts directory on Cpanel servers :

/scripts/phpextensionmgr
It provides the options to list, check status , install or remove any of the extensions.
Using below command you can get the list of extension managers available for installation :

root@CpanelServer[~]# /scripts/phpextensionmgr list
Available Extensions:
EAccelerator
IonCubeLoader
Zendopt
SourceGuardian
PHPSuHosin

Now you can check status of any extension using the below command :
root@CpanelServer[~]# /scripts/phpextensionmgr status IonCubeLoader

How do i password protect subdomain directories in plesk

You can protect the subdomain directories in plesk using .htaccess and .htpasswd files. Follow the stpes below :

>> SSH to the server with root user
>> Go to the folder which you want to be password protected :

[root@server ~]# cd /www/vhosts/yourdomai.com/subdomains/directory/httpdocs/
NOTE : “Yourdomain.com” will be replaced with your domain main domain and “Directory” replaced with the folder that you want to protect.

>> Now create .htaccess file :

[root@server ~]# vi .htaccess
Enter the below code in .htaccess file :

Differences between TCP and UDP Protocol

If you want to know the exact difference between TCP and UDP protocol, lets have a look below :
Firstly, What is TCP and UDP protocol :

Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) are the major protocols operating at Transport Layer. Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) operate very differently and you can choose Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) depending on your requirement.

1. TCP Protocol : TCP stands for Transmission Control Protocol and it guarantees delivery of data packets. This protocol provides extensive error checking mechanisms such as flow control and acknowledgment of data. Transmission Control Protocol (TCP) is a connection oriented protocol. Before transmitting data, a connection must be established between the devices participating in data transmission. If your Application require guaranteed delivery of data, then you must choose TCP as the Transport layer protocol.

2. UDP Protocol : UDP stands for User Datagram protocol and it operates in Datagram mode. The main difference you should notice here is User Datagram Protocol (UDP) is a connection-less protocol. User Datagram protocol (UDP) has only the basic error checking mechanism using checksums.
Now I assume that you under stand what is TCP and UDP protocol more than there long forms    Now see Difference between Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) below :

Correcting ownership of all cPanel Users

If you have messed up with the ownership of all the users on a cPanel server, following script will help you to correct the ownership:

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

# Login to server as a root
# create a shell script and enter the code below :
# vi permissions.sh
Code to be entered :

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

for i in `cat /etc/trueuserdomains | awk ‘{print $2}’`
do
/bin/chown $i.$i /home/$i -R;
/bin/chown $i.mail /home/$i/etc -R;
/bin/chown $i.nobody /home/$i/public_html;
done;

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

Save the file and change the permission for the file permissions.
# chmod 755 permissions.sh
Then run the script.
# ./permissions.sh

It will take some time according to the amount of users and The ownership of the home directory of a user, etc and public_tml will be corrected in a one go.

PHP Setting change, register_globals and more using htaccess

In order to change your PHP  setting, from upload limit to register_globals just do the follow:

1) Create a file called .htaccess inside your public_html
(Note: if you want to change PHP 5 settings, you need to put these values in a file called php.ini inside the folder of the php files and
remove the php_value part)
1) Create a file called .htaccess inside your public_html
(Note: if you want to change PHP 5 settings, you need to put these values in a file called php.ini inside the folder of the php files and  remove the php_value part)

2) Edit it and add the line below in this format
php_value value_name newvalue
example:

# to turn off register_globals
php_value register_globals off

How to Change FTP service Port on cPanel server

Today while working come across on the request to change port of the FTP from 21 to some other port that is 921 and I followed the steps below to do so :
Check if your server is using Proftpd and pure-ftpd, To check refer the steps below :

>> Login to your WHM
>> Service Configuration >> FTP Server Selection
>> Here you can see on which radio button is checked.

If you are using pureftpd then follow the steps below :
1. Login to ssh via root
2. Edit /etc/pure-ftpd.conf and look for the following line:
# vi /etc/pure-ftpd.conf
======================

Bind <addr> <port>

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

Example :: #Bind 127.0.0.1,21
Replace it with the below line :

Error PHP Fatal error: Out of memory (allocated 24641536) (tried to allocate 24381441 bytes) on cPanel server with php scripts

Today came across with the memory exhausted error and while investigation note that after increasing the memory in server php.ini file even though increased php memory limit for the particular user as server is suphp enabled, but did not help…
 
While browsing the site I find the error as below under error logs :

==========================================
[root@server/home/username/public_html]# tail -f error_log
[01-May-2012 20:45:55] PHP Fatal error:  Out of memory (allocated 24641536) (tried to allocate 24381441 bytes) in /home/username/public_html/filename.php on line 117

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

Soution 1 :

How to install A2billing with Asterisk on Centos

Asterisk / A2Billing on centos
What is A2Billing
A2Billing is a class 4 and class 5 softswitch with inline billing, designed for providing residential, business and wholesale VoIP services, calling cards.
Prerequisites  :
>> Centos 5 clean and scratch server with yum installed.
>> First the get version of OS and 64bit/32Bit
You can get the version by following the command below ::
#cat /etc/*release*
>> Kernel  versin using the below command ::
#uname -a
>> disable firewall first. re-enable it later.
# service iptables stop
Initial setup to proceed with installation ::
First Get everything up to date on your server, you can update it via yum using commands below ::
#yum -y upgrade
#yum -y update
#reboot
#yum -y update

Need to install first the required modules on the server  as below :

Error while updating YUM

Today While updating yum on one of the server I  face the error as below :
=============================================================
[root@323191 yum.repos.d]# yum update
Loaded plugins: fastestmirror
Setting up Remove Process
No Match for argument: epel
Loading mirror speeds from cached hostfile
Traceback (most recent call last):
File “/usr/bin/yum”, line 29, in <module>
yummain.user_main(sys.argv[1:], exit_code=True)
File “/usr/share/yum-cli/yummain.py”, line 285, in user_main
errcode = main(args)
File “/usr/share/yum-cli/yummain.py”, line 136, in main
result, resultmsgs = base.doCommands()
File “/usr/share/yum-cli/cli.py”, line 438, in doCommands
return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
File “/usr/share/yum-cli/yumcommands.py”, line 419, in doCommand
return base.erasePkgs(extcmds)
File “/usr/share/yum-cli/cli.py”, line 861, in erasePkgs
self._checkMaybeYouMeant(arg, always_output=False)
File “/usr/share/yum-cli/cli.py”, line 647, in _checkMaybeYouMeant
matches = self.doPackageLists(patterns=[arg], ignore_case=False)
File “/usr/lib/python2.6/site-packages/yum/__init__.py”, line 2327, in doPackageLists
avail = self.pkgSack.returnNewestByNameArch(patterns=patterns,
File “/usr/lib/python2.6/site-packages/yum/__init__.py”, line 897, in <lambda>
pkgSack = property(fget=lambda self: self._getSacks(),
File “/usr/lib/python2.6/site-packages/yum/__init__.py”, line 682, in _getSacks
self.repos.populateSack(which=repos)
File “/usr/lib/python2.6/site-packages/yum/repos.py”, line 265, in populateSack
self.doSetup()
File “/usr/lib/python2.6/site-packages/yum/repos.py”, line 92, in doSetup
self.ayum.plugins.run(‘postreposetup’)
File “/usr/lib/python2.6/site-packages/yum/plugins.py”, line 184, in run
func(conduitcls(self, self.base, conf, **kwargs))
=============================================================
Resolution :
Open File: /etc/yum/pluginconf.d/fastestmirror.conf
vi /etc/yum/pluginconf.d/fastestmirror.conf
Change enabled=1 TO enabled=0
and Fire command
[root@323191 yum.repos.d]# yum clean all
[root@323191 yum.repos.d]# yum update
It should be fixed

How to Install FFmpeg on CentOS via Yum

The easiest way to install FFMPEG and other modules is through yum. Following are the steps given to install ffmpeg with yum command.

First we will have to install the DAG RPM repositories which includes amount of rpm packages. It’s very easy. Just install the latest rpmforge-release package for your distribution and architecture.
This will automatically install the configuration and GPG keys that are for safely installing RPMforge packages.

Please select the correct command from the following list:

* Supported Red Hat Enterprise Linux 5 / i386:
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

* Red Hat Enterprise Linux 5 / x86_64:
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

Installing FFMPEG.

How to install google apps plugin for cpanel

Go to the below path where you want to download the tar file.
cd /usr/local/src/
Download the tar file.
root@testserver.com [/usr/local/src]# wget http://google-apps-wizard-cpanel-plugin.googlecode.com/files/gaw-2.0.tar
–2012-09-24 15:59:34– http://google-apps-wizard-cpanel-plugin.googlecode.com/files/gaw-2.0.tar
Resolving google-apps-wizard-cpanel-plugin.googlecode.com… 74.125.31.82, 2404:6800:4008:c00::52
Connecting to google-apps-wizard-cpanel-plugin.googlecode.com|74.125.31.82|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 184320 (180K) [application/octet-stream]
Saving to: `gaw-2.0.tar’
100%[==============================================================================================================================>] 184,320 144K/s in 1.3s
2012-09-24 15:59:41 (144 KB/s) – `gaw-2.0.tar’ saved [184320/184320]
Untar the file using the below command

Wednesday, April 10, 2013

IPtables

Exact meaning of an option which are used in iptable command: -
A – All source
I – INPUT
s – Source
j – jump on
-
Procedure:
For Example: If you want to check IP 49.248.23.83 is blocked or not then fire command
iptables -nL | grep 49.248.23.83

You can see the result as below

DROP all — 49.248.23.83 0.0.0.0/0
DROP all — 0.0.0.0/0 49.248.23.83
 

To redirect the page without changing web address. You can use the below code

Create the index page and insert the below code:
<html>
<body>
<FRAMESET ROWS=”*,0″ FRAMEBORDER=0 BORDER=0 FRAMESPACING=0>
<FRAME SRC=”http://www.domain.com.ie/” NORESIZE>
</FRAMESET>
</body>
</html>
[notice]Change your domain.com to your actual domain name. [/notice]

Command to check mod_pagespeed

Command to check mod_pagespeed is installed in server.

curl -D http://127.0.0.1
You will get below output.

Date: Fri, 07 Sep 2012 21:51:06 GMT
Server: Apache/2.2.3 (CentOS)
X-Mod-Pagespeed: 0.10.22.4-1633