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.


30 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
  16. 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
  17. Thanks for providing your information, Keep update AWS Online Training

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

    ReplyDelete
  19. Thank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.
    java training in omr

    java training in annanagar | java training in chennai

    java training in marathahalli | java training in btm layout

    java training in rajaji nagar | java training in jayanagar

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

    ReplyDelete
  21. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..


    rpa training in anna nagar |

    rpa training in marathahalli

    rpa training in btm

    rpa training in kalyan nagar

    rpa training in electronic city

    rpa training in chennai

    rpa online training

    selenium training in training

    ReplyDelete
  22. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    python online training
    python training in OMR
    python training in tambaram

    ReplyDelete
  23. 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
  24. 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
  25. 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