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