Friday, April 27, 2012

Install Tomcat 7 on Amazon Linux instance

In the previous post we spoke about how to build and configure Amazon EC2 Linux instance in terms of free tier offered by Amazon. Amazon propose list of services in scope of cloud platform where we can easily deploy and launch simple web application or test existing web solution. We've decided to use Amazon cloud platform as staging environment where Tomcat 7 web-server will be installed.

The process of installing Tomcat 7 web-server is very simple, furthermore Tomcat 7 included in the package repository of Amazon Linux AMI.


Install Tomcat 7

1. Initiate SSH session (as 'ec2-user') and connect to the Amazon Linux instance by it public DNS name.
2. Install Tomcat 7 together with standard Tomcat samples, documentation, and management web apps:
 sudo yum install tomcat7-webapps tomcat7-docs-webapp tomcat7-admin-webapps
3. Start/Sotp/Restart Tomcat 7 as a service.
startp:
 sudo service tomcat7 start  
stop:
 sudo service tomcat7 stop  
restart:
 sudo service tomcat7 restart  
4.  Add Tomacat 7 service to the autostart.
 sudo chkconfig tomcat7 on  
5. Add 8080 port to the security group associated with Amazon Linux instance using AWS Management Console.

6. Connect to the instance by public DNS name on port 8080.


Configure Amazon Elastic Load Balancer

Amazon ELB automatically distributes incoming application traffic across multiple Amazon EC2 instances.
1. Sign in to the AWS Management Console and navigate to the Amazon EC2 tab.
2. Select Load Balancer section from the left navigation menu and press Create Load Balancer button.
3. In the Load Balancer Configuration wizard set load balancer name and point 80 port to 8080 port and press Continue button.

4. Configure health check options, set ping path as /index.jsp and press Continue button.

5. Add instance to the load balancer and press Continue button.

6. On the last step review load balancer configuration and press Create button.
7. Select created load balancer from the list and wait while status updated.

8. Connect to the instance with a load balancer DNS name.


17 comments:

  1. Thank you so much for this info. I'm used to seeing startup.sh and when that wasn't there I had no idea what to do.

    ReplyDelete
  2. I have written a Java based portable utility for automating the above steps for creating multiple instances. Since Java is platform independent, this utility works on all operating systems

    ReplyDelete
  3. Thank you for the load balancer info!

    ReplyDelete
  4. What yum repo contains tomcat7? I get:
    sudo yum install tomcat7-webapps tomcat7-docs-webapp tomcat7-admin-webapps
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: mirror.cogentco.com
    * epel: mirror.symnds.com
    * extras: mirror.atlanticmetro.net
    * updates: mirror.cogentco.com
    Setting up Install Process
    No package tomcat7-webapps available.
    No package tomcat7-docs-webapp available.
    No package tomcat7-admin-webapps available.
    Error: Nothing to do

    ReplyDelete
  5. Do u know how can i increase the memory size used by tomcat..
    I followed these steps but now cant find startup.sh or catalina.sh in installed directory.

    ReplyDelete
  6. hi...Im student from Informatics engineering nice article,
    thanks for sharing :)

    ReplyDelete
  7. Thanks for sharing informative article on Salesforce technology. Your article helped me a lot to understand the career prospects in cloud computing technology. Cloud Computing Training in Chennai

    ReplyDelete
  8. Excellent post!!! In this competitive market, customer relationship management plays a significant role in determining a business success. That too, cloud based CRM product offer more flexibility to business owners to main strong relationship with the consumers. Salesforce Training Institutes in Chennai | Salesforce Training in Chennai

    ReplyDelete
  9. In coming years, cloud computing is going to rule the world. The cloud based CRM tool provider like Salesforce have massive demand in the market. Thus talking Amazon Web Services Training in Chennai from reputed Amazon Web Services Training will ensure bright career prospects for aspiring professionals.

    ReplyDelete
  10. Thanks for this great post! - This provides good insight. You might also be interested to know more about generating more leads and getting the right intelligence to engage prospects.
    Techno Data Group implements new lead gen ideas and strategies for generating more leads and targeting the right leads and accounts.
    Amazon AWS Users Email & Mailing List

    ReplyDelete
  11. Thanks for providing this informative information you may also refer.
    http://www.s4techno.com/blog/2016/07/15/write-command-find-files-accessed-within-last-30-days/

    ReplyDelete
  12. This article helps me to know about the essential skills for learning the Cloud Computing and keep on updating us. This content is really helped me to know about the importance of Cloud Computing. Cloud Computing Training in Chennai | Cloud Computing Training | Cloud Computing Courses

    ReplyDelete
  13. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Android Training in Chennai
    Ios Training in Chennai

    ReplyDelete
  14. Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
    http://www.mcdonaldsgutscheine.net | Startlr.com | SaludLimpia.com

    ReplyDelete
  15. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
    Hadoop Training Institute In chennai

    ReplyDelete