Posts

Showing posts from 2014

Varnish Installation on Centos 7

In this post we are going to install varnish cache on Centos Linux 7. We are going to install Varnish Cache 4 on the Centos Linux 7 i.e. 64 bit of architecture using the yum.  Follow the following steps to install the varnish cache on your server running Centos 7 Linux. Step 1:- Install the following rpm from the varnish-cache repo  yum install https://repo.varnish-cache.org/redhat/varnish-4.0/el7/x86_64/varnish/varnish-debuginfo-4.0.2-1.el7.centos.x86_64.rpm   yum install https://repo.varnish-cache.org/redhat/varnish-4.0/el7/x86_64/varnish/varnish-libs-4.0.2-1.el7.centos.x86_64.rpm   yum install https://repo.varnish-cache.org/redhat/varnish-4.0/el7/x86_64/varnish/varnish-libs-devel-4.0.2-1.el7.centos.x86_64.rpm   yum install https://repo.varnish-cache.org/redhat/varnish-4.0/el7/x86_64/varnish/varnish-docs-4.0.2-1.el7.centos.x86_64.rpm  

Varnish Installation using yum

Image
You can install varnish using the yum or source. We are going to install via yum in this post Things to consider prior to installation is which version of Varnish cache you are going to install and select the appropriate version to install from the Varnish repo site. You will see each version having 3 folders based on the linux release. Select the appropriate one during the installation.

Script for getting load, Memory usage and apache connection count in Linux

Image
Following script can be used to format the Average load, Memory used and Apache connection count in Linux format it and present it in a human readable form. The script is designed to read the hostname , date and time of execution, Average load, Apache process count, physical and swap memory usage

Setting private key in putty for password less access

Image
You can generate a private key using the putty key generator and use the key to simply click and connect to your Linux server with your user account with a simple click of a mouse without having to inputting all the credentials everytime you have to access the server. Follow these simple steps to set the private key in putty 1. Enter your user followed by ip in the hostname and saved session on the home screen of the putty

Understanding Varnish Cache

Image
This is in continuation to my previous post on Reverse proxy servers. Varnish is a caching http reverse proxy which means it works as an intermediatery between your client and web server, receives the requests from the client and tries to answer them from the cache , In case if varnish is not able to answer the request from the cache it will forward the request to the backend web server and fetch the response  while storing the response in it cache and delivering the response to the client. It may be understood as when a  user first time visits the website and requests the page , varnish keeps the copy of the served page and when the user re-visit the same page again, it gets served from the saved copy of the page from the varnish cache instead of re-requesting the page from the web server, Which improves the website's performance and scalability and improves response time. Varnish cache response is highly responsive and is very faster than the typical backend ser...

Understanding Varnish Cache

Image
This is in continuation to my previous post on Reverse proxy servers . Varnish is a caching http reverse proxy which means it works as an intermediatery between your client and web server, receives the requests from the client and tries to answer them from the cache , In case if varnish is not able to answer the request from the cache it will forward the request to the backend web server and fetch the response  while storing the response in it cache and delivering the response to the client. It may be understood as when a  user first time visits the website and requests the page , varnish keeps the copy of the served page and when the user re-visit the same page again, it gets served from the saved copy of the page from the varnish cache instead of re-requesting the page from the web server, Which improves the website's performance and scalability and improves response time.

Understanding the Reverse Proxy Server

Image
A reverse proxy server retrieves the resources on behalf of a client requesting those resources and returns it to the client as it has originated from them itself. It can be understood as an intermediately between the client and the webserver, when a client is requesting service through internet which is coming to the reverse proxy server , which retrieves the resources from the web server in an internal network and serves it to the client without the client aware about the internal network or its origin i.e. web servers.

Understanding the Reverse Proxy Server

Image
A reverse proxy server retrieves the resources on behalf of a client requesting those resources and returns it to the client as it has originated from them itself. It can be understood as an intermediately between the client and the webserver, when a client is requesting service through internet which is coming to the reverse proxy server , which retrieves the resources from the web server in an internal network and serves it to the client without the client aware about the internal network or its origin i.e. web servers.

Understanding, Creating, Extending, Calculating the Swap Space in Linux

1.         Concept of swap space in Linux? Ans:- Linux allows a hard disk to be used as memory (virtual memory) apart from the RAM( physical memory) so that the kernel is able to write off the unused content from the RAM to this virtual memory and whenever the content is required again it writes back.  Since the unused content no longer holds the space in physical memory it can be used by some other process. All this is done internally and a user is never aware of the backend process. 2.         Creating a Swap Space in Linux? Ans:-    $ dd if=/dev/zero of=/extra-swap bs=1024 count=1024         1024+0 records in         1024+0 records out         $ dd if is used to create a file of is used to create the file name that is extra-swap here bs is for the size in ...

Understanding, Creating, Extending, Calculating the Swap Space in Linux

