Come installare Apache Tomcat in linux Ubuntu 14.04 via Apt-Get

Come installare Apache Tomcat in linux Ubuntu 14.04 via Apt-Get

How To Install Apache Tomcat 7 on Ubuntu 14.04 via Apt-Get

About Apache Tomcat

Apache Tomcat is an application server that is used to serve Java applications to the web. Tomcat is an open source implementation of the Java Servlet and JavaServer Pages technologies, released by the Apache Software Foundation.

This tutorial covers the basic installation and some configuration of Tomcat 7.0.x, the latest stable version at the time of writing, on your Ubuntu 14.04 VPS.

There are two basic ways to install Tomcat on Ubuntu:

  • Install through apt-get. This is the simplest method.
  • Download the binary distribution from the Apache Tomcat site. This guide does not cover this method; refer to Apache Tomcat Documentation for instructions.

For this tutorial, we will use the simplest method: apt-get. Please note that this will install the latest release of Tomcat that is in the official Ubuntu repositories, which may or may not be the latest release of Tomcat. If you want to guarantee that you are installing the latest version of Tomcat, you can always download the latest binary distribtion.

Step One — Prerequisites

Before you begin with this guide, you should have a separate, non-root user account set up on your server. You can learn how to do this by completing steps 1-4 in the initial server setup for Ubuntu 14.04. We will be using the demo user created here for the rest of this tutorial.

Step Two – Install Tomcat

The first thing you will want to do is update your apt-get package lists:

sudo apt-get update

Now you are ready to install Tomcat. Run the following command to start the installation:

sudo apt-get install tomcat7

Answer yes at the prompt to install tomcat. This will install Tomcat and its dependencies, such as Java, and it will also create the tomcat7 user. It also starts Tomcat with its default settings.

Tomcat is not completely set up yet, but you can access the default splash page by going to your domain or IP address followed by :8080 in a web browser:

http://your_ip_address:8080

You will see a splash page that says “It works!”, in addition to other information. Now we will go deeper into the installation of Tomcat.

Step Three – Installing Additional Packages

Note: This section is not necessary if you are already familiar with Tomcat and you do not need to use the web management interface, documentation, or examples. If you are just getting into Tomcat for the first time, please continue.

With the following command, we will install the Tomcat online documentation, the web interface (manager webapp), and a few example webapps:

sudo apt-get install tomcat7-docs tomcat7-admin tomcat7-examples

Answer yes at the prompt to install these packages. We will get into the usage and configuration of these tools in a later section. Next, we will install the Java Development Kit.

Step Four – Install Java Development Kit (Optional)

If you are planning on developing apps on this server, you will want to be sure to install the software in this section.

The Java Development Kit (JDK) enables us to develop Java applications to run in our Tomcat server. Running the following command will install openjdk-7-jdk:

sudo apt-get install default-jdk

In addition to JDK, the Tomcat documentation suggests also installing Apache Ant, which is used to build Java applications, and a source control system, such as git. Let’s install both of those with the following command:

sudo apt-get install ant git

For more information about Apache Ant, refer to the official manual. For a tutorial on using git, refer to DigitalCloud’s Git Tutorial.

Step 5 – Configure Tomcat Web Management Interface

In order to use the manager webapp installed in Step 3, we must add a login to our Tomcat server. We will do this by editing the tomcat-users.xml file:

sudo nano /etc/tomcat7/tomcat-users.xml

This file is filled with comments which describe how to configure the file. You may want to delete all the comments between the following two lines, or you may leave them if you want to reference the examples:

<tomcat-users>
</tomcat-users>

You will want to add a user who can access the manager-gui and admin-gui (the management interface that we installed in Step Three). You can do so by defining a user similar to the example below. Be sure to change the password and username if you wish:

<tomcat-users>
    <user username="admin" password="password" roles="manager-gui,admin-gui"/>
</tomcat-users>

Save and quit the tomcat-users.xml file. To put our changes into effect, restart the Tomcat service:

sudo service tomcat7 restart

Step 6 – Access the Web Interface

Now that we’ve configured an admin user, let’s access the web management interface in a web browser:

http://your_ip_address:8080

You will see something like the following image:

Tomcat Splashscreen

