Limit requests per IP on Nginx using HttpLimitZoneModule and HttpLimitReqModule except whitelist

– Make sure to check Nginx, PHP posts for information on Nginx and PHP setup and configuration.

Nginx offers two modules, HttpLimitReqModule and HttpLimitZoneModule, to limit simultaneous connections for the assigned session and the number of requests for a given session from one IP address. Basically these modules are built to protect the web server from possible DDos attacks; For example, this configuration limits remote clients to no more than 20 concurrently “open” connections per remote ip address:

    limit_conn_zone  $binary_remote_addr zone=concurrent:10m;
    limit_conn_log_level warn;
    limit_conn  concurrent  20;

Install Sphinx 2.0.4 on CentOS 6.2

– Make sure to check CentOS, PHP-FPM, Nginx, memcached and MYSQL posts.

– Get fresh RPM from

– Install Sphinx

rpm -Uhv

– Create sample MySQL database

Watch log files on Linux server with Swatch 3.2.3

– Make sure to check CentOS, PHP-FPM, memcached and MYSQL posts.

– get a fresh package from Swatch project

wget ""
tar xfz swatch-3.2.3.tar.gz 
cd swatch-3.2.3
cpan -i Date::Format File::Tail
cpan -i Date::Manip Date::Calc
cpan -i Test::Inter Test::Pod Test::Pod::Coverage Module::Build
cp /root/.cpan/sources/authors/id/S/SB/SBECK/Date-Manip-* .
tar xfz Date-Manip-*.tar.gz
cd Date-Manip-*
perl Build.PL 
./Build install
cd ..
perl Makefile.PL
make install

– configure swatch

install memcached 1.4.13 on CentOS 6.2

– Make sure to check PHP-FPM and MYSQL posts.

– One of the dependencies of memcache is libevent, get latest version from

mkdir libevent
cd libevent
tar xfz libevent-2.0.17-stable.tar.gz
cd libevent-2.0.17-stable

– get latest version from

Install PHP 5.3.10 with PHP-FPM on CentOS 6.2 64-bit

– Make sure to check Nginx, memcached and MYSQL posts.

– remove old version

#find installed packages
rpm -qa | grep php
#remove php packages
yum remove php php-devel php-cli php-pear php-common php-pdophp-xml php-gd

– download package from

mkdir php
cd php
tar jxf php-5.3.10.tar.bz2
cd php-5.3.10

#install PHP
./configure  \
	--with-zlib --with-curl --with-curlwrappers --enable-ftp --with-mysql --with-jpeg-dir --with-png-dir --with-gd --enable-gd-native-ttf --with-freetype-dir \
	--enable-zip --with-openssl --with-bz2 --enable-mbstring  \
	--enable-inline-optimization --disable-debug \
	--with-config-file-path=/etc \
	--enable-fpm --with-fpm-user=www --with-fpm-group=www --with-libdir=lib64;
make all install;

#add php-fpm service
cp  sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
chmod 666 /usr/local/var/run

– Configure php-fpm