1.         Concept of swap space in Linux? Ans:- Linux allows a hard disk to be used as memory (virtual memory) apart from the RAM( physical memory) so that the kernel is able to write off the unused content from the RAM to this virtual memory and whenever the content is required again it writes back.  Since the unused content no longer holds the space in physical memory it can be used by some other process. All this is done internally and a user is never aware of the backend process. 2.         Creating a Swap Space in Linux? Ans:-    $ dd if=/dev/zero of=/extra-swap bs=1024 count=1024         1024+0 records in         1024+0 records out         $ dd if is used to create a file of is used to create the file name that is extra-swap here bs is for the size in ...

Tomcat Installation

As a pre-requisite for the installation of Tomcat , you need to have Java installed. Check my previous post for the detailed instruction for  the Java Installation and setting up the necessary environment variables for the Java to work. Download the Tomcat Installation file [root@localhost tomcat]# mkdir -p /usr/tomcat    [root@localhost tomcat]# cd /usr/tomcat/    root@localhost tmp]# wget https://archive.apache.org/dist/tomcat/tomcat-7/v7.0.39/bin/apache-tomcat-7.0.39.tar.gz    --2014-04-01 01:32:13-- https://archive.apache.org/dist/tomcat/tomcat-7/v7.0.39/bin/apache-tomcat-7.0.39.tar.gz    Resolving archive.apache.org... 192.87.106.229, 140.211.11.131, 2001:610:1:80bc:192:87:106:229    Connecting to archive.apache.org|192.87.106.229|:80... connected.    HTTP request sent, awaiting response... 200 OK    Length: 7831716 (7.5M) [application/x-gzip]    Saving to: `apache-tomcat-7.0.39.tar.gz' ...

Tomcat Installation

As a pre-requisite for the installation of Tomcat , you need to have Java installed. Check my previous post for the detailed instruction for  the J ava Installation and setting up the necessary environment variables for the Java to work. Download the Tomcat Installation file [root@localhost tomcat]# mkdir -p /usr/tomcat    [root@localhost tomcat]# cd /usr/tomcat/    root@localhost tmp]# wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.39/bin/apache-tomcat-7.0.39.tar.gz    --2014-04-01 01:32:13-- http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.39/bin/apache-tomcat-7.0.39.tar.gz    Resolving archive.apache.org... 192.87.106.229, 140.211.11.131, 2001:610:1:80bc:192:87:106:229    Connecting to archive.apache.org|192.87.106.229|:80... connected.    HTTP request sent, awaiting response... 200 OK    Length: 7831716 (7.5M) [application/x-gzip]    Saving to: `apache-tomcat-7.0.39.tar.gz' ...

Java Installation on Linux

Java can be installed on Linux as Download Java ( JDK 6 Update 24 )  https://www.oracle.com/technetwork/java/javase/downloads/java-se-6u24-download-338091.html    Creating a Directory for the Java Installation file [root@localhost Desktop]# mkdir -p /usr/java    [root@localhost Desktop]# cd /usr/java/    [root@localhost java]# du -sh jdk-6u24-linux-i586.bin    82M   jdk-6u24-linux-i586.bin    [root@localhost java]# chmod 777 jdk-6u24-linux-i586.bin    [root@localhost java]# ls -ltr jdk-6u24-linux-i586.bin    -rwxrwxrwx 1 ankit ankit 84927175 Apr 1 01:18 jdk-6u24-linux-i586.bin   Installing the Java  [root@localhost java]# ./jdk-6u24-linux-i586.bin    [root@localhost Desktop]# ln -s /usr/java/jdk1.6.0_24/bin/java /usr/bin/java    Finally check the version of the Java as [root@localhost bin]# java -version   java version "1.6.0_24"...

Java Installation on Linux

Java can be installed on Linux as Download Java ( JDK 6 Update 24 )  http://www.oracle.com/technetwork/java/javase/downloads/java-se-6u24-download-338091.html    Creating a Directory for the Java Installation file [root@localhost Desktop]# mkdir -p /usr/java    [root@localhost Desktop]# cd /usr/java/    [root@localhost java]# du -sh jdk-6u24-linux-i586.bin    82M   jdk-6u24-linux-i586.bin    [root@localhost java]# chmod 777 jdk-6u24-linux-i586.bin    [root@localhost java]# ls -ltr jdk-6u24-linux-i586.bin    -rwxrwxrwx 1 ankit ankit 84927175 Apr 1 01:18 jdk-6u24-linux-i586.bin  

Source Installation of Apache

For the source installation the Apache web server following  are the steps:- 1. Download  the Apache Web Server as # wget http://archive.apache.org/dist/httpd/httpd-2.2.24.tar.gz   2. Extract the compressed file as [root@localhost ~]# tar -zxvf httpd-2.2.24.tar.gz 3. Run the configuration file as cd /tmp/httpd/httpd-2.2.24    ./configure --enable-so --enable-expires --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-headers --enable-ssl --enable-http --disable-userdir --enable-rewrite --enable-deflate --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-cgi --disable-dbd --enable-modules=most --with-mpm=worker --prefix=/usr/local/apache2   configure:- It is the configuration for httpd --enable  :-  Used for installing the specific modules to be used by Apache. If not used the Apache will be installed with all the modules. ...