Sunday, December 15, 2013

changing tomcat port from 8080 to 80

Tomcat by default runs on port 8080. How to make it  run on port 80? so that you don't have to specify :8080 along with the url. In this post we will see how to change the tomcat port from 8080 to 80 on Ubuntu Linux.

Open the tomcat mail configuration file server.xml. The path to this file may vary depending on your installation path and method.

#sudo vim /var/lib/tomcat7/conf/server.xml

Change the following line 

Installing eclipse kepler on ubuntu from tar source

Installing Eclipse Kepler in Ubuntu 12.04
First download the eclipse tar.gz package from http://www.eclipse.org/downloads/

We can do this from command line using wget also.

Make sure you downloaded the particular source for your system architecture. 32 bit or 64 bit.

keep the download in wherever you want the eclipse to install. In this example we are installing eclipse kepler on home directory of the user.

Thursday, December 12, 2013

converting ppk to pem in Ubuntu Linux

We have seen how to convert pem to ppk and how to convert ppk tp pem on windows systems. But how to do this on Linux? In this post we will see how this can be done in Linux command line. We will be using Ubuntu Linux in this example. We will be using the tool puttygen to do this.

Installing puttygen:
sudo apt-get install putty-tools

Converting pem to ppk
puttygen key.pem -o key.ppk

Converting ppk to pem
puttygen key.ppk -O private-openssh -o key.pem




Wednesday, December 11, 2013

Screen command in linux

I have wrote about screen command long back. But I'm writing it again because last few days I was fighting with network connectivity issues. screen is your best friend when you have a bad connection.

Why screen?
Suppose you are running a bash script. What if you lost connection in between? script fails.

How to use?
You can create a screen and run the script inside the screen. You can detach and attach to the  screen later whenever you want. Even if the connection fails between your remote server and laptop; the script will execute safe inside screen.

Friday, November 15, 2013

Creating video clips using Amazon Elastic Transcoder


Amazon Elastic transcoder is a service from amazon in amazon web services to transcode videos from one format to another format. It relatively a new tool in aws but recently they have added a lot of features to it. The latest one is the clip generation. Its a very easy thing.

Thursday, November 7, 2013

Installing PHP XCache in CentOS / Redhat / Fedora

XCache is a fast, stable PHP opcode cacher. It accelerates the performance of PHP on servers. It increases the performance by removing the repeated compilation time of PHP scripts by caching the compiled state of PHP scripts into the RAM and uses the compiled version from the RAM thus saving the compilation time again. This will increase the speed up to 5 times.

Friday, October 25, 2013

Amazon ec2 ssh Server refused our key

I was getting Server refused our key error while trying to login in my Amazon ec2 instance. It was working perfect. When I checked the authorized keys, all the keys are there. Also sshd_config file is intact.

Sunday, September 29, 2013

Creating custom error pages in amazon cloudfront

You know Amazon is a company who introduce new features often. Recently they came up with custom error page for cloudfront cdn. In this post we will see how to create a custom error page for 404(page not found) errors.

Open the cloudfront distribution
Click on error pages.








Tuesday, September 17, 2013

Checking the amazon cloudfront edge-location in use

You have uploaded your files in Amazon S3 or Custom Origin. Created a cloudfront distribution. You checked and everything is working. Amazon has started new edge-locations in India. Mumbai and Chennai. How can you check your files are served from nearest edge? Or is it served from far edge? Then you have to change something. Getting the content from the nearest edge will reduce the latencies and improve the quality of service.

You can verify this two ways.

1) You can check Using the Amazon test tool. Easiest way.
2) Enable the cloudfront logs and check the logs. Little painful. But worth it.

Thursday, September 5, 2013

chkconfig add service in linux

We all now we use chkconfig entry to survive the reboots. If you enable a service for a particular runlevel using chkconfig the service will automatically start when server reboots in that particular runlevel. In this post we will see how to add a service to chkconfig.

You can list the entries using the following command
[root@localhost init.d]# chkconfig --list Service
Service          0:off   1:off   2:on    3:on    4:on    5:off   6:off

Wednesday, August 28, 2013

Installing Centos on HP Proliant DL360e Gen8 with B120i controller

Installing centos 5.7 on HP Proliant DL360e Gen8 was a headache. First of all it comes with HP B120i Dynamice smart array controller which centos or redhat doesnt detect by default. We have to install a source driver from HP separately to detect this controller.

At first I created the RAID 1 logical array using the acu(array configuration utility) oh HP server. And started installing Centos. Installation proceeded but at the time of drive select it showed the two 500GB hard disks instead of one single raid 1 device. That means os couldn't detect the storage controller.

After a lot of googling and HP customer support I found the steps to do it.
HP B120i driver is supported from Redhat/Centos 5u7 onwards.

Tuesday, August 27, 2013

Centos installing both i386 and x86_64 rpms

If you are running rhel/centos x86_64 systems,you can see redhat/centos has installed both i386 and x86_64 rpms. It will create a lot of dependency problems, conflicts etc.

in case if you are installing httpd you may end up in glibc duplicate errors.

rpm -qa | grep glibc
glibc-devel-2.5-65.el5_7.1
glibc-devel-2.5-65.el5_7.1
!--more-->
To view the architecture of installed files add the following line to ~/.rpmmacros
#vi ~/.rpmmacros
%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}
Save the file.

Now when querying
# rpm -qa | grep glibc
glibc-devel-2.5-65.el5_7.1.x86_64
glibc-devel-2.5-65.el5_7.1.i386


You can solve this problem by adding the following lines to /etc/yum.conf
exactarch=1
exclude=*.i386 *.i586 *.i686

Also remove all the duplicate files as follows.
yum remove glibc-devel-2.5-65.el5_7.1.i386

Installing passive vsftpd in amazon ec2

We have seen how to enable passive mode in vsftpd ftp daemon in our previous post. In this one we will see how to install vsftpd and enable passive mode in amazon ec2 instances.

Install vsftpd package
#yum install vsftpd

Open the vsftpd conf file for editing
#vi /etc/vsftpd/vsftpd.conf

Add the following lines at bottom of the configuration file.

Saturday, July 27, 2013

Adding exception in mod_jk.conf using JkUnMount

We have seen in our older post how to connect httpd and Apache tomcat using connector mod_jk. httpd as a front end and Apache tomcat as back end. But in that configuration all the requests coming to httpd is redirected to tomcat. What if you want to load something using Apache web server itself? In this post we will see how to add exception in mob_jk using JkUnMount.

Tuesday, April 2, 2013

TCP trace route in windows using tracetcp

Trace route is a nice tool to find where in network resides the actual problem. Windows tracert uses ICMP. ICMP traces can often be inaccurate. To get a more realistic picture of what is going on we will use TCP based trace route. For this in windows based systems we can use tracetcp tool. In this post we will see how to install tracetcp in windows 7 and use it.


You can download a TCP trace route utility for Windows from the following location:
http://tracetcp.sourceforge.net/

You will need to download and install WinPcap first to be able to use tracetcp from the command line. You can download WinPcap from here:
http://www.winpcap.org/install/default.htm

Monday, March 25, 2013

Amazon AMI Copy example with snapshots

Amazon recently announced a new feature to copy the AMIs over regions. It makes replication very easy process. You have to create Linux AMI or Windows AMI of your instances. Then copy it to other regions in case if the current region goes down you can run your site/application from other regions. I have explained how to create AMIs of Linux and windows in previous posts. Also the replication of AMI. But this feature makes it very easy.

In this example we will show how to copy an AMI from North Virginia(US-East) to Oregon(US-West):