Benchmarking Your Site with ‘http_load’
http_load is a stunningly useful HTTP benchmarking utility that gives you a rough idea of how many hits per second a server is capable of serving. You simply tell it what pages to grab, and how many “clients” it should run in parallel; it gives you back useful information about the average fetches per second and the average, minimum, and maximum response times. It’s no substitute for a solid profiler to dig into the hows and whys of your application’s performance, but it’s great at telling you when you’re “good enough” to launch.
Installing http_load on OS X
- Download from http://www.acme.com/software/http_load/
- Open terminal, cd to the directory where the archive is and unzip
$ tar xvzf http_load-12mar2006.tar.gz - Move to that directory
$ cd http_load-12mar2006 - Run
$ make - Run
$ sudo make install
Check / List Running Services
Q. How do I list all currently running services in CentOS / RHEL / Fedora Linux server ?
A. There are various ways and tools to find and list all running services under CentOS / RHEL / Fedora Linux systems.
service command – list running services
service --status-all
service --status-all | grep ntpd
service --status-all | less
Read more…
How to Change the Timezone in Linux
- Logged in as root, check which timezone your machine is currently using by executing `date`. You’ll see something like Mon Nov 9 13:49:01 EST 2009, PST in this case is the current timezone.
- Change to the directory /usr/share/zoneinfo here you will find a list of time zone regions. Choose the most appropriate region, if you live in Hong_Kong or the Singapore this directory is the “Asia” directory.
Install bandwidth monitor vnstat
vnStat is a network traffic monitor for Linux that keeps a log of daily network traffic for the selected interface(s). vnStat isn’t a packet sniffer. The traffic information is analyzed from the /proc -filesystem, so vnStat can be used without root permissions. However at least a 2.2.x kernel is required.
- Install vnStat
wget http://humdi.net/vnstat/vnstat-1.7.tar.gz
tar zxvf vnstat-1.7.tar.gz
cd vnstat-1.7
make
make install
Block IP Addresses With IPtables & APF
Have a user that keeps hammering your FTP or trying to login over and over and over again that you just want to ban and never see again? We’ll show a quick and dirty method to ban an IP address from the server.
We commonly receive questions like:
“I would like to ban that ip address to prevent the access to the server.
how can i ban that Ip address from the server?”
Simple !
Login to the server as root.
- If you are running iptables, you can enter:
iptables -A INPUT -s IP_ADDRESS -j DROP
Ex: Block IP 68.72.72.25
iptables -A INPUT -s 68.72.72.25 -j DROP
Stop PHP nobody Spammers
PHP and Apache has a history of not being able to track which users are sending out mail through the PHP mail function from the nobody user causing leaks in formmail scripts and malicious users to spam from your server without you knowing who or where.
Watching your exim_mainlog doesn’t exactly help, you see th email going out but you can’t track from which user or script is sending it. This is a quick and dirty way to get around the nobody spam problem on your Linux server.
If you check out your PHP.ini file you’ll notice that your mail program is set to: /usr/sbin/sendmail and 99.99% of PHP scripts will just use the built in mail(); function for PHP – so everything will go through /usr/sbin/sendmail =)
Requirements:
We assume you’re using Apache 1.3x, PHP and Exim. This may work on other systems but we’re only tested it on a Cpanel/WHM Red Hat Enterprise system. Read more…
Installing Lighttpd With PHP5 Support On CentOS
Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on a CentOS 5.0 server with PHP5 support (through FastCGI) and MySQL support.
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Afterwards, we can install Lighttpd like this:
yum install lighttpd Read more…
Script to daily email APF status
You are running APF on your server, but sometimes you think “is APF running fine ?”
This script sends you an email with APF satus.
Log in to your server as root
Create the script:
nano apfstatus.sh
Put this on the file:
#!/bin/bash
tail -200 /var/log/apf_log | mail -s "APF Status" youemail@domain.com
Save and Exit
Ctrl+X and Y
Read more…
How To remote backup with rsync
This is probably the simply way to backup data to other server using a secure protocoal an minimum bandwidh.
Note:
BackupServer.com – Is the backup server
MainServer.com – Is the server you want to backup
- Login to the server you want to backup
- Creating a key with the ssh-keygen utility:
ssh-keygen -t rsa -N '' (these are two single quotes) - Copy RSA encryption key to the backup server:
scp ~/.ssh/id_rsa.pub username@backupserver.com:keys/server1
ssh username@backupserver.com mergekeys
How to run PHP 4 and 5 on Cpanel
by Tweak on June 13, 2009
in Domain/Hosting, Php, Servers
This information is helpful for hosting companies that want to run PHP 4 & 5 on the same cPanel server. After this, Hosting costumers / cPanel users should choose what version of PHP will they use on theirs scripts.
You should consider some implications on your server performance, but webhosts are using because they don’t need two server to run the different PHP versions for different costumers.
How to run PHP 4 and 5 on the same Cpanel server
Read more…