How to install siege on Linux box

In this article I given step by step information about How to install siege on Linux box. I given the full commands and there output with full description.

How to install siege on Linux box

ABOUT SIEGE – Background
Siege is an http load testing and benchmarking utility. It was designed to let web developers measure their code under duress, to see how it will stand up to load on the internet. Siege supports basic authentication, cookies, HTTP and HTTPS protocols. It lets its user hit a web server with a configurable number of simulated web browsers. Those browsers place the server “under siege.”

How to install siege on Linux box
How to install siege on Linux box

PLATFORM SUPPORT
Siege was written on GNU/Linux and has been successfully ported to AIX, BSD, HP-UX and Solaris. It should compile on most System V UNIX variants and on most newer BSD systems. Because Siege relies on POSIX.1b features not supported by Microsoft, it will not run on Windows. Of course you can use Siege to test a Windows HTTP server.

Download siege from following URL or Using following command
[kapil@kapil-pc ~]$ wget ftp://ftp.joedog.org/pub/siege/siege-latest.tar.gz
[kapil@kapil-pc ~]$ tar xzf siege-latest.tar.gz
[kapil@kapil-pc ~]$ mv siege-2.69 siege
[kapil@kapil-pc ~]$ cd siege
[kapil@kapil-pc siege ~]$ su
[root@kapil-pc siege ~]$ ROOT_PASSWORD

[root@kapil-pc siege ~]$ ./configure
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for gawk… gawk
checking for gcc… no
checking for cc… no
checking for cc… no
checking for cl… no
configure: error: no acceptable cc found in $PATH

If you got above error Please Use following command.

[root@kapil-pc siege ~]$ yum install gcc*

Than run following command again

