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