Deploy the project to a Linux server using the Java service Wrapper

Source: Internet
Author: User

A recent requirement was to deploy the Java project to a Linux server as a service-side program that was successfully tested. In the spirit of sharing will be summed up the path to share to everyone, if you do not understand the place can be in the bottom of the message, thank you.

Deploying a Java project to a Linux server

1, first download http://wrapper.tanukisoftware.com/doc/english/download.jsp from the official website, note that the downloaded file is in the Community column (PS: Other versions require serial number)

2, the written Java project into a jar package, to be used

3. Unzip the downloaded files to the local directory%wrapper_home%.

4. Connect to the Linux server and create the folder on the Linux server as%linux_wrapper_home%.

5. Under%linux_wrapper_home%, create an empty folder: Bin, lib, conf, logs.

6, the%wrapper_home%/bin under the wrapper file upload to%linux_wrapper_home%/bin under.

7, the%wrapper_home%/conf under the wrapper.conf file upload to%linux_wrapper_home%/conf under.

8, the%wrapper_home%/lib under the Wrapper.jar, libwrapper.so files uploaded to%linux_wrapper_home%/lib, the pre-packaged project Jar package is also placed here.

9. Upload the%wrapper_home%/src/bin/sh.script.in file to the%linux_wrapper_home%/bin directory and rename it as (recommendation: the class name of the main method in the Java project). Open the file and modify two places:

App_name= "Enter your project name"

App_long_name= "Enter your project name".

10, open the%linux_wrapper_home%/conf/wrapper.conf file, you need to modify the following places:

Wrapper.java.command=/usr/java/jdk1.7.0_45/bin/java

Wrapper.java.mainclass=org.tanukisoftware.wrapper.wrapperstartstopapp

wrapper.java.classpath.1=. /lib/serverdemo.jar (PS: This is the jar package after the project is packaged)

Wrapper.java.classpath.2=. /lib/wrapper.jar

Wrapper.java.classpath.3=/usr/java/jdk1.7.0_45/lib/dt.jar

Wrapper.java.classpath.4=/usr/java/jdk1.7.0_45/lib/tools.jar

Wrapper.app.parameter.1=helloworldserver (PS: This is the category where the project Main method resides)

Wrapper.app.parameter.2=1

Wrapper.app.parameter.3=true

Wrapper.app.parameter.4=helloworldserver (PS: This is the category where the project Main method resides)

Wrapper.app.parameter.5=true

Wrapper.app.parameter.6=1

Wrapper.app.parameter.7=stop

11, the above tasks can be completed on the Linux server to run the test. First connect to a Linux server and find

%linux_wrapper_home%/bin directory, the first to give the file can be run permissions, assigned after the input./file name start the following conditions indicate a successful run.



Deploy the project to a Linux server using the Java service Wrapper

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.