[root@kapil-pc siege ~]$ ./configure
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking for style of include used by make… GNU
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ANSI C… none needed
checking dependency style of gcc… none
checking how to run the C preprocessor… gcc -E
checking for egrep… grep -E
checking for AIX… no
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ANSI C… (cached) none needed
checking dependency style of gcc… (cached) none
checking for a sed that does not truncate output… /bin/sed
checking for ld used by gcc… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for /usr/bin/ld option to reload object files… -r
checking for BSD-compatible nm… /usr/bin/nm -B
checking whether ln -s works… yes
checking how to recognise dependent libraries… pass_all
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking dlfcn.h usability… yes
checking dlfcn.h presence… yes
checking for dlfcn.h… yes
checking for g++… g++
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking dependency style of g++… none
checking how to run the C++ preprocessor… g++ -E
checking for g77… no
checking for f77… no
checking for xlf… no
checking for frt… no
checking for pgf77… no
checking for fort77… no
checking for fl32… no
checking for af77… no
checking for f90… no
checking for xlf90… no
checking for pgf90… no
checking for epcf90… no
checking for f95… f95
checking whether we are using the GNU Fortran 77 compiler… yes
checking whether f95 accepts -g… yes
checking the maximum length of command line arguments… 32768
checking command to parse /usr/bin/nm -B output from gcc object… ok
checking for objdir… .libs
checking for ar… ar
checking for ranlib… ranlib
checking for strip… strip
checking if gcc supports -fno-rtti -fno-exceptions… no
checking for gcc option to produce PIC… -fPIC
checking if gcc PIC flag -fPIC works… yes
checking if gcc static flag -static works… yes
checking if gcc supports -c -o file.o… yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries… yes
checking whether -lc should be explicitly linked in… no
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
configure: creating libtool
appending configuration tag “CXX” to libtool
checking for ld used by g++… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
checking for g++ option to produce PIC… -fPIC
checking if g++ PIC flag -fPIC works… yes
checking if g++ static flag -static works… yes
checking if g++ supports -c -o file.o… yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
appending configuration tag “F77” to libtool
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
checking for f95 option to produce PIC… -fPIC
checking if f95 PIC flag -fPIC works… yes
checking if f95 static flag -static works… yes
checking if f95 supports -c -o file.o… yes
checking whether the f95 linker (/usr/bin/ld) supports shared libraries… yes
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking for perl… /usr/bin/perl
checking for a POSIX-compliant shell… /bin/sh
checking whether make sets $(MAKE)… (cached) yes
checking for a BSD-compatible install… /usr/bin/install -c
checking for buggy pthread mutex initializers… no
checking for dlopen() in -ldld… no
checking for dlopen() in -ldl… yes
checking for ssl support… yes
checking off/include/openssl/opensslv.h usability… no
checking off/include/openssl/opensslv.h presence… no
checking for off/include/openssl/opensslv.h… no
checking /usr/include/openssl/opensslv.h usability… yes
checking /usr/include/openssl/opensslv.h presence… yes
checking for /usr/include/openssl/opensslv.h… yes
checking for OpenSSL version… >= 0.9.8 (appropriate flag set)
checking for ANSI C header files… (cached) yes
checking for sys/wait.h that is POSIX.1 compatible… yes
checking fcntl.h usability… yes
checking fcntl.h presence… yes
checking for fcntl.h… yes
checking for unistd.h… (cached) yes
checking signal.h usability… yes
checking signal.h presence… yes
checking for signal.h… yes
checking sys/socket.h usability… yes
checking sys/socket.h presence… yes
checking for sys/socket.h… yes
checking sys/select.h usability… yes
checking sys/select.h presence… yes
checking for sys/select.h… yes
checking sys/time.h usability… yes
checking sys/time.h presence… yes
checking for sys/time.h… yes
checking sys/times.h usability… yes
checking sys/times.h presence… yes
checking for sys/times.h… yes
checking sys/resource.h usability… yes
checking sys/resource.h presence… yes
checking for sys/resource.h… yes
checking errno.h usability… yes
checking errno.h presence… yes
checking for errno.h… yes
checking arpa/inet.h usability… yes
checking arpa/inet.h presence… yes
checking for arpa/inet.h… yes
checking netinet/in.h usability… yes
checking netinet/in.h presence… yes
checking for netinet/in.h… yes
checking netdb.h usability… yes
checking netdb.h presence… yes
checking for netdb.h… yes
checking pthread.h usability… yes
checking pthread.h presence… yes
checking for pthread.h… yes
checking for string.h… (cached) yes
checking for strings.h… (cached) yes
checking sched.h usability… yes
checking sched.h presence… yes
checking for sched.h… yes
checking openssl/e_os.h usability… no
checking openssl/e_os.h presence… no
checking for openssl/e_os.h… no
checking openssl/e_os2.h usability… yes
checking openssl/e_os2.h presence… yes
checking for openssl/e_os2.h… yes
checking for an ANSI C-conforming const… yes
checking for size_t… yes
checking whether time.h and sys/time.h may both be included… yes
checking return type of signal handlers… void
checking for working alloca.h… yes
checking for alloca… yes
checking for strchr… yes
checking for memcpy… yes
checking for strncpy… yes
checking for strstr… yes
checking for strlen… yes
checking for strncasecmp… yes
checking for strncmp… yes
checking for socket… yes
checking for gethostbyname… yes
checking for snprintf… yes
checking for strdup… yes
checking for rand_r… yes
checking for localtime_r… yes
checking for getipnodebyname… no
checking for freehostent… no
checking for getopt_long… yes
checking for socket in -lsocket… no
checking for pthread_attr_init in -lpthread… yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating html/Makefile
config.status: creating lib/Makefile
config.status: creating lib/joedog/Makefile
config.status: creating include/Makefile
config.status: creating include/joedog/Makefile
config.status: creating utils/Makefile
config.status: creating include/config.h
config.status: executing depfiles commands
config.status: executing default-1 commands
config.status: executing default-2 commands
config.status: executing default-3 commands
config.status: executing default-4 commands
config.status: executing default-5 commands
config.status: executing default-6 commands

——————————————————–
Configuration is complete

Run the following commands to complete the installation:
make
make install

To upgrade an old siegerc file (optional):
mv ~/.siegerc.new ~/.siegerc

For complete documentation: http://www.joedog.org
——————————————————–

Than Use following command

