Tuesday, April 8, 2008

Install Chkrootkit

cd /root

wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz

tar xvzf chkrootkit.tar.gz

mv chkrootkit-* chkrootkit

cd chkrootkit

make sense

SIM (System Integrity Monitor)

How to Install SIM

Login to your server via SSH as root.

wget http://www.r-fx.org/downloads/sim-current.tar.gz

tar xvfz sim-3*.gz

cd sim-3.0

./install.sh -i

Type

sim -j

If ifconfig is not eth0 (eg eth1, or venet0)

nano -w /etc/conf.sim

Installation of APF

cd /usr/local/src
wget http://rfxnetworks.com/downloads/apf-current.tar.gz
tar -zxf apf-current.tar.gz
cd apf-0.*
./install.sh

Now edit config file
vi /etc/apf/conf.apf
Scroll down to the “Common ingress (inbound) TCP ports section. At this point you need to find the correct configuration for your control panel.

IG_TCP_CPORTS=”20,21,22,25,26,53,80,110,143,443,465,993,995,2082,2083,2086,2087,2095,2096″
IG_UDP_CPORTS=”21,53,873″

EGF=”1″
EG_TCP_CPORTS=”21,22,25,26,27,37,43,53,80,110,113,443,465,873,2089″
EG_UDP_CPORTS=”20,21,37,53,873″

save the file
start apf
apf -s
If everything still works then edit the config file and turn dev mode off. Make sure you can start a new ssh session before changing dev mode off. If you are kicked out you need to go back and look at what caused the problem!
DEVEL_MODE=”0″

restart APF
apf -r

Open DNS Servers

vi /etc/named.conf

Before the line that says “directory /var/named”; (it could be /var, /var/named, etc)
Put:
recursion no;

service named restart

Make sure you can ping yahoo.com and google.com afterwards.

Lame Server Resolve

service named stop

vi /etc/named.conf

add the three lines at the top

logging {

category lame-servers { null; };

};

service named restart

Installation of Eaccelerator

cd /usr/local/src
mkdir ea
cd ea
wget http://kent.dl.sourceforge.net/sourc…r-0.9.5.tar.gz

tar zxvf eaccelerator-0.9.5.tar

cd eaccelerator-0.9.5

export PHP_PREFIX=”/usr”
$PHP_PREFIX/bin/phpize
./configure –enable-eaccelerator=shared –with-php-config=$PHP_PREFIX/bin/php-config
make
make install

For PLESK: vi /etc/php.ini

For CPANEL: vi /usr/local/lib/php.ini

If Zend is already installed, vi /usr/local/Zend/etc/php.ini

Find this:

;Windows Extensions

Above this, comment out the PHPA or ZEND lines if you have them. Replace them with this:

zend_extension=”/usr/local/src/ea/eaccelerator-0.9.5/modules/eaccelerator.so”
eaccelerator.shm_size=”16″
eaccelerator.cache_dir=”/tmp/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”"
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”0″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″

mkdir /tmp/eaccelerator

chmod 0777 /tmp/eaccelerator

service httpd restart

How to install Zend Optimizer

For i386


wget http://downloads.zend.com/optimizer/3.0.2/ZendOptimizer-3.0.2-linux-glibc21-i386.tar.gz
tar xvfz ZendOptimizer-3.0.2-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.0.2-linux-glibc21-i386
./install.sh

For x86_64
wget http://downloads.zend.com/optimizer/3.0.1/ZendOptimizer-3.0.1-linux-glibc23-x86_64.tar.gz
tar xvfz ZendOptimizer-3.0.1-linux-glibc23-x86_64.tar.gz
cd ZendOptimizer-3.0.1-linux-glibc23-x86_64
./install.sh