Linux deployment Web project to tomcat (picture and text) __linux

Source: Internet
Author: User
Tags ssh
Hello everyone, I believe many beginners do not know how to deploy Windows eclipse under the development of the Web project to the Linux system Tomcat, today I will show you an illustrated
First of all, for example, I create a new Web project, open the Eclipse Editor, build a test project,
Directory results as above, I create a welcome.jsp on the webcontent, enter a word inside, welcome everyone to deploy the project to Linux
Okay, here we have our web project built,
First I want to export the Project War package, now some students may have questions, what is the war package, now I explain to you, the war package is in fact the same as the Zip,giz package, is the eclipse for you, a tomcat,webapps can be recognized under the compression package, When the Tomcat project is first started, the war package is uncompressed, and if the second boot is discovered that the war package has been decompressed, it will not be decompressed again.
OK, let me show you how to export the war package under Eclipse:
First step:
Select the item, click the right mouse button, select Export, I This is the Chinese version:
Second step,
It is best not to export the source file here, because Web Engineering or Java Engineering will eventually compile the. java file into a. class file, and. java files do not work.
Click here to complete, just wait for it to export to complete the line,
Okay, now that we're done, we open the war package on the desktop,
The results are as follows, open directly with good pressure
Here we compare the catalog before packing to see what's different
As we can see, the directory in the war package does not include the. Settings build  src. classpath. project,webcontent these folders
In fact, the thing in the war package is under the webcontent, but the equivalent of the build and its subfolders moved under Web-inf, we can look at the Web-inf:
As we suspect, in the Web development process, will often refer to a word, called Class distance, Project Classpath, is classpath, then what is Classpath,
In fact the war package  web-inf/classes/This path is the project class path, the root path. Let's get this over with.
Okay, the top two says, how to play the war package and what the war package is, and let's go on to talk about how the war package is deployed to the Linux Tomcat and run:
First of all, to prepare the Linux operating system, and the Tocmat server, this knowledge I will not say more here.
People to see my environment:
Linux Environment version 64 for, 4.3.4 system, of course, your Linux no matter what the system can be, whether it is red hat or other,
Take a look at my Tomcat directory:
Now we're going to upload the war package, WebApps, with the SSH tool, I'll open the SSH tool,
We're going to pull the project directly below WebApps via the SSH tool, and we're almost ready to do it now.
Here, beginners often encounter a series of errors such as 8080 ports being consumed, or tomcat booting,
So how do we solve the problem of port being occupied, very simple a command to fix. Now let's take a look at:
In any place, enter the command: Ps-aux|grep Tomcat, don't know what this command means. Just remember, he's just checking out the current server has several Tomcat processes, and now we see my
The server has three Tomcat, but the individual port numbers are not the same, so don't interfere, now we see tomcat5-2 in operation,
We need to go down to Tomcat5-2 's Bin directory with the./shutdown.sh command to turn Tomcat off, and then to kill his process,
At run Ps-aux|grep Tomcat found out that he still exists, and then we kill the tomcat corresponding process with a kill, and we see that the corresponding process in my Tomcat in the above image is 6785
It's OK. If the kill is bad, use kill-9 to kill it completely,
Now we can go down to the bin directory and use the./startup.sh to start the project:
Then enter the logs directory and enter the following command: Tail-f catalina.out
See Tomcat startup successful, then
At this point we can enter the address in the browser:
HTTP://IP: Port/test/welcome.jsp
You can see the corresponding effect.
This is the process of a complete deployment project.
Author: Tourise Song
December 26, 2015 21:38:30 pen
You can leave a message.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.