[root@kapil-pc siege ~]# make
Making all in .
make[1]: Entering directory `/home/kapil/testing/siege’
make[1]: Nothing to be done for `all-am’.
make[1]: Leaving directory `/home/kapil/testing/siege’
Making all in include
make[1]: Entering directory `/home/kapil/testing/siege/include’
make all-recursive
make[2]: Entering directory `/home/kapil/testing/siege/include’
Making all in joedog
make[3]: Entering directory `/home/kapil/testing/siege/include/joedog’
make[3]: Nothing to be done for `all’.
make[3]: Leaving directory `/home/kapil/testing/siege/include/joedog’
make[3]: Entering directory `/home/kapil/testing/siege/include’
make[3]: Nothing to be done for `all-am’.
make[3]: Leaving directory `/home/kapil/testing/siege/include’
make[2]: Leaving directory `/home/kapil/testing/siege/include’
make[1]: Leaving directory `/home/kapil/testing/siege/include’
Making all in lib
make[1]: Entering directory `/home/kapil/testing/siege/lib’
Making all in joedog
make[2]: Entering directory `/home/kapil/testing/siege/lib/joedog’
/bin/sh ../../libtool –tag=CC –mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c -o memory.lo memory.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c memory.c -fPIC -DPIC -o .libs/memory.o
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c memory.c -o memory.o >/dev/null 2>&1
/bin/sh ../../libtool –tag=CC –mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c -o notify.lo notify.c
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c notify.c -fPIC -DPIC -o .libs/notify.o
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c notify.c -o notify.o >/dev/null 2>&1
/bin/sh ../../libtool –tag=CC –mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c -o perl.lo perl.c
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c perl.c -fPIC -DPIC -o .libs/perl.o
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c perl.c -o perl.o >/dev/null 2>&1
/bin/sh ../../libtool –tag=CC –mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c -o util.lo util.c
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c util.c -fPIC -DPIC -o .libs/util.o
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c util.c -o util.o >/dev/null 2>&1
/bin/sh ../../libtool –tag=CC –mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c -o snprintf.lo snprintf.c
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c snprintf.c -fPIC -DPIC -o .libs/snprintf.o
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c snprintf.c -o snprintf.o >/dev/null 2>&1
/bin/sh ../../libtool –tag=CC –mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c -o stralloc.lo stralloc.c
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c stralloc.c -fPIC -DPIC -o .libs/stralloc.o
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I/usr/include/openssl -I/usr/include -W -Wall -g -O2 -c stralloc.c -o stralloc.o >/dev/null 2>&1
/bin/sh ../../libtool –tag=CC –mode=link gcc -W -Wall -g -O2 -o libjoedog.la -version-info 1:0:1 memory.lo notify.lo perl.lo util.lo snprintf.lo stralloc.lo
libtool: link: warning: `-version-info/-version-number’ is ignored for convenience libraries
ar cru .libs/libjoedog.a .libs/memory.o .libs/notify.o .libs/perl.o .libs/util.o .libs/snprintf.o .libs/stralloc.o
ranlib .libs/libjoedog.a
creating libjoedog.la
(cd .libs && rm -f libjoedog.la && ln -s ../libjoedog.la libjoedog.la)
make[2]: Leaving directory `/home/kapil/testing/siege/lib/joedog’
make[2]: Entering directory `/home/kapil/testing/siege/lib’
make[2]: Nothing to be done for `all-am’.
make[2]: Leaving directory `/home/kapil/testing/siege/lib’
make[1]: Leaving directory `/home/kapil/testing/siege/lib’
Making all in src
make[1]: Entering directory `/home/kapil/testing/siege/src’
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c auth.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c base64.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c client.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c cookie.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c cfg.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c crew.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c data.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c date.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c eval.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c getopt.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c getopt1.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c handler.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c hash.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c http.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c init.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c load.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c log.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c main.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c md5.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c sock.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c ssl.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c timer.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c url.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c util.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/include/openssl -I/usr/include -I/usr/include/openssl -I/usr/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -c version.c
/bin/sh ../libtool –tag=CC –mode=link gcc -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -L/usr/lib -lpthread -o siege auth.o base64.o client.o cookie.o cfg.o crew.o data.o date.o eval.o getopt.o getopt1.o handler.o hash.o http.o init.o load.o log.o main.o md5.o sock.o ssl.o timer.o url.o util.o version.o ../lib/joedog/libjoedog.la -ldl -lssl -lcrypto
mkdir .libs
gcc -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -DOPENSSL_NO_KRB5 -g -O2 -o siege auth.o base64.o client.o cookie.o cfg.o crew.o data.o date.o eval.o getopt.o getopt1.o handler.o hash.o http.o init.o load.o log.o main.o md5.o sock.o ssl.o timer.o url.o util.o version.o -L/usr/lib -lpthread ../lib/joedog/.libs/libjoedog.a -ldl -lssl -lcrypto
make[1]: Leaving directory `/home/kapil/testing/siege/src’
Making all in utils
make[1]: Entering directory `/home/kapil/testing/siege/utils’
make[1]: Nothing to be done for `all’.
make[1]: Leaving directory `/home/kapil/testing/siege/utils’
Making all in doc
make[1]: Entering directory `/home/kapil/testing/siege/doc’
make[1]: Nothing to be done for `all’.
make[1]: Leaving directory `/home/kapil/testing/siege/doc’
Making all in html
make[1]: Entering directory `/home/kapil/testing/siege/html’
make[1]: Nothing to be done for `all’.
make[1]: Leaving directory `/home/kapil/testing/siege/html’

