Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Shell scripts quickly deploy Tomcat project     - Eclipse Android development environment installation (Linux)

- Oracle database NUMBER (x, y) data types (Database)

- Java garbage collection and heap memory layout (Programming)

- Eclipse, Tomcat configuration JNDI connection Oracle data source example (Server)

- Linux iostat command example explanation (Linux)

- Linux Hard Disk Partition and file system management (Linux)

- Firewall settings oracle remote connection in Linux systems (Linux)

- Nmcli based network management command-line tool (Linux)

- Linux operating tips: Can not open file for writing or operation not permitted solution (Linux)

- Using Linux command line and execute PHP code (Programming)

- Ubuntu use three methods to install Ruby (Linux)

- Java call by value and by reference (Programming)

- Zabbix system email alert Python script (Server)

- Nginx high concurrency optimization ideas (Server)

- Docker in the development and practice of IFTTT (Server)

- Linux kernel RCU (Read Copy Update) lock Brief - prequel (Linux)

- HTTPS and SSH and use the difference between the way: Git User's Manual (Linux)

- MySQL monitoring tools -orzdba (Database)

- QEMU image file used: qcow2 and raw (Linux)

- JITwatch installation under Linux (Linux)

 
         
  Shell scripts quickly deploy Tomcat project
     
  Add Date : 2018-11-21      
         
       
         
  In order to do cluster testing, each machine is equipped with a three tomcat, each release project must be repeated when knocking some order, first check before restarting tomcat tomcat process has not stopped, not even manually kill the process.

Released several times, the operation is more complicated, and simply write a script to a key release, saving time and effort.

The deploy.sh and restart.sh are copied to the three tomcat bin directory, and then chmod + x to both conferred on the script executable permissions.

Post a key command: ./ deploy.sh project war package, such as: ./ deploy.sh /home/test.war

Description: deploy.sh ROOT directory will be emptied under the tomcat, and then pressurized to the specified war package ROOT directory, and finally execute restart.sh restart tomcat.

Code is as follows:

 1 #! / Bin / sh
 2
 3 war = $ 1
 4 bin = $ (cd `dirname $ 0`; pwd)
 5
 6 if [-n "$ {war}"!]; Then
 7 echo "*** Usage: $ 0 [project.war]"
 8 exit 0
 9 fi
10 if [-f "$ {war}"!]; Then
11 echo "*** Error: $ {war} does not exist."
12 exit 0
13 fi
14 if [! "$ {. War ## *}" = "war"]; then
15 echo "*** Error: $ {war} is not a war file."
16 exit 0
17 fi
18
19 echo "Deploy $ {war ## * /} ..."
20 rm -rf $ {bin} /../ webapps / ROOT / && unzip -qo $ {war} -d $ {bin} /../ webapps / ROOT /
21 rm -rf $ {bin} /../ work / Catalina / localhost /
22 echo "Restart tomcat ..."
$ 23 exec {bin} /restart.sh
To restart the tomcat use the command: ./ (print tomcat start the log indicating that the startup parameter -v) restart.sh or ./restart.sh -v

Description: restart.sh is used to restart the tomcat, tomcat does not start if it is started directly, if you have started on the first shutdown restart after shutdown 3s if not stopped tomcat process, then kill off the original process restarted.

Code is as follows:

 1 #! / Bin / sh
 2
 3 bin = $ (cd `dirname $ 0`; pwd)
 4 pid = $ (ps aux | grep tomcat | grep -v grep | grep -v restart | grep $ {bin} | awk '{print $ 2}')
 5
 6 if [-n "$ {pid}"]; then
 7 echo "Shutdown ..."
 8 sh $ {bin} /shutdown.sh
 9 sleep 3
10
11 pid = $ (ps aux | grep tomcat | grep -v grep | grep -v restart | grep $ {bin} | awk '{print $ 2}')
12 if [-n "$ {pid}"]; then
13 kill -9 $ {pid}
14 sleep 1
15 fi
16 fi
17
18 echo "Startup ..."
$ 19 sh {bin} /startup.sh
20 if [ "$ 1" = "-v"]; then
21 tail -f $ {bin} /../ logs / catalina.out
22 fi
I am using CentOS, 3 Ge tomcat respectively at 8080/8081/8082 subdirectory /opt/apache-tomcat-7.0.65/ under 8080/8081/8082 listening port.

Finally, in the browser, type http: // localhost: 8080 to access.
     
         
       
         
  More:      
 
- JBPM6 Installation and Configuration Tutorial (Linux)
- Definition Format Oracle basis of various statements (Database)
- Installation Atom text editor on Mint Ubuntu / Linux (Linux)
- C ++ Supplements - locates the new expression (Programming)
- AngularJS application unit testing started (Programming)
- Difference LVS three scheduling modes (Server)
- Java MD5 encryption implementation (Programming)
- iOS constants, variables, properties and characteristics (Programming)
- After Oracle 11g dataguard failover rebuild the archive logs are not applied to be NO problem (Database)
- Linux LVM space expansion Demo (Linux)
- Configuring Proxy on a Unix terminal, accelerate Android Studio Construction (Linux)
- How to choose the first programming language based on the life you want (Programming)
- Do not enter password login ssh (Server)
- Log in CentOS 6.5 Multi-user setting VNC (Server)
- GO five stages of language learning (Programming)
- Oracle users to automatically increase the partition table (Database)
- Netapp storage routine inspections and information gathering (Linux)
- Java application server WildFly (Server)
- Spring inject a type of object to enumerate (Programming)
- Linux system security knowledge (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.