Monday 30 June 2014

How to Install htop

To install htop with yum, the EPEL repository must be installed.

Redhat / CentOS 5 (most likely version in use)



32bit: rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
64bit: rpm -Uvh http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm


Redhat / CentOS 6



32bit: rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
64bit: rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm


Now that the repository is installed to the server, we can install htop

yum install htop


 

Thursday 26 June 2014

How to Disable magic quotes Joomla on Linux Server

Error while accessing modsec control from WHM :Software error

Can’t locate JSON/XS.pm in @INC (@INC contains: /usr/local/cpanel /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/cpanel/Cpanel/JSON.pm line 15.


You can disable magic quotes in joomla by adding the following line to the php.ini file.

magic_quotes_gpc = Off


If it did’t solver the issue you need to add the following lines to the php5.ini in the document-root.

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
extension=pdo.so
extension=pdo_mysql.so


If the file php5.ini is not there in the document root, then you can rename the php.ini as php.ini.

Also after adding this you need to add the following lines on the .htaccess file. If there is no .htaccess then you can create a new file and add the following codes to it,

SetEnv PHPRC /home/$username/public_html/

Note : Replace the path “/home/$username/public_html/” properly with your path.

Commands

Command to find the no of process running by each user

ps aux |awk '{$1} {++P[$1]} END {for(a in P) if (a !="USER") print a,P[a]}' | sort -k 2


Command to find total no of php process running be each user

ps aux | grep php  |awk '{$1} {++P[$1]} END {for(a in P) if (a !="USER") print a,P[a]}' | sort -n -k 2


Command to find total no of dovecot process running be each user

ps aux | grep dovecot  |awk '{$1} {++P[$1]} END {for(a in P) if (a !="USER") print a,P[a]}' | sort -n -k 2


Command to kill all the Dovecot process

ps -aux | grep dovecot | awk '{print $2}' | xargs kill -9


Find Plesk admin password from commandline

/usr/local/psa/bin/admin --show-password


Command to kill all process running on Port 80

ps -aux | grep dovecot | awk '{print $2}' | xargs kill -9

Wednesday 25 June 2014

Update Clamav to Latest Version on cPanel Server

Recently received a clam update in logwatch and seen the duplicate database error and went in to take a look at what was going on.

--------------------- clam-update Begin ------------------------
The ClamAV update process was started 3 time(s)
Last ClamAV update process started at Fri May 18 01:44:12 2012
Last Status:
main.cvd is up to date (version: 54, sigs: 1044387, f-level: 60, builder: sven)
Downloading daily-14929.cdiff [100%]
Downloading daily-14930.cdiff [100%]
Downloading daily-14931.cdiff [100%]
daily.cld updated (version: 14931, sigs: 174042, f-level: 63, builder: guitar)
bytecode.cld is up to date (version: 178, sigs: 40, f-level: 63, builder: neo)
[LibClamAV] Detected duplicate databases /var/clamav/main.cvd and /var/clamav/main.cld, please manually remove one of them
Database updated (1218469 signatures) from db.us.clamav.net (IP: xxx.xxx.xxx.xx)
Clamd successfully notified about the update.
---------------------- clam-update End -------------------------



After I repaired that issue, (basically just removed “aka rm’d” the older /var/clamav/main.cvd database) and I came across a slightly less important issue which was clamav was reporting an old version from the command line.

[root@serverT.com]  freshclam
ClamAV update process started at Tue May 20 11:00:07 2014
WARNING: Your ClamAV installation is OUTDATED!
WARNING: Local version: 0.98.3 Recommended version: 0.98.4
DON'T PANIC! Read http://www.clamav.net/support/faq
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
daily.cld is up to date (version: 19005, sigs: 958471, f-level: 63, builder: neo)
bytecode.cld is up to date (version: 237, sigs: 44, f-level: 63, builder: dgoddard)



Well, I read the FAQ which was somewhat ambiguous and started looking for other options to update this apart from cpanel – WHM 11.44.0 (build 18)



I was able to locate this set of instructions from an older version of clamav which worked very well.

cd /usr/local/cpanel/modules-install/clamavconnector-Linux-x86_64


wget http://kaz.dl.sourceforge.net/project/clamav/clamav/0.98.4/clamav-0.98.4.tar.gz


vim the 'install' file


AVV=0.98.4


Find the line AVVOLD=0.97.1 and make it AVVOLD=0.98.3

AVVOLD=0.98.3
:wq


The values in those lines will depend upon the version of your ClamAV. Save the ‘install’ file after making the changes.

Then edit the file ‘progversion’ and put the latest version of ClamAV there. You can do this with a simple command.

echo "0.98.4" > progversion


then run

./install
freshclam

Sunday 22 June 2014

Script to Change Password of all cPanel Accounts

Bash script to update password of all cPanel Accounts

#! /bin/bash
rm New-Password.txt
echo " " >> New-Password.txt
echo " " >> New-Password.txt
echo "======================================" >> New-Password.txt
echo "Thank you for using iServerSupport.com" >> New-Password.txt
echo "======================================" >> New-Password.txt
echo " " >> New-Password.txt
echo "Passwords of all your cPanel account has changed below are the new passwords" >> New-Password.txt
echo " " >> New-Password.txt
cat /etc/domainusers|awk -F: '{print $1}' | while read user; do
pass=`</dev/urandom tr -dc A-Za-z0-9 | head -c 20`
echo $user $pass >> New-Password.txt
/scripts/realchpass $user $pass > /dev/null
/scripts/ftpupdate > /dev/null
done
echo " " >> New-Password.txt
echo " " >> New-Password.txt
cat New-Password.txt


Create a file called change password.sh and copy above contents into it



vi changepassword.sh


Give execution permission for the file



chmod +x changepassword.sh


Run the script



sh  changepassword.sh


Friday 20 June 2014

List installed perl modules

You can list installed perl modules using the below command


 


instmodsh

Available commands are:

l - List all installed modules

m <module> - Select a module

q - Quit the program

cmd? l



 


Installed modules are:





Acme::Spork
AppConfig
Archive::Tar
Archive::Tar::Streamed
Archive::Zip
Authen::Libwrap
BSD::Resource
Business::OnlinePayment
Business::OnlinePayment::AuthorizeNet
Business::UPS
CDB_File
CPAN
CPAN::DistnameInfo
CPAN::SQLite
Carp
Class::Accessor
Class::ErrorHandler
Class::Inner
Class::Inspector
Class::Load
Class::Singleton
Class::Std
Class::Std::Utils
Clone
Compress::Bzip2
Compress::Raw::Bzip2
Compress::Raw::Zlib
Convert::ASN1
Crypt::GPG
Crypt::OpenSSL::RSA
Crypt::OpenSSL::Random
Crypt::Passwd::XS
Crypt::PasswdMD5
Crypt::RC4
Crypt::SSLeay
Curses
Curses::UI
Cwd
DBD::SQLite2
DBD::mysql
DBI
DBIx::MyParsePP
Data::Dump
Data::Dumper
Data::MessagePack
Data::OptList
Date::Parse
DateTime
DateTime::Locale
DateTime::TimeZone
Devel::Symdump
Digest::HMAC
Digest::MD5
Digest::MD5::File
Digest::Perl::MD5
Digest::SHA
Digest::SHA1
Dist::CheckConflicts
Email::Address
Email::Date::Format
Email::MIME
Email::MIME::ContentType
Email::MIME::Encodings
Email::MessageID
Email::Simple
Email::Valid
Encode::Detect
Encode::Locale
Error
Expect
ExtUtils::CBuilder
ExtUtils::MakeMaker
File::Find::Rule
File::Find::Rule::Filesys::Virtual
File::HomeDir
File::Listing
File::MMagic::XS
File::NFSLock
File::Path::Tiny
File::Slurp
File::Tail
File::Temp
File::Touch
File::Which
Filesys::Df
Filesys::Statvfs
Filesys::Virtual
Filesys::Virtual::Plain
GD
GD::Graph
GD::Text
Geo::IPfree
Geography::Countries
Getopt::Param::Tiny
GnuPG
Graph::Easy
Graph::Flowchart
HTML::StripTags
HTML::Template
HTTP::Cookies
HTTP::Daemon
HTTP::Daemon::App
HTTP::Daemon::SSL
HTTP::Date
HTTP::Message
HTTP::Negotiate
IO::Compress
IO::HTML
IO::Interactive::Tiny
IO::SessionData
IO::Socket::ByteCounter
IO::Socket::INET6
IO::Socket::SSL
IO::Stringy
IO::Tty
IO::Zlib
IP::Country
IPC::Pipeline
IPC::Run
IPC::Run3
Image::Size
JSON::XS
LWP
LWP::MediaTypes
LWP::Protocol::https
Lchown
Linux::Inotify2
List::Cycle
List::MoreUtils
Locale-Maketext
Locale::Maketext::Utils
Locales
Log::Log4perl
MD5
MIME::Lite
MIME::Types
MLDBM
Mail
Mail::Alias::Reader
Mail::DKIM
Mail::DomainKeys
Mail::SPF
Mail::SRS
Mail::SpamAssassin
Math::Base85
Math::BigInt
Math::Fibonacci
Math::Fibonacci::Phi
Module::Build
Module::Implementation
Module::Metadata
Module::Runtime
Module::Want
Mozilla::CA
MySQL::Diff
Net
Net::AIM
Net::DAV::Server
Net::DNS
Net::DNS::Resolver::Programmable
Net::Daemon
Net::Daemon::SSL
Net::FTPSSL
Net::HTTP
Net::HTTPS::Any
Net::HTTPTunnel
Net::IDN::Encode
Net::IP::Match::Regexp
Net::IPv4Addr
Net::LDAP
Net::LDAP::Server
Net::LibIDN
Net::OSCAR
Net::SNMP
Net::SOCKS
Net::SSLeay
Net::Server
NetAddr::IP
Number::Compare
OLE::Storage_Lite
Package::Stash
Package::Stash::XS
Params::Util
Params::Validate
Parse::CPAN::Meta
Parse::RecDescent
Perl
Perl::OSType
Probe::Perl
Proc::Daemon
Quota
Regexp::Assemble
SOAP::Lite
SQL::Statement
SVG::TT::Graph
Safe::Hole
Set::Crontab
Socket6
Spreadsheet::ParseExcel
Spreadsheet::WriteExcel
String::CRC32
Sub::Install
Sub::Uplevel
Sys::Hostname::Long
Sys::Mmap
Task::Cpanel::Core
Task::Weaken
Template
Term::ReadKey
Term::ReadLine
Test::Carp
Test::Deep
Test::Exception
Test::Fatal
Test::Harness
Test::NoWarnings
Test::Requires
Test::Script
Test::Simple
Test::Tester
Test::Unit
Test::Warn
Text::CSV
Text::CSV_XS
Text::Glob
Tie::DBI
Tie::IxHash
Tie::ShadowHash
Tree::DAG_Node
Tree::MultiNode
Try::Tiny
Types::Serialiser
URI
Unix::PID
Unix::PID::Tiny
WWW::RobotRules
Web::Detect
XML::LibXML
XML::NamespaceSupport
XML::Parser
XML::SAX
XML::SAX::Base
XML::SAX::Expat
XML::Simple
XML::Writer
YAML
YAML::Syck
cPanel::MemTest
common::sense
lib::restrict
local::lib
version
cmd?


Internal Server Error User "username" is over quota

When you try to login to Webmail you will get the below error even if your quota is not reached.

Internal Server Error User ‘username’ is over quota

The following step will fix the issue.

cd /var/cpanel/overquota
[/var/cpanel/overquota]# rm -f username

Thursday 19 June 2014

How to Setup Google as mail server

You can setup Gmail as your primary email provider for your website. For this you need to get registered with Google Apps.

Once you get registered then you can change the MX records of your websites to use Gmail for communication.

In cPanel server’s you can find the option “MX Entry” in your cPanel itself. You can clear all the MX record entries there and add them with the Google Apps Mail MX.

For achieving this follow the simple steps mentioned below,

Step 1.

login to cPanel

Step 2.

Choose the option “MX Entry” from cpanel.

Step 3.

Then select the option “Remote Mail Exchanger” and click on change button

Step 4.

In the “Add New Record” area you need to add the following MX entries according to the priority as shown below,

MX Records Priority


ASPMX.L.GOOGLE.COM 1


ALT1.ASPMX.L.GOOGLE.COM 2


ALT2.ASPMX.L.GOOGLE.COM 3


ASPMX2.GOOGLEMAIL.COM 4


ASPMX3.GOOGLEMAIL.COM 5


ASPMX4.GOOGLEMAIL.COM 6


ASPMX5.GOOGLEMAIL.COM 7


It may take 24-48 hours for the propagation.

550 “REJECTED – Bad HELO exim error

This error may cause for some domains those MX record pointed to different domain.

In this case first check the MX record of the domain and see if it is in the same server.

If not remove the entry for the particular domain from the file,


/etc/localdomains



Then add the entry that you removed from the above file to the following file,


/etc/remotedomains



After this restart the exim service, It should be fine now.

Friday 13 June 2014

Monitoring Load & Memory using SAR

sar for load & memory.


sysstat - daemon 


Using sar we can monitor performance of server(load, memory etc…)in real time.




 


sar -q


report load average. (fetch data from /var/log/sa(sysstat)/sa*, where sa* represent the date like sa10,sa11,sa12etc.).


Examples,


sar -q  (List current day’s load averages starting from 12:00:00, with 10 minute interval).


sar -q 1 5 (List load averages 5 times from when we enter this with an interval of 1 sec).


sar -q -f /var/log/sa/sa23  (Fetch data from /var/log/sa/sa23).





sar -r 


report memory details.


Examples,


sar -r (List current days memory usage from 12:00:00)


sar -r 1 5 (List memory usage 5 times from when we enter this with an interval of 1 sec).


sar -r -f /var/log/sa/sa23  (Fetch data from /var/log/sa/sa23).


Examples,
1. sar -q


sar

2. sar -q 1 5


sar

3. sar -q -f /var/log/sysstat/sa06


sar


4.
sar -r


sar

5. sar -r 1 5


sar

6. sar -r -f /var/log/sysstat/sa06


sar

-r and -q are the commonly using SAR switches, Please refer other switches too (-u, -v, -P, -d, -b etc…)

How to Install ipsec-tools

IPsec



For IPsec to work inside a container:


  • Kernel 042stab084.8 or later

  • The following kernel modules must be loaded before container start:



af_key esp4 esp6 xfrm4_mode_tunnel xfrm6_mode_tunnel



  • Capability net_admin must be granted to a container



modprobe af_key
modprobe esp4
modprobe esp6
modprobe xfrm4_mode_tunnel
modprobe xfrm6_mode_tunnel


Steps to install ipsec-tools



Create file /etc/yum.repos.d/CentOS-Base.repo with contents as below


# CentOS-Base.repo## This file uses a new mirrorlist system developed by Lance Davis for CentOS.# The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client.  You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the# remarked out baseurl= line instead.##[base]
name
=CentOS-5-Base#mirrorlist=http://sg2plmirror01.shr.prod.sin2.secureserver.net/vph/2/download/mirrors/cos-5.i386
failovermethod
=priority
baseurl
=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck
=1
gpgkey
=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos5#released updates[update]
name
=CentOS-5-Updates
mirrorlist
=http://sg2plmirror01.shr.prod.sin2.secureserver.net/vph/2/download/mirrors/cos-5-updates.i386
failovermethod
=priority
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck
=1
gpgkey
=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos5#packages used/produced in the build but not released[addons]
name
=CentOS-5-Addons
mirrorlist
=http://sg2plmirror01.shr.prod.sin2.secureserver.net/vph/2/download/mirrors/cos-5-addons.i386
failovermethod
=priority
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck
=1
gpgkey
=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos5#additional packages that may be useful[extras]
name
=CentOS-5-Extras
mirrorlist
=http://sg2plmirror01.shr.prod.sin2.secureserver.net/vph/2/download/mirrors/cos-5-extras.i386
failovermethod
=priority
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck
=1
gpgkey
=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos5#additional packages that extend functionality of existing packages[centosplus]
name
=CentOS-5-Plus
mirrorlist
=http://sg2plmirror01.shr.prod.sin2.secureserver.net/vph/2/download/mirrors/cos-5-centosplus.i386
failovermethod
=priority
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck
=1
enabled
=0
gpgkey
=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos5#contrib - packages by Centos Users[contrib]
name
=CentOS-5-Contrib
mirrorlist
=http://sg2plmirror01.shr.prod.sin2.secureserver.net/vph/2/download/mirrors/cos-5-contrib.i386
failovermethod
=priority
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck
=1
enabled
=0
gpgkey
=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos5




OR



Create file /etc/yum.repos.d/public-yum-el5.repo with contents as below


[el5_latest]
name
=OracleLinux $releasever Latest($basearch)
baseurl
=http://public-yum.oracle.com/repo/OracleLinux/OL5/latest/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=1[el5_ga_base]
name
=OracleLinux $releasever GA installation media copy ($basearch)
baseurl
=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/0/base/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[el5_u1_base]
name
=EnterpriseLinux $releasever Update1 installation media copy ($basearch)
baseurl
=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/1/base/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[el5_u2_base]
name
=EnterpriseLinux $releasever Update2 installation media copy ($basearch)
baseurl
=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/2/base/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[el5_u3_base]
name
=EnterpriseLinux $releasever Update3 installation media copy ($basearch)
baseurl
=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/3/base/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[el5_u4_base]
name
=EnterpriseLinux $releasever Update4 installation media copy ($basearch)
baseurl
=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/4/base/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[el5_u5_base]
name
=EnterpriseLinux $releasever Update5 installation media copy ($basearch)
baseurl
=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/5/base/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[ol5_u5_base]
name
=OracleLinux $releasever Update5 installation media copy ($basearch)
baseurl
=http://public-yum.oracle.com/repo/OracleLinux/OL5/5/base/x86_64/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[ol5_u6_base]
name
=OracleLinux $releasever Update6 installation media copy ($basearch)
baseurl
=http://public-yum.oracle.com/repo/OracleLinux/OL5/6/base/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[ol5_u7_base]
name
=OracleLinux $releasever Update7 installation media copy ($basearch)
baseurl
=http://public-yum.oracle.com/repo/OracleLinux/OL5/7/base/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[ol5_u8_base]
name
=OracleLinux $releasever Update8 installation media copy ($basearch)
baseurl
=http://public-yum.oracle.com/repo/OracleLinux/OL5/8/base/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[el5_addons]
name
=EnterpriseLinux $releasever Add ons ($basearch)
baseurl
=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/addons/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[el5_oracle_addons]
name
=OracleSoftware addons forEnterpriseLinux $releasever ($basearch)
baseurl
=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/oracle_addons/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[ol5_UEK_latest]
name
=LatestUnbreakableEnterpriseKernelforOracleLinux $releasever ($basearch)
baseurl
=http://public-yum.oracle.com/repo/OracleLinux/OL5/UEK/latest/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[ol5_UEK_base]
name
=UnbreakableEnterpriseKernelforOracleLinux $releasever ($basearch)
baseurl
=http://public-yum.oracle.com/repo/OracleLinux/OL5/UEK/base/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0[el5_unsupported]
name
=ProductivityApplicationsforEnterpriseLinux $releasever ($basearch)
baseurl
=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/unsupported/$basearch/
gpgkey
=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck
=1
enabled
=0



  Install the package:




yum install ipsec-tools


Thursday 12 June 2014

Solved "Missing owner for domain X, force lookup to root"

On recent cPanel versions, rebuilding the Apache conf returns the following non-fatal error:

root@servertechs [~]# /scripts/rebuildhttpdconf

info [rebuildhttpdconf] Missing owner for domain servertechs.serversolutions.com, force lookup to root
Built /usr/local/apache/conf/httpd.conf OK

The error does not adversely effect the way the httpd.conf file is built, but the presence of the unnecessary info message can be annoying.  And by “can be annoying”, I mean “is annoying”.

To fix this, you will need to edit the main vhost template for the ‘nobody’ user, which owns the primary hostname of your server.  Edit /var/cpanel/userdata/nobody/$hostname and add this line to the bottom of the file:

owner: 'nobody'

Then run /scripts/rebuildhttpdconf again and the “error” should be gone.

Wednesday 11 June 2014

ffmpeg installer

ffmpeginstaller is a free software completely written in bash shell script. The purpose of this script is to build a video streaming platform in your Gnu/Linux server. So you can start video streaming websites and avoid the cost of installations. This script not only install FFmpeg but also all its friends packages. You can chose this script for building platform for most of the youtube clone software like clip-shre, sharemixer,shareigniter,etc,.




What packages ffmpeginstaller install in your server?


Please see the complete list of packages below.




  • FFmpeg : FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video



  • MPlayer and MEncoder : MPlayer is a movie player.It plays most MPEG/VOB, AVI, Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT, NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files, supported by many native, XAnim, and Win32 DLL codecs.



  • A52 Decoder : Are you a hosting company and you like to sell PCI DSS compliance servers to your clients with support ? If so this is your plan



  • AMR-NB and AMR-WB : The Adaptive Multi-Rate (AMR) audio codec is a patented audio data compression scheme optimized for speech coding



  • Latest Codecs : Install latest codecs libs



  • FAAD2 : FAAD2 is an open source MPEG-4 and MPEG-2 AAC decoder



  • FAAC : FAAC is an MPEG-4 and MPEG-2 AAC encoder.



  • FLVtool2 : FLVTool2 is a manipulation tool for Macromedia Flash Video files (FLV )



  • LAME MP3 Encoder : LAME is a high quality MPEG Audio Layer III (MP3) encoder



  • Liba52 : Liba52 is a free library for decoding ATSC A/52 streams



  • Libogg : Ogg Lib collections



  • Opencore-AMR : Library of OpenCORE Framework implementation of Adaptive Multi Rate Narrowband and Wideband speech codec



  • Theora : Theora is a free and open video compression format



  • Vorbis-tools : Vorbis is a completely open, patent-free, professional audio encoding and streaming technology with all the benefits of Open Source



  • Libwmf : libwmf is a library for reading vector images in Microsoft's native Windows Metafile Format (WMF)



  • MP4Box : MP4Box is a MP4 multiplexer



  • x264 : x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC format



  • Xvid : Open-source compression codec based on MPEG-4 ISO format


Saturday 7 June 2014

ZOOM Framework - Failed: Filesystem preventing downloads. (ftpext)

Failed: Filesystem preventing downloads. (ftpext)


error occurs sometimes on specific servers when you try to update the ZOOM Framework.

We can Solve the issue in 4 Ways. I'll help you to get it resolved.


  • Re-download your theme again from Members Area and install it again on your website, or




  • Update the ZOOM Framework from your theme manually. You can find the latest version of the framework in the ZIP file of your theme under the functions / wpzoom folder. After that replace this folder with the one from your theme via FTP.




  • Download just the ZOOM Framework from this address: http://framework.wpzoom.com/wpzoom-framework.zip and update it manually. The framework is the functions/wpzoom/ folder from your theme, so you’ll have to replace entire folder.



The changelog of the framework can be found here: http://framework.wpzoom.com/changelog/




  • Just add this line in the wp-config.php file of your WordPress install.




define('FS_METHOD', 'direct');

Friday 6 June 2014

mod_reveseproxy Extract Client IP from reverse proxy

If you setup Apache 2.4 With mod_remoteip, the apache extended status always gives you the proxy IP, instead of client IP, actually this is due to that the mod_status set client IP very early when there is a TCP connection but no headers, Apache 2.4 allows per-request notion of overriding the client address, but not at this early stage. To overcome this issue, I would suggest you to use mod_reveseproxy apache module, the modules is completely based on mod_cloudflare and mod_remoteip.



To install, follow the instructions on:

wget https://raw.github.com/Prajithp/mod_reverseproxy/master/mod_reverseproxy.c
apxs -i -c -n mod_reverseproxy.so mod_reverseproxy.c


Configuration Directives

ReverseProxyEnable           (On|Off)          - Enable reverse proxy

ReverseProxyRemoteIPHeader X-Real-IP - The header to use for the real IP
address.
ReverseProxyRemoteIPTrusted 127.0.0.1 - What IPs to adjust requests for


Example Configuration


LoadModule reverseproxy_module modules/mod_reverseproxy.so

<IfModule reverseproxy_module>
ReverseProxyEnable  On
ReverseProxyRemoteIPHeader X-Real-IP
ReverseProxyRemoteIPTrusted 127.0.0.1
ReverseProxyRemoteIPTrusted 46.105.160.192
</IfModule>

NOTES:

  • If mod_cloudflare or mod_remoteip are already loaded on the same web server, the web server will crash because both modules try to set the remote IP to a different value.


https://github.com/Prajithp/mod_reverseproxy



Wednesday 4 June 2014

cPanel To DirectAdmin Migration Conversion Tool

Its now quite easy to migrate accounts from cPanel to DirectAdmin using conversion tool



Before proceed,  First we will need to download conversion tool  and you can download it from here ::



DOWNLOAD HERE



STEPS TO FOLLOW ::



1) Download and extract the version URL (from above) that you wish to use. (wget and tar xzf)