Now you can use following command.

[root@kapil-pc siege ~]# make install
Making install in .
make[1]: Entering directory `/home/kapil/testing/siege’
make[2]: Entering directory `/home/kapil/testing/siege’
make[2]: Nothing to be done for `install-exec-am’.
make[2]: Nothing to be done for `install-data-am’.
make[2]: Leaving directory `/home/kapil/testing/siege’
make[1]: Leaving directory `/home/kapil/testing/siege’
Making install in include
make[1]: Entering directory `/home/kapil/testing/siege/include’
Making install in joedog
make[2]: Entering directory `/home/kapil/testing/siege/include/joedog’
make[3]: Entering directory `/home/kapil/testing/siege/include/joedog’
make[3]: Nothing to be done for `install-exec-am’.
make[3]: Nothing to be done for `install-data-am’.
make[3]: Leaving directory `/home/kapil/testing/siege/include/joedog’
make[2]: Leaving directory `/home/kapil/testing/siege/include/joedog’
make[2]: Entering directory `/home/kapil/testing/siege/include’
make[3]: Entering directory `/home/kapil/testing/siege/include’
make[3]: Nothing to be done for `install-exec-am’.
make[3]: Nothing to be done for `install-data-am’.
make[3]: Leaving directory `/home/kapil/testing/siege/include’
make[2]: Leaving directory `/home/kapil/testing/siege/include’
make[1]: Leaving directory `/home/kapil/testing/siege/include’
Making install in lib
make[1]: Entering directory `/home/kapil/testing/siege/lib’
Making install in joedog
make[2]: Entering directory `/home/kapil/testing/siege/lib/joedog’
make[3]: Entering directory `/home/kapil/testing/siege/lib/joedog’
make[3]: Nothing to be done for `install-exec-am’.
make[3]: Nothing to be done for `install-data-am’.
make[3]: Leaving directory `/home/kapil/testing/siege/lib/joedog’
make[2]: Leaving directory `/home/kapil/testing/siege/lib/joedog’
make[2]: Entering directory `/home/kapil/testing/siege/lib’
make[3]: Entering directory `/home/kapil/testing/siege/lib’
make[3]: Nothing to be done for `install-exec-am’.
make[3]: Nothing to be done for `install-data-am’.
make[3]: Leaving directory `/home/kapil/testing/siege/lib’
make[2]: Leaving directory `/home/kapil/testing/siege/lib’
make[1]: Leaving directory `/home/kapil/testing/siege/lib’
Making install in src
make[1]: Entering directory `/home/kapil/testing/siege/src’
make[2]: Entering directory `/home/kapil/testing/siege/src’
test -z “/usr/local/bin” || mkdir -p — “/usr/local/bin”
/bin/sh ../libtool –mode=install /usr/bin/install -c ‘siege’ ‘/usr/local/bin/siege’
/usr/bin/install -c siege /usr/local/bin/siege
make[2]: Nothing to be done for `install-data-am’.
make[2]: Leaving directory `/home/kapil/testing/siege/src’
make[1]: Leaving directory `/home/kapil/testing/siege/src’
Making install in utils
make[1]: Entering directory `/home/kapil/testing/siege/utils’
make[2]: Entering directory `/home/kapil/testing/siege/utils’
make install-exec-hook
make[3]: Entering directory `/home/kapil/testing/siege/utils’
/bin/sh ../utils/mkinstalldirs /usr/local/bin
/bin/sh ../libtool –mode=install /usr/bin/install -c bombardment /usr/local/bin/bombardment
/usr/bin/install -c bombardment /usr/local/bin/bombardment
/bin/sh ../libtool –mode=install /usr/bin/install -c siege2csv.pl /usr/local/bin/siege2csv.pl
/usr/bin/install -c siege2csv.pl /usr/local/bin/siege2csv.pl
/bin/sh ../libtool –mode=install /usr/bin/install -c siege.config /usr/local/bin/siege.config
/usr/bin/install -c siege.config /usr/local/bin/siege.config
make[3]: Leaving directory `/home/kapil/testing/siege/utils’
make[2]: Nothing to be done for `install-data-am’.
make[2]: Leaving directory `/home/kapil/testing/siege/utils’
make[1]: Leaving directory `/home/kapil/testing/siege/utils’
Making install in doc
make[1]: Entering directory `/home/kapil/testing/siege/doc’
make[2]: Entering directory `/home/kapil/testing/siege/doc’
make install-exec-hook
make[3]: Entering directory `/home/kapil/testing/siege/doc’
make[3]: Leaving directory `/home/kapil/testing/siege/doc’
test -z “/usr/local/man/man1” || mkdir -p — “/usr/local/man/man1”
/usr/bin/install -c -m 644 ‘./siege.1’ ‘/usr/local/man/man1/siege.1’
/usr/bin/install -c -m 644 ‘./siege.config.1’ ‘/usr/local/man/man1/siege.config.1’
/usr/bin/install -c -m 644 ‘./bombardment.1’ ‘/usr/local/man/man1/bombardment.1’
/usr/bin/install -c -m 644 ‘./siege2csv.1’ ‘/usr/local/man/man1/siege2csv.1’
test -z “/usr/local/man/man5” || mkdir -p — “/usr/local/man/man5”
/usr/bin/install -c -m 644 ‘./urls_txt.5’ ‘/usr/local/man/man5/urls_txt.5’
test -z “/usr/local/man/man7” || mkdir -p — “/usr/local/man/man7″
/usr/bin/install -c -m 644 ‘./layingsiege.7’ ‘/usr/local/man/man7/layingsiege.7′
make[2]: Leaving directory `/home/kapil/testing/siege/doc’
make[1]: Leaving directory `/home/kapil/testing/siege/doc’
Making install in html
make[1]: Entering directory `/home/kapil/testing/siege/html’
make[2]: Entering directory `/home/kapil/testing/siege/html’
make install-exec-hook
make[3]: Entering directory `/home/kapil/testing/siege/html’
HTML pages not installed
make[3]: Leaving directory `/home/kapil/testing/siege/html’
make[2]: Nothing to be done for `install-data-am’.
make[2]: Leaving directory `/home/kapil/testing/siege/html’
make[1]: Leaving directory `/home/kapil/testing/siege/html’

Now siege installation is done. Than Use following command for using the siege for testing.

[root@kapil-pc siege ~]# siege
SIEGE 2.69
Usage: siege [options]
siege [options] URL
siege -g URL
Options:
-V, –version VERSION, prints version number to screen.
-h, –help HELP, prints this section.
-C, –config CONFIGURATION, show the current configuration.
-v, –verbose VERBOSE, prints notification to screen.
-g, –get GET, pull down headers from the server and display HTTP
transaction. Great for web application debugging.
-c, –concurrent=NUM CONCURRENT users, default is 10
-u, –url=”URL” Deprecated. Set URL as the last argument.
-i, –internet INTERNET user simulation, hits the URLs randomly.
-b, –benchmark BENCHMARK, signifies no delay for time testing.
-t, –time=NUMm TIME based testing where “m” is the modifier S, M, or H
no space between NUM and “m”, ex: –time=1H, one hour test.
-r, –reps=NUM REPS, number of times to run the test, default is 25
-f, –file=FILE FILE, change the configuration file to file.
-R, –rc=FILE RC, change the siegerc file to file. Overrides
the SIEGERC environmental variable.
-l, –log LOG, logs the transaction to PREFIX/var/siege.log
-m, –mark=”text” MARK, mark the log file with a string separator.
-d, –delay=NUM Time DELAY, random delay between 1 and num designed
to simulate human activity. Default value is 3
-H, –header=”text” Add a header to request (can be many)
-A, –user-agent=”text” Sets User-Agent in request
[root@kapil-pc siege ~]#

How to use memcached with php

Using this tutorial you will know, How to use memcached with php. We given code for using memcache with php. we shown you to configure memcache with php.

How to use memcached with php

 

How to use memcached with php
How to use memcached with php

If you try to install memcached with Linux server then use following commands

# yum install libevent
# yum install libmemcached libmemcached-devel
# yum install memcached

For Starting the memcached server
# memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody

11211 port is default port for memcached server.

For using the memecached with php client you need to install following package

# pecl install memcache

After installing all packages restart the apache server.

# /etc/sbin/service httpd restart

<!--?php
/* OO API */
$memcache_obj = new Memcache;
$memcache_obj--->connect('memcache_host', 11211);
$memcache_obj->set('any_key', 'some value', MEMCACHE_COMPRESSED, 50);
echo $memcache_obj->get('any_key');
?>

Important Note: Memcached key has limitations of 250 charactors, So key value should be with in 250 charactors.

How to remove the www from url with rewite rule

Now these days keeping www in URL is becoming old fashion. How can check many websites for that and the current example is twitter.com. Using apache rule you can remove the www from url with rewite rule.

How to remove the www from url with rewite rule

How to remove the www from url with rewite rule
How to remove the www from url with rewite rule

I specially dont like to put www in URL so we can easily remove the www from URL.

Open your apache configuration file. If you are using Linux then open file from following location

# vim /etc/httpd/conf/httpd.conf

put following lines in your virtual directory section.


# remove www from url
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^.*$ http://example.com%{REQUEST_URI} [R=301,L]

We can use this rewrite rule in .htaccess file also. But make sure .htaccess is enable through apache server.


# remove the www from URL.
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^.*$ http://example.com%{REQUEST_URI} [R=301s,L]

For WordPress websites for seo purpose putting above lines in .htaccess file is really best. That will gives you the really great result in future.

install php and memcached server on centos5

In this article I given full step by step installation guide about php and memcached . Check full article for install php and memcached server on centos5.

install php and memcached server on centos5

What is Memcached?

Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

install php and memcached server on centos5
install php and memcached server on centos5

Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.

Please use following commands for installtion;
[root@ip-192-168-2-125 wordpressapi]# wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm

[root@ip-192-168-2-125 wordpressapi]# yum remove php-common

[root@ip-192-168-2-125 wordpressapi]# yum install php-pdo php-mcrypt squirrelmail php-pecl-apc php-xml php-gd php-devel php php-imap php-pgsql php-pear php-soap php-mbstring php-ldap php-mysql php-cli php-pecl-memcache

[root@ip-192-168-2-125 wordpressapi]# /etc/init.d/memcached restart
Shutting down Distributed memory caching (memcached): [ OK ]
Starting Distributed memory caching (memcached): [ OK ]

[root@ip-192-168-2-125 wordpressapi]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

[root@ip-192-168-2-125 wordpressapi]# vim /etc/php.ini
In php.ini file Please find the “extension=modulename.extension” words
Under that sentance please paste following line:
extension=memcache.so
Note: dont comments that line.

[root@ip-192-168-2-125 wordpressapi]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@ip-192-168-2-125 wordpressapi]#

add www to domain name through apache or htaccess

We given the detailed information about how to add www to domain name through apache or htaccess. Using apache rule we can achieve this.

add www to domain name through apache or htaccess
add www to domain name through apache or htaccess

Just use following code in apache configuration file or .htaccess file.

If you are using the shared hosting then please go with only .htaccess file.

Just copy paste following code in .htaccess file.

<IfModule mod_rewrite.c>

Options +FollowSymlinks

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.wordpressapi\.com$ [NC]

RewriteRule ^(.*)$ http://www.purabtech.in/files/$1 [L,R=301]

</IfModule>

Image upload issue in wordpress with nginx

Nginx server is used by wordpress itself. We solved Image upload issue in wordpress with nginx. you can use following code.

Image upload issue in wordpress with nginx

Please Use the following code:


location ~ ^.+\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
root /usr/share/nginx/html/wordpressmu;
rewrite ^/.*(/wp-admin/.*\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ $1 last;
rewrite ^/.*(/wp-includes/.*\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ $1 last;
rewrite ^/.*(/wp-content/themes/.*\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ $1 last;
rewrite ^/.*(/wp-content/.*\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ $1 last;
rewrite ^.*/files/(.*(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ /wordpress/wp-content/blogs.php?file=$1 last;

expires 10d;
break;
}

Force remove the rpm from linux box

I installed the Mysql-cluster on fedora11 box.
When I tried the wordpress local setup on by box I got following error.
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”

I used the noraml command for uninstalling the rpm package.
#rpm -e PACKAGE_NAME
I tried so many things but failed. Nothing is removed. Then I tried this command. I still got following result.

#yum list Mysql*.*
Installed Packages
MySQL-Cluster-gpl-debuginfo.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-extra.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-management.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-server.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-shared.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-storage.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-tools.i386

I tried the following commands…
#yum remove MySQL-Cluster-gpl-shared
This really worked…Yes this is final solution.

[root@localhost siwan]# yum install mysql mysql-server php-mysql mysql-common mysql-libs

[root@localhost siwan]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name, using localhost.localdomain for ServerName

This will solved your problem. Following links I found usefull:

http://www.rikers.org/rpmbook/node18.html
http://www.rikers.org/rpmbook/node20.html
http://www.rikers.org/rpmbook/node19.html

How to install and setup varnish on fedora9

Varnish is an HTTP accelerator designed for content-heavy dynamic web sites. In contrast to other HTTP accelerators, many of which began life as client-side proxies or origin servers, Varnish was designed from the ground up as an HTTP accelerator.

Use following command:
[root@localhost siwan]# su
[root@localhost siwan]# yum install varnish
ncurses are needed for textual “graphical” configuration.
[root@localhost siwan]# yum install ncurses-devel

Edit the setting of varnish
[root@localhost siwan]# vim /etc/varnish/default.vcl

Start the varnish.
[root@localhost varnish]# /etc/init.d/varnish start

on startup set varnish on
[root@localhost varnish]# /sbin/chkconfig varnish on

How to use hosts file on Mac, Windows and Linux

The hosts file is a computer file used by an operating system to map hostnames to IP addresses.
On many operating systems, the host file content is used preferentially over other methods,
such as the Domain Name System (DNS). Unlike DNS, the hosts file is under the control of the local computer’s administrator

Locate the file “Hosts” on your computer:
Windows
Windows 95/98/Me c:\windows\hosts
Windows NT/2000/XP Pro c:\winnt\system32\drivers\etc\hosts
Windows XP Home c:\windows\system32\drivers\etc\hosts

Linux
/etc/hosts or /etc/host.conf or /etc/nsswitch.conf

Symbian
C:\system\data\hosts

Mac OS
/private/etc/hosts or /etc/hosts

In that file you can edit entry like this

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost localhost yourlocaldomain.com , example.com
::1 localhost6.localdomain6 localhost6
192.168.2.200 intranet

directory.example.com 71.155.186.91

Solved: Access denied with code 400 (phase 2).

When I restarted my apache server. I am using the fedora 9 here.

I did not get my default page opened in browser.
When I opened the apache error log file. I saw following error.

ModSecurity: Access denied with code 400 (phase 2). Pattern match “%0[ad]” at REQUEST_HEADERS:Cookie. [id “950910”] [msg “HTTP Response Splitting Attack. Matched signature <%0a>”] [severity “ALERT”] [hostname “localhost”] [uri “/”] [unique_id “SuWoGH8AAAEAAFF3rKEAAAAA”]

I after doing some R&D but I did not got any perfect soluction.
Then I cleared the whole browser cookies. That solves my problem.

solution – clear the browser cookies…