Linux builds tomcat deployment war

JDK environment
  Check whether the system already has jdk.
  
  
  
  If not, install
jdk and install
    tar.gz as a version that can be used after decompression. Here we decompress jdk-7u3--linux-i586.tar.gz to /usr/local/ .
1. Unzip
Unzip it to the current directory: $ tar -zxvf /opt/setup/jdk-7-ea-bin-b145-linux-i586-07_jun_2011.tar.gz
Environment configuration
Switch users and operate under the root user
$vi /etc/ profile
at the end line add
    #set java environment
    JAVA_HOME=/usr/local/jdk1.7.0
    CLASSPATH=.:$JAVA_HOME/lib.tools.jar
    PATH=$JAVA_HOME/bin:$PATH
    export JAVA_HOME CLASSPATH PATH
save exit
$ source /etc /profile Make the changed configuration take effect immediately
$ java -version View the jdk version information, if it shows 1.7.0, it proves that the
Tomcat environment is successful
Unzip the tomat server compressed package
  
  
Modify the startup port of the tomcat server
  
  Modify the port used when the tomcat server is started, for example, change it to 9999.
  
  After modifying the server.xml file, save and exit.
Tomcat deploys the war package
1. For example, put AMC.war in the tomcat/webapps directory.
2 In server.xml


, where docBase is the path of the project,
path is the browser access address.
Start and close the Tomcat server.
Start the Tomcat server
  . Enter the bin directory of the tomcat server, and then execute the "./startup.sh" command to start the tomcat server, as shown in the following figure : View the log information of the tomcat server to see if the tomcat server has been started normally, enter the logs directory under the tomcat server, and open the catalina.out file to view it
  
  , as shown in the following figure:
  netstat -an | grep 9999 <port number>
  
Service is not started.

The program remotely calls the command to start the Tomcat server.

If the service does not start successfully, you can install this idea to

check the jdk version on the ssh client, and use the program to call the command to check whether it is the same
Echo $JAVA_HOME or whether the print path
is different. In the startup.sh script of tomcat, it is
best to add
export JAVA_HOME=/opt/tpapp/jdk1.7.0_25
to the top and execute it successfully.



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326471891&siteId=291194637