As you can see, there are four links to packages you installed in Step Three:

  • tomcat7-docs: Online documentation for Tomcat. Accessible via http://your_ip_address:8080/docs/
  • tomcat7-examples: Tomcat 7 Servlet and JSP examples. You can click through the example webapps to get a basic idea of how they work (and also look at the source code to see how they were implemented). Accessible via http://your_ip_address:8080/examples/
  • tomcat7-admin (manager-webapp): Tomcat Web Application Manager. This will allow you to manage and your Java applications.
  • tomcat7-admin (host-manager): Tomcat Virtual Host Manager.

Let’s take a look at the Web Application Manager, accessible via the link or http://your_ip_address:8080/manager/html:

Tomcat Web Application Manager

The Web Application Manager is used to manage your Java applications. You can Start, Stop, Reload, Deploy, and Undeploy here. You can also run some diagnostics on your apps (i.e. find memory leaks). Lastly, information about your server is available at the very bottom of this page.

Now let’s take a look at the Virtual Host Manager, accessible via the link or http://your_ip_address:8080/host-manager/html/:

Tomcat Virtual Host Manager

From the Virtual Host Manager page, you can add virtual hosts to serve your applications in.

Finished!

Your installation of Tomcat is complete! Your are now free to deploy your own webapps!

 

If you want to create WAR file:

jar -cvf WebApplication.war .

 

Articolo copiato da:

https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-7-on-ubuntu-14-04-via-apt-get