2) Create import and export directories for the tool to use. (mkdir import export)



3) Copy your cPanel user backups into the import directory.



4) Edit defaults.conf to match the DA server you will be restoring to. The only fields you must change are the IP and name server fields. The tool will not work if you fail to do this!



5) Execute perl da.cpanel.import.pl and follow the on-screen instructions (which will duplicate the steps here to a degree).



6) After the tool is finished converting (or as it completes each individual user), move your new DA user backups from the export directory to any DA /home/RESELLER/user_backups directory*



7) Restore the DA user backups in DA’s reseller-level Manage User Backups tool.

Monday 2 June 2014

cPHulk Status via command line

A client recently asked how to check the status of cphulk via the command line… This got me thinking; beside actually logging into WHM to check “Home »Security Center » cPHulk Brute Force Protection” to see whether cPHulk is currently Disabled/Enabled, I was unaware of a way to do this. After a little digging, I was able to find


/usr/local/cpanel/scripts/restartsrv_cphulkd --status



Which gives the current status of cPHulk from the command line



cphulkd is disabled



and scene.

Sunday 1 June 2014

How to Install Mod_Pagespeed in WHM/cPanel using easyapache

The mod_pagespeed  custom module for CPanel WHM using CPanel Easy Framework. which can be install using /scripts/easyapache on command line or easyapache from WHM choice whether to install it or not.

Steps to install Mod_Pagespeed.

#  cd /usr/local/

# wget http://r6host.com/scripts/mod_pagespeed-cust-opts.tar.gz

# tar -C /var/cpanel/easy/apache/custom_opt_mods  -xzf mod_pagespeed-cust-opts.tar.gz

Thats it, now you can run

# /scripts/easyapache

Login into WHM and go to EasyApache Update

It will show you the Mod_Pagespeed included in it and you can install it by checking the box.