Simple steps to deploy a Java EE project under Linux

Source: Internet
Author: User

The prerequisite for deploying the project is to prepare the environment, including: Java Runtime Environment (JDK), Tomcat,mysql database

1. First upload something to the server, I am installing the SSH tool in Windows (download and install git to http://gitforwindows.org/)

(1) Under Windows, export the project into a war package, exporting the database script

After export, change the database db.properties of the war package to the connection information on the Linux server.

(2) Upload the war package and script to the server

Liqiang@root~/c/Users/liqiang/Desktop/ Exam.war root@qiaoliqiang. CN://c/Users/Liqiang / Desktop/exam.sql root@qiaoliqiang. CN:/Home

(3) Run the SQL script, create the database, and import the SQL script:

    1. Viewing files that are passed from windows
$ ssh Root@qiaoliqiang. Cnlast Login:fri Jan +  One: -: - 2018  from 218.26.54.83Welcome toAlibaba Cloud ElasticComputeService![[email protected] ~]# ls/Home/exam.sql Exam.war test.html[[email protected] ~]#

2. Import the MySQL script file

Mysql> Create DatabaseExam;mysql>  Useexam; ReadingTableInformation forCompletion of Table  and columnnamesyou can turnoffThis feature toGet a quicker startup with -ADatabaseChangedmysql>Source/Home/Exam.sql

2. Place the war package in the WebApps directory of the Tomcat installation directory: (or manually deploy the project from the Tomcat manager)

(1) If this item is not previously available, the war package can be placed directly in, and Tomcat will scan

[[email protected] ~] /Home//usr/local/Apache-Tomcat-7.0.  the /WebApps/

(2) If the previous project needs to stop the service, delete the original war package and directory and restart the project

[[email protected] ~]# service Tomcat Stop[[email protected] ~]# CD/Usr/Local/Apache-Tomcat-7.0. the/WebApps/[[email protected] ~]# RM Exam-RF[[email protected] ~]# RM Exam.war[[email protected] ~]# CP/Home/Exam.war/Usr/Local/Apache-Tomcat-7.0. the/WebApps/[[email protected] ~]#service Tomcat Start

Add-RF after deleting the directory

3. Test Project deployment:

Curl localhost:88080

Simple steps to deploy a Java EE project under Linux

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.