You can use the below scripts as cron job to restart the service if it was down. #!/bin/bash # RHEL / CentOS / Fedora Linux restart command RESTART=”/etc/rc.d/init.d/httpd restart” #path to pgrep command PGREP=”/usr/bin/pgrep” # Httpd daemon name, # Under RHEL/CentOS/Fedora it is httpd # Under Debian 4.x it is apache2 HTTPD=”httpd” # find httpd [...]
Archive for the ‘SCRIPT’ Category
Script to restart httpd if it is down.
Posted in Apache, SCRIPT on October 11, 2009 | Leave a Comment »
script to show mysql status values
Posted in Mysql, OPTIMIZATION, SCRIPT on October 4, 2009 | Leave a Comment »
“mysqlreport makes a friendly report of important MySQL status values. mysqlreport transforms the values from SHOW STATUS into an easy-to-read report that provides an in-depth understanding of how well MySQL is running. mysqlreport is a better alternative (and practically the only alternative) to manually interpreting SHOW STATUS.” Installation: root@server [~downloads]# wget hackmysql.com/scripts/mysqlreport root@server [~downloads]#chmod 755 [...]
How to install ClamAV in cPanel
Posted in INSTALLATION, SCRIPT on October 4, 2009 | Leave a Comment »
I was reading through my post on how to virus scan ftp uploads, and I realized, I never mentioned how to setup ClamAV, the antivirus software. So, here we go:1. Log into you WHM control panel as root 2. Go to Cpanel >> Manage Plugins 3. Click on clamavconnector to install and then click Save [...]
Installing custom SSL certificates for Qmail and IMAP/POP in Plesk
Posted in PLESK, SCRIPT on September 11, 2009 | Leave a Comment »
http://download1.swsoft.com/Plesk/Plesk8.6/Doc/en-US/plesk-8.6-unix-administrators-guide/index.htm?fileName=52756.htm
ffmpeg FFmpeg installation on CentOS 5.x i386
Posted in INSTALLATION, SCRIPT on September 11, 2009 | Leave a Comment »
Installing ffmpegh: cd /root wget http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.e l5.rf.i386.rpm rpm -vi rpmforge-release-0.3.6-1.el5.rf.i386.rpm rm -f /root/rpmforge-release-0.3.6-1.el5.rf.i386.rpm yum -y install ffmpeg ffmpeg-devel mplayer mencoder flvtool2 libogg libvorbis lame yum clean all Installing ffmpeg-php wget http://internap.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.3.t bz2 tar jxf ffmpeg-php-0.5.3.tbz2 cd ffmpeg-php-0.5.3 /usr/local/bin/phpize ./configure make make install echo “extension=ffmpeg.so” >> /usr/local/lib/php.ini cd /root rm -rf ffmpeg-php-0.5.3 ffmpeg-php-0.5.3.tbz2 service httpd restart [...]
Dos attack…
Posted in SCRIPT, SECURITY on January 7, 2009 | Leave a Comment »
A simple bash script to block IP address using iptables and send you the details about the IPs to your mail-id. #!/bin/bash ARG_VAL=`hostname`; netstat -apn | grep TIME_WAIT |awk ‘{print $5}’|awk -F\: ‘{print $1}’ | sort | grep -v 127.0.0.1 | grep -v 0.0.0.0 | awk ‘{ if ($1 > 7) print $1}’> s.txt; for [...]
A script to blocks IP to prevent dos attack
Posted in SCRIPT, SECURITY on January 7, 2009 | Leave a Comment »
It controls number of connections to the server from single ip, and blocks ip address if there are more connections. #!/usr/bin/perl #################### # blocks ip if there are > $allowed connections ################### # delay betwens checks (in sec) $delay = 60; # number of allowed connections from single ip $allowed = 150; open(STDERR, “>load.log”); print [...]
A script to find the domains having more than 100MB log file size.
Posted in Apache, SCRIPT on January 7, 2009 | Leave a Comment »
A script to find the domains having more than 100MB log file size. ================================================ This is a very easy way to find out the domains which are having big file size and split it as per the need. Here, the script can be used to list the domains having more than 100MB log file. #!/bin/bash [...]
Installing ASP in linux server
Posted in Apache, Cpanel, INSTALLATION, SCRIPT on January 7, 2009 | Leave a Comment »
Installing asp in linux server: =================================== Installing ASP in Linux server(cPanel) is a very easy task. Just follow the below steps: ===================== wget http://layer1.cpanel.net/apache-asp.sea sh apache-asp.sea rm apache-asp.sea vi /usr/local/apache/conf/httpd.conf Add the following lines to the file: ========================= SetHandler perl-script PerlModule Apache::ASP PerlHandler Apache::ASP PerlSetVar Global . PerlSetVar StateDir /tmp/asp Hold down CTRL and press [...]
Server Scanning Script:
Posted in SCRIPT, SECURITY on January 1, 2009 | Leave a Comment »
The above script can let you to scan the server in enough level. ====================================== w top -c ps aux cd /proc for i in `seq 1 33000`; do test -f $i/cmdline &&(cat $i/cmdline; echo $i); done df -h du -sch /var/spool/mqueue/ du -sch /var/spool/exim/input grep attackalert /var/log/messages iptables -I INPUT -p tcp -s -j DROP [...]