Remember that Linux passes a war to the server

Source: Internet
Author: User
Tags scp command

First myeclipse the package project as the war file, select "Target runtime" and tick "Export source files". Package it into the war file we need, Emample.war.

Use terminal ssh to connect to our servers remotely, such as:

  

Command line off Tomcat, Cd/usr/local/tomcat-7/bin

./shutdown.sh

Then you can choose to rename the files inside and then move them back to the other place.

Cd/usr/local/tomcat-7/webapps

Ls

View all folders under WebApps with the LS command

Find the example

Rename:

  MV Example/example-back

Move files to the backup folder

  MV example-back/usr/back-up/

This time we need to upload the new war file to the server and use the SCP command.

  SCP /home/code/example.war [email protected]:/usr/local/tomcat-7/webapps/

To view the SCP command, go to the URL: http://www.cnblogs.com/peida/archive/2013/03/15/2960802.html, look.

This time wait slowly upload, note that the above IP is your own need to use the IP, directory is its own file directory and upload directory.

OK after uploading complete we need to open tomcat (since opening Tomcat will automatically unzip the war file into what we need)

Cd/usr/local/tomcat-7/bin

./startup.sh

By this time we are

cd/usr/local/tomcat-7/webapps/

Then LS to view all

Will find there is a example folder and a Example.war file of two exist.

We certainly want to move the war file somewhere else, not under the WebApp directory.

However, it is necessary to turn Tomcat off or modify the name of the war file to modify the name of the folder, because the two are associated

If you need to establish a soft connection, you need to use the command ls-l view, LS does not show the address of the soft connection

If you want to have a directory under the example folder upload is a soft connection to/usr/apps/fileupload here you need to do the following in the example directory

First the current directory to the example directory

cd/usr/local/tomcat-7/webapps/example/

And then

  LN - s /usr/apps/fileupload upload

You can create a soft connection, which is a shortcut under Windows

About soft connections and hard links can go to URL: http://www.cnblogs.com/xiaochaohuashengmi/archive/2011/10/05/2199534.html

Once set up, you can open Tomcat and the site is updated.

Remember that Linux passes a war to the server

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.