37 Risposte a “Come installare Apache Tomcat in linux Ubuntu 14.04 via Apt-Get”

    1. Hi, yes, there are many solutions! WordPress is a good free platform to develop site or blog like this.
      Search on google and you will found some different solution. I’m sure!
      See you.

  1. Hello Web Admin, I noticed that your On-Page SEO is is missing a few factors, for one you do not use all three H tags in your post, also I notice that you are not using bold or italics properly in your SEO optimization. On-Page SEO means more now than ever since the new Google update: Panda. No longer are backlinks and simply pinging or sending out a RSS feed the key to getting Google PageRank or Alexa Rankings, You now NEED On-Page SEO. So what is good On-Page SEO?First your keyword must appear in the title.Then it must appear in the URL.You have to optimize your keyword and make sure that it has a nice keyword density of 3-5% in your article with relevant LSI (Latent Semantic Indexing). Then you should spread all H1,H2,H3 tags in your article.Your Keyword should appear in your first paragraph and in the last sentence of the page. You should have relevant usage of Bold and italics of your keyword.There should be one internal link to a page on your blog and you should have one image with an alt tag that has your keyword….wait there’s even more Now what if i told you there was a simple WordPress plugin that does all the On-Page SEO, and automatically for you? That’s right AUTOMATICALLY, just watch this 4minute video for more information at. Seo Plugin
    seo plugin http://www.SEORankingLinks.com/

  2. My partner and I stumbled over here different web address and thought I should check things out.

    I like what I see so now i’m following you. Look forward to finding out about your web page yet again.

  3. Hi there, just became alert to your blog through Google, and
    found that it is truly informative. I’m going to watch out for brussels.
    I’ll be grateful if you continue this in future. A lot of people will be benefited from your
    writing. Cheers!

  4. Very nice post. I just stumbled upon your blog and wanted to say that I’ve really enjoyed surfing around your blog posts.
    After all I will be subscribing to your feed and I hope you write again very soon!

  5. Thanks for that marvelous posting! I certainly enjoyed reading
    it, you will end up an excellent author. I will be sure you bookmark your blog
    site and might return someday. I would like to encourage anyone to continue your great writing,
    use a nice evening!

    Feel free to surf to my page; TuanDEckland

  6. This design is steller! You certainly know how to keeep a reader entertained.
    Between your wit and your videos, I was almost moved too start my own blog (well, almost…HaHa!) Wonderful job.

    I really loved what you had to say, and more than that, how
    you presented it. Too cool!

  7. Right here is the right webpage for anyone who wants to find out about tis topic.
    You understand a whuole lot its alpmost hard to argue with you
    (not that I actually will need to…HaHa). You
    certainly put a fresh spin oon a subject that’s been written abhout for ages.
    Excellent stuff, just great!

  8. Hello would you mind stating which blog platform you’re working with?

    I’m going to start my own blog in the near future but I’m having a tough time selecting between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design and style seems different then most blogs and I’m looking
    for something unique. P.S Apologies for
    being off-topic but I had to ask!

    1. Hi Kudos, wordpress is a good platform to build your blog. Try it and you’ll see that you’ll be fine !!! See you soon!

  9. You actually make it seem so simple with the presentation nevertheless
    i find this matter being actually something that I think I
    would never understand. It appears to be too complicated and
    very broad for me. I’m looking forward for your post,
    I’ll try to have the hang from it!

  10. I don’t even understand how I ended up here, however I believed this post was once great.
    I do not realize who you might be but certainly
    you are going to a well-known blogger if you happen to are not already.
    Cheers!

  11. It is appropriate time to make some plans
    for the longer term and it is time to be happy.
    I have read this publish and if I could I want to suggest you few attention-grabbing
    things or advice. Perhaps you could write subsequent articles
    regarding this article. I wish to learn more issues
    approximately it!

  12. Thanks a bunch for sharing this with all of us you really know
    what you’re talking approximately! Bookmarked. Kindly also discuss with my website
    =). We will have a hyperlink change arrangement among us

  13. The Best Suggestions For Choosing A Trusted Soccer Gambling
    Agent
    In taking part in soccer playing video games, of course all gambling players are at all times advised to hitch or register upfront to the soccer gambling
    agent. At the moment because of the very fast improvement of technology,
    there are various football sites that you could find on Google
    search. There’s little doubt about the popularity of the soccer site
    which is definitely attributable to the big variety of playing
    lovers who need to position bets on their group’s favorites.

    On online gambling websites, there are normally a lot
    of profitable bonus promo gives for new players.
    That is an attraction for gamers who have just realized
    to play betting. However it’s worthwhile to watch out in the
    choice of gambling sites, as a result of many fraud ball playing brokers use
    gaps to trap the gamers to allow them to be part of them.

    Indeed, to decide on a trusted gambling site must require special methods the place players usually have a distinct
    choice. Although you have already got tips in selecting a
    trusted site, however till now you have not discovered the proper
    site for you, it wouldn’t harm you to try the ideas that we will give in this text.

    Some Tips on Selecting a Trusted Soccer Playing Agent
    As we all know the technique and mastery of the game is among the elements
    that influence the victory, however in a trusted site selector
    isn’t any much less vital for novice players. Since we talked about earlier you positively don’t wish to be
    harmed by irresponsible websites, so you want to search out the proper soccer betting site.
    Here are some tips for choosing on-line
    soccer websites that must be thought-about by soccer gambling gamers:

    1. Have an official license
    To be ready to choose the suitable soccer agent, guantee that the site has an official license.
    If the location has an official license from the gambling company,
    it is certain that it has been proven by its customer
    service and also its facilities. Although gambling in Indonesia will not be legalized,
    it does not apply to other nations so you’ll be able to choose a soccer betting
    site that has an official license from a rustic that allows playing equivalent to PAGCOR or
    First Cagan Leisure.
    2. Websites which might be easy to find in searches
    Aside from taking a look at licenses, the subsequent tip is a
    site that is simple to search out on search websites. As a result of playing is not legalized in Indonesia, the location normally provides a number of various link addresses that can be simply
    searched by serps akin to Google by typing its site brand.

    3. Livechat and contacts are easily contacted
    Trusted websites will often present livechat, where
    these of you who have difficulties or have issues can ask the livechat amenities part.

    And also they are going to present full social media that is easily contacted by the gamers.

    4. Give a bonus that is unquestionably given
    Given the intense competitors between on-line soccer agents, there will likely be very many brokers
    that supply a wide range of bonuses that can be obtained by each member who just
    joined. However, you will be given a bonus that is obtainable an affordable and certain bonus for those who reach the
    bonus phrases and conditions.
    That’s a couple of suggestions at a glance in choosing a dependable soccer agent that you just need to pay attention to.
    By applying a number of choice ideas above, it is possible you will not
    be fallacious in choosing a site that we all know is kind of troublesome to get.

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *