Thursday, 26 June 2014

Named rndc.key Error While Starting

When trying to restart named process after making modifications may end up in a corrupt rndc.key key and the error will show like this:

Jul 07 03:30:54 server named[23683]: /etc/rndc.key:1: configuring key ‘rndc-key’: bad base64 encoding
Jul 07 03:30:54 server named[23683]: loading configuration: bad base64 encoding
Jul 07 03:30:54 server named[23683]: exiting (due to fatal error)


A simple explanation to this is that the key got modified somehow might me some bug.
Just check the /etc/rndc.conf file and copy the key from there(you will see the key in the first lines of the file) and replace the key that it is in /etc/rndc.key file and restart named process.


#  service named restart
Stopping named: [ OK ]
Starting named: [ OK ]



Named rndc.key Error While Starting

WHM locked out – Brute Force Error

cPHulk Brute Force Protection prevents malicious forces from trying to access your server’s services by guessing the login password for that service. BUT sometimes it becomes troublesome when you are accessing the cPanel with incorrect password and cPanel assuming you as attacker blocks you with below message :


—————————————————————————————
This account is currently locked out because a brute force attempt was detected. Please wait 10 minutes and try again. Attempting to login again will only increase this delay. If you frequently experience this problem, we recommend having your username changed to something less generic.
—————————————————————————————


To get out of such situation you can disable cphulkd protection :


login via ssh and disable cphulkd using the command below.


root@HOST [~]# /usr/local/cpanel/etc/init/stopcphulkd


This should allow you to login to WHM and double check your cphulk settings.


You can view IP addresses that have been blocked via the WHM interface: WHM -> Security -> Security Center -> cPHulk Brute Force Protection in the Brutes table. On that screen, you can also customize brute force protection settings.


Then log into your WHM >> Security Center >> cPHulk Brute Force Protection >> Flush DB


Make Sure to restart cphulkd protection from SSH, simply fire the following command


root@HOST [~]# /usr/local/cpanel/etc/init/startcphulkd


Well the other way to this is to remove the IP’s blocked by cPHulk from its database .


ssh to the server login as root and type the following at the prompt


[root@server:] mysql


mysql> use cphulkd;


mysql>BACKUP TABLE brutes TO ‘/path/to/backup/directory’;


mysql> SELECT * FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;


mysql> DELETE FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;


mysql>quit



WHM locked out – Brute Force Error

Install Zend Optimizer on Plesk or on any plain server?

Steps to install ZendOptimizer-3.0.1 on Plesk:-


Code:

cd /usr/local/src
wget http://www.eth0.us/files/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
tar -zxf ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.0.1-linux-glibc21-i386
./install


Now just hit enter a few times until it is done…


Make sure that above lines are exist in /etc/php.ini


Quote:


zend.ini section looks like this,
[Zend]
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.0
zend_optimizer.version=3.3.0a
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

then restart apache service


Quote:


/sbin/service httpd restart

verified output


Quote:


[root@VPS Hosting ~]# php -v
PHP 5.1.6 (cli) (built: May 9 2007 11:29:06)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with the ionCube PHP Loader v3.1.28, Copyright (c) 2002-2007, by ionCube Ltd., and
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies
[root@VPS Hosting ~]#

Now everything works, and Zend is properly displayed in php.ini



Install Zend Optimizer on Plesk or on any plain server?

Script to repair/rebuild httpd.conf – DirectAdmin

Script to repair/rebuild httpd.conf


# cd /usr/local/directadmin/custombuild

# ./build rewrite_confs




Script to repair/rebuild httpd.conf – DirectAdmin

lynx: Can’t access startfile http://localhost/whm-server-status

ERROR :-


Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.


lynx: Can’t access startfile http://localhost/whm-server-status


# ipcs -s | grep nobody | perl -e 'while () @a=split(/s+/); print `ipcrm sem $a[1]`'

This may sort out your issue, if you still face the error

# /scripts/easyapache



lynx: Can’t access startfile http://localhost/whm-server-status

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


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?