Monday, January 16, 2012
Amazon announces free tier instance Windows AMI
Amazon announces today that "AWS Free Usage Tier will now include Amazon EC2 instances running Microsoft Windows Server. Customers eligible for the AWS Free Usage tier can now use up to 750 hours per month of t1.micro instances running Microsoft Windows Server for free."
Tuesday, January 10, 2012
Cloud Computing vs Virtualization
Cloud Computing and virtualization are often mentioned together and I have been asked what is the difference between the two recently. There are overlaps for sure. Cloud Computing delivers computing as a pay-per-use service that is based on a pool of virtualized computing resources. Cloud Computing is more from an end user and business perspective while virtualization is more from technology and hardware management perspective. Virtualization a technology that is available in several forms to allow technical resources to be separated from the physical servers they run on and treated as an abstraction layer. Virtualization is a key part of cloud computing. Amazon AWS is an example of Cloud Computing service.
Tuesday, January 3, 2012
Steps for creating automatic startup/shutdown scripts for Tomcat in Amazon EC2
After Tomcat is installed in EC2, it's time to create a startup/shutdown service script. Below are steps:
- login to EC2 instance with putty
- sudo su
- cd /etc/init.d
- vim tomcat
- put following into the file #!/bin/bash
- Change permissions. chmod 755 tomcat
- Add script to system services. chkconfig --add tomcat
- Test it out. service tomcat start, service tomcat stop.
# chkconfig: 234 20 80
# description: Tomcat Server basic start/shutdown script
# processname: tomcat
JAVA_HOME=/usr/java/jdk1.6.0_24
export JAVA_HOME
TOMCAT_HOME=/usr/share/apache-tomcat-7.0.23/bin
START_TOMCAT=/usr/share/apache-tomcat-7.0.23/bin/startup.sh
STOP_TOMCAT=/usr/share/apache-tomcat-7.0.23/bin/shutdown.sh
start() { echo -n "Starting tomcat: "
cd $TOMCAT_HOME
${START_TOMCAT}
echo "done." }
stop() { echo -n "Shutting down tomcat: "
cd $TOMCAT_HOME
${STOP_TOMCAT} echo "done." }
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
Monday, January 2, 2012
Create Swap Space in Amazon EC2 instance
Just found out my Amazon EC2 micro instance does not have any swap space. The memory comes with the micro instance is enough for a regular PHP app, but not enough for any J2EE application. It's time to add a file system swap. Below are steps for creating a swapfile:
- login as ec2-user with putty.
- sudo su
- dd if=/dev/zero of=/swapfile bs=1024 count=1048576
- /sbin/mkswap /swapfile
- /sbin/swapon /swapfile
- /sbin/swapon -s
Sunday, January 1, 2012
Install Tomcat to Amazon EC2 instance
To install Tomcat, first we need to install a JDK. Steps to install JDK.
- Login to AWS EC2 instance with putty.
- sudo su
- Create a directory for Java installation. cd /usr/share, mkdir java, cd java.
- Download a JDK from Oracle. wget http://download.oracle.com/otn-pub/java/jdk/7u2-b13/jdk-7u2-linux-i586.tar.gz
- Install it. tar -xzf jdk-7u2-linux-i586.tar.gz
- Test it. /usr/share/java/ jdk1.7.0_02/bin/java -version.
- Download Tomcat to /usr/share directory. wget http://www.trieuvan.com/apache/tomcat/tomcat-7/v7.0.23/bin/apache-tomcat-7.0.23.tar.gz
- Install Tomcat. tar -xzf apache-tomcat-7.0.23.tar.gz
- set JAVA_HOME $env in catalina.sh. cd /usr/share/apache-tomcat-7.0.23/bin,
vi catalina.sh and add following line after the first line. JAVA_HOME=/usr/share/java-1.7.0/jdk1.7.0_02 - Start it. ./start.sh. Check log and fix errors if any.
Subscribe to:
Posts (Atom)