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.


58 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. 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
  7. 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
  8. AWS is designed to allow application providers, ISVs, and vendors to quickly and securely host your applications. Credo Systemz provides the best AWS Training to get your certifications easily. Learn how our role-based and specialty certifications help you demonstrate your deep AWS knowledge. Credo Systemz provides the best AWS Training to get your certifications easily.

    aws training in chennai with placement | aws authorized training partner in chennai | aws solution architect training in chennai

    ReplyDelete
  9. Thanks for providing your information, Keep update AWS Online Training

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. Lovely Article, Very Helpful Please keep posting AWS Training in Chennai

    ReplyDelete
  12. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Devops training in sholinganallur
    Devops training in velachery

    ReplyDelete
  13. Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.

    Best Selenium Training in Chennai | Selenium Training Institute in Chennai | Besant Technologies

    Selenium Training in Bangalore | Best Selenium Training in Bangalore

    AWS Training in Bangalore | Amazon Web Services Training in Bangalore

    ReplyDelete
  14. That is very interesting; you are a very skilled blogger. I have shared your website in my social networks! A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article.
    safety courses in chennai

    ReplyDelete
  15. I really enjoyed while reading your article, the information you have mentioned in this post was damn good. Keep sharing your blog with updated and useful information.Click here: Best Python Online Training || Learn Python Course

    ReplyDelete
  16. I think you have a long story to share and i am glad after long time finally you cam and shared your experience.
    angularjs online training

    apache spark online training

    informatica mdm online training

    devops online training

    aws online training

    ReplyDelete
  17. I would really like to read some personal experiences like the way, you've explained through the above article. I'm glad for your achievements and would probably like to see much more in the near future. Thanks for share.
    Microsoft Azure online training
    Selenium online training
    Java online training
    uipath online training
    Python online training


    ReplyDelete
  18. I am really happy to read your blog. your blog is very good and informative for me.
    Your blog contain lots of information. It's such a nice post. I found your blog through my friend if you want to know about more property related information please check out here. With the experience of over 3 decades, Agrawal Construction Company is the biggest and the best builders in bhopal and the trust holder of over 10000 families. Agrawal Construction Company Bhopal is serving society, building trust & quality with a commitment to cutting-edge design and technology. Agrawal Construction Company's vision is to 'building trust & quality' which extends to developing residential, commercial and township projects in all the directions of the beautiful City of Lakes Bhopal and hence it is among the top builders in Bhopal. Currently, it has four residential such as Sagar Pearl, Sagar Green Hills, Sagar Landmark and Sagar Eden Garden.










    ReplyDelete
  19. Aileniz ve sevdiklerinizle mutlu ve mutlu bir hafta geçirmenizi diliyorum. Makaleyi paylaştığın için teşekkür ederim

    Giảo cổ lam hòa bình

    hat methi

    hạt methi

    hạt methi ấn độ

    ReplyDelete
  20. Дээд чанар бол зүгээр л( đá ruby thiên nhiên ) санаатай биш юм. Энэ нь өндөр( đá ruby nam phi ) түвшний төвлөрөл, тусгай хүчин( Đá Sapphire ) чармайлт, ухаалаг ( đá sapphire hợp mệnh gì )чиг баримжаа, чадварлаг туршлага, ( đá ruby đỏ )саад тотгорыг даван туулах( lịch sử hình thành của đá emerald ) боломжийг хардаг.

    ReplyDelete
  21. Visit for AWS training in Bangalore:- AWS training in Bangalore

    ReplyDelete
  22. This comment has been removed by the author.

    ReplyDelete
  23. Really i appreciate the effort you made to share the knowledge. The topic here i found was really effective...

    Upgrade your career Learn Oracle Training from industry experts gets complete hands on Training, Interview preparation, and Job Assistance at My Training Bangalore.

    ReplyDelete
  24. Cloud servers are the best in safe guarding one's information through online. Without this dedicated methodology many companies would have not existed at all. The same though has been furnished above.
    AWS training in chennai | AWS training in annanagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

    ReplyDelete
  25. Sharing the same interest, Infycle feels so happy to share our detailed information about all these courses with you all! Do check them out
    oracle training in chennai & get to know everything you want to about software trainings.

    ReplyDelete
  26. Thank you for posting informative insights, I think we have got some more information to share with! Do check out Java Training in Chennai and let us know your thoughts. Let’s have great learning.

    ReplyDelete
  27. Learn Amazon Web Services for making your career towards a sky-high with Infycle Technologies. Infycle Technologies is the best AWS training institute in Chennai, providing courses for the AWS Training in Chennai in 200% hands-on practical training with professional trainers in the domain. Apart from the coaching, the placement interviews will be arranged for the students, so that they can set their career without any struggle. Of all that, 100% placement assurance will be given here. To have the best career, call 7502633633 to Infycle Technologies and grab a free demo to know more.
    TOP AWS TRAINING IN CHENNAI

    ReplyDelete
  28. Thats great post !! I like ur every post they always give me some new knowledge.

    VidMate | VidMate for PC |
    VidMate 2014

    ReplyDelete
  29. Your passion for what you do really comes through in your work. It's inspiring to see.
    Micropython Training In Hyderabad

    ReplyDelete
  30. This comment has been removed by the author.

    ReplyDelete