Tuesday, December 4, 2012

How to limit the connection per ip in the server?

We can limit the number of connections per IP on server by installing mod_limitipconn for apache.This will helpfull to control the load in server also.

# cd /usr/local/src

Now, we need to grab the file (this is the latest version as of this post):

# wget http://dominia.org/djao/limit/mod_limitipconn-0.23.tar.bz2

# tar xjvf mod_limitipconn-0.23.tar.bz2

# cd mod_limitipconn-0.23

# apxs -i -a -c mod_limitipconn.c

# cd /etc/httpd/conf

Saturday, December 1, 2012

How to increase the swap filesize in server?

Sometimes, we need to increase the swap file for better performance and procedure as below.

First, Create an 1024MB filesize:

# dd if=/dev/zero of=/swapfile bs=1024 count=1048576

    1. if=/dev/zero : Read from /dev/zero file. /dev/zero is a special file in that provides as many null characters to build storage file called /swapfile.
    2. of=/swapfile : Read from /dev/zero write stoage file to /swapfile.
    3. bs=1024 : Read and write 1024 BYTES bytes at a time.
    4. count=1048576 : Copy only 1048576 BLOCKS input blocks. [ 1024 * 1024MB = 1048576 ]

Make the file as swap filesystem:

# mkswap /swapfile

Set the permission for /swapfile:

# chown root:root /swapfile
# chmod 0600 /swapfile

How to increase the temp partition in linux?

First kill the process which using the tmp directory and backup the tmp directroy.

# cp -prf /tmp /tmp.bak

Unmount the temp:

#umount /tmp

Create an 2GB filesize:

# dd if=/dev/zero of=/usr/tmpDSK bs=1024k count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 73.6908 seconds, 29.1 MB/s

# du -sch /usr/tmpDSK
2.1G /usr/tmpDSK
2.1G total

How to install the Multimedia package ( FFmpeg, flvtool2, facc....) in linux server ?

First, we have check whether the GNU C and C++ compilers and other development utilities installed or not. If not then install the utilites of it then only we can proceed to install the multimedia package.


# yum groupinstall -y "Development Tools"


#apt-get install build-essential

Dynamic Linked Libraries Path:

Linux uses a system of shared libraries, similar to Windows dlls, for the efficient use of space and resources, and modularity. Add those below entry in  /etc/ld.so.conf


# ldconfig