Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Shell scripts quickly deploy Tomcat project     - Using Linux command line and execute PHP code (Programming)

- Linux processes in memory and memory cgroup statistics (Linux)

- Gentoo: !!! existing preserved libs problem (Linux)

- CentOS / RHEL 6 was repeated prohibited under the SNMP connection log (Server)

- The istgt PSD on ported to Mac OS X (Linux)

- Linux account management add relevant directives (Linux)

- DRBD rapid installation and deployment (Server)

- To install the Git and Github under Ubuntu (Linux)

- Android screen rotation processing and ProgressDialog the best AsyncTask (Programming)

- Vim copy and paste register (Linux)

- SUSE Linux install Oracle 10g and problem solving (Linux)

- Oracle 11G R2 DataGuard structures (Database)

- RT-11SJ run at ambient PDP-11 MACRO-11 assembly (Programming)

- Oracle 10g relations with the constraint of column properties NULLABLE (Database)

- Terminal fun: 6 interesting Linux command-line tools (Linux)

- CentOS 6.x and CentOS7 installation RPMforge (Linux)

- To help you easily protect the Linux System (Linux)

- Broadcom transplanted to OpenWrt summary (Programming)

- Talk about jsonp (Programming)

- About Linux backdoor (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:      
 
- Zabbix monitoring of the switch (Server)
- How to manage Vim plugin (Linux)
- Use JMS listener Oracle AQ, trigger the execution of Java programs in the database changes (Database)
- CentOS 6.4 of cron scheduled task configuration (Linux)
- Installation under Linux Mint system guidelines for Gtk (Linux)
- Pydev installed and configured on the Eclipse (Linux)
- C language to view various types of data size (Programming)
- Netapp storage routine inspections and information gathering (Linux)
- Unix system security configuration (Linux)
- ActiveMQ5.11.1 and JDK version matching relation (Linux)
- Java 8 perspective annotation types (Programming)
- Bash Getopts - let your script supports command line parameters (Linux)
- Python configuration tortuous road of third-party libraries Numpy and matplotlib (Programming)
- How to Install Foreman under Ubuntu (Server)
- Retro terminal in Linux (Linux)
- Each catalog Detailed Linux (Linux)
- How to use Aptik to backup and restore Apps/PPAs under ubuntu (Linux)
- VMware virtual machine operating system log Error in the RPC receive loop resolve (Linux)
- Into the Java keyword instanceof (Programming)
- Upgrade to Node V4 seven reasons (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.