CN106843936B - Method for automatically deploying Web application environment - Google Patents

Method for automatically deploying Web application environment Download PDF

Info

Publication number
CN106843936B
CN106843936B CN201611247452.5A CN201611247452A CN106843936B CN 106843936 B CN106843936 B CN 106843936B CN 201611247452 A CN201611247452 A CN 201611247452A CN 106843936 B CN106843936 B CN 106843936B
Authority
CN
China
Prior art keywords
tomcat
mysql database
web application
tomcat container
application environment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611247452.5A
Other languages
Chinese (zh)
Other versions
CN106843936A (en
Inventor
高健
董云帆
熊毅
李蕊
汪家全
罗凯
房红征
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Aerospace Measurement and Control Technology Co Ltd
Original Assignee
Beijing Aerospace Measurement and Control Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Aerospace Measurement and Control Technology Co Ltd filed Critical Beijing Aerospace Measurement and Control Technology Co Ltd
Priority to CN201611247452.5A priority Critical patent/CN106843936B/en
Publication of CN106843936A publication Critical patent/CN106843936A/en
Application granted granted Critical
Publication of CN106843936B publication Critical patent/CN106843936B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

The invention provides a method for automatically deploying a Web application environment, which uses a large amount of script languages to control the starting operation and mutual calling of each part through Java JDK, tomcat server and mysql database of an integrated engineering project system framework, sets the log output position of the environment in the environment to monitor the operation condition of the environment and sets a backup data directory for project data backup, thereby providing a set of complete Web application library. The rapid and efficient deployment method can be provided for projects including J2EE, various problems existing in the project environment installation process can be closed, the capability and the level of an implementation engineer are reduced, and the error rate of the projects in the implementation process is greatly reduced.

Description

Method for automatically deploying Web application environment
Technical Field
The invention relates to the technical field of computers, in particular to a method for automatically deploying a Web application environment.
Background
In the field of computer technology, Web-based application development has taken a mainstream in projects, and more information-based systems and other application systems provide services in the form of such "thin" clients. In the implementation phase of the project, an implementation engineer needs to deploy all environments and software required by the project on a machine, for example, in the J2EE project, the implementation engineer needs to install JDK, tomcat, a database, a project file, data table information, a browser, and other required software tools, which wastes much time and causes various problems in the installation process. At present, no green environment capable of adapting to all language projects exists, including the J2EE engineering project, which can help the computer technology field to realize rapid, efficient and accurate project implementation and deployment.
Disclosure of Invention
The invention aims to provide a method for automatically deploying a Web application environment, which aims to solve the technical problems of complexity and error proneness in the current environment installation and application deployment processes.
The method for automatically deploying the web application environment forms a set of complete web application environment through Java JDK, tomcat server and mysql database of an integrated engineering project (such as J2EE) system framework. The method comprises the steps of using a large number of scripting languages to control the starting operation and mutual calling of all parts, setting a log output position of an environment in the environment to monitor the operation condition of the environment and setting a backup data directory for project data backup, and accordingly providing a set of complete web application libraries. Java JDKs only preserve the runtime environment Jre and configure the computer system environment variables inside the environment, avoiding the traditional manual configuration approach. mysql uses the green version, configures the database into computer service through scripts, and the tomcat server modifies the configuration files such as catalina and server to automatically graft other resources.
In order to achieve the above object, the method for automatically deploying a Web application environment provided by the present invention includes:
Step 1), installing a Java JDK, and storing an Jre folder in a JDK storage path into a root directory of a tomcat container;
Step 2), storing the mysql database folder into a root directory of a tomcat container;
Step 3) configuring a global variable JAVA _ HOME in a script file of the tomcat container, and calling a Java Jre operating environment through the global variable JAVA _ HOME;
Step 4) adding an Installer.bat file in the Web application environment, adding commands for defining, configuring and referencing a path address of JAVA _ HOME, a path address of a mysql database and a path address of a tomcat container in the Installer.bat file, and adding command scripts for installing and starting the tomcat container, installing and starting the mysql database, initializing a mysql database table structure and importing basic data in items to be deployed in the Web application environment;
Step 5) deploying and releasing the project in the step 4) in a tomcat container to construct a whole Web application environment;
Step 6) install and launch tomcat container, mysql database and project using instoller.
as a further improvement of the above technical solution, the step of performing mysql database installation and starting by an instoller.
judging whether a mysql database exists in an operating system or not, if not, installing the mysql database and initializing data; and if the mysql database exists, further judging whether the mysql database is started, if the mysql database is in a starting state, executing the installation operation of the tomcat container, and if the mysql database is not in a starting state, executing the installation operation of the tomcat container after the mysql database is started.
As a further improvement of the above technical solution, the step of performing tomcat container installation and starting in step 4) by using an instoller.
and installing and operating the tomcat container, judging whether the tomcat container is in an operating state, stopping operation if the tomcat container is operated, otherwise, judging whether the tomcat container is operated in a windows service form, stopping operation after the tomcat container is started if the tomcat container is operated in the windows service form, stopping operating the tomcat container if the tomcat container is not operated in the windows service form, and finally stopping operation.
As a further improvement of the above technical solution, the Web application environment is further provided with a backup data directory for backing up the item data stored in the mysql database.
As a further improvement of the above technical solution, the Web application environment is further provided with a log file for recording the operation state data of the project and the operation state data of the tomcat container.
The method for automatically deploying the Web application environment has the advantages that:
1. the method for automatically deploying the web application environment can provide a quick and efficient deployment mode for projects including J2EE, and particularly can improve the efficiency by more than 10 times compared with the traditional method for installing the environment for project implementation personnel in the technical field of computers.
2. The method for automatically deploying the web application environment can seal various problems existing in the process of installing the project environment, reduce the capability and level of an implementation engineer and greatly reduce the error rate of the project in the implementation process; according to statistics, the error rate of project deployment by the method is reduced by more than 5 times compared with the traditional method.
Drawings
Fig. 1 is a schematic flow chart of an implementation of a method for automatically deploying a Web application environment in an embodiment of the present invention.
FIG. 2 is a schematic view of an implementation flow of the mysql database in the embodiment of the present invention.
FIG. 3 is a schematic flow chart of the tomcat container in the embodiment of the present invention.
Detailed Description
The method for automatically deploying the Web application environment according to the present invention is described in detail below with reference to the accompanying drawings and embodiments.
The invention aims to provide a method for a green installation-free Java Web project deployment environment, which is used for solving the problems of complexity and error proneness in the current environment installation and application deployment processes.
Referring to the Web application environment shown in fig. 1, in this embodiment, the method for automatically deploying the Web application environment provided by the present invention includes:
Step 1) performing greening transformation on the Java JDK, namely installing the Java JDK in the Java JDK, clamping Jre files in the JDK storage path, so that only the Java running environment is reserved, and placing the Jre files in the root directory of the tomcat container.
and 2) performing service transformation on the mysql database, modifying the mysql database into an installation-free service mode, and placing the mysql database folder into a root directory of a tomcat container.
Step 3) reshaping the tomcat container, modifying several key scripts of the tomcat container, including configuring a global variable JAVA _ HOME in several files of cataline, service, bat and setcallsplash, bat, starting and running the tomcat requires JAVA running environment, so internal scripts need to call calaline, bat and service, bat files to find JAVA _ HOME, while starting the tomcat in the form of windows service requires defining JAVA _ HOME in service, bat, so that running of JAVA Jre can be called through the defined global variable JAVA _ HOME.
Step 4) adding an Installer.bat file as a starting entry in the Web application environment, adding a command for installing and starting a tomcat container, installing and starting a mysql database, initializing a mysql database table structure and importing basic data in an item to be deployed in the Web application environment in the Installer.bat file through a logic script, and adding a command for defining, configuring and referencing a path address of JAVA _ HOME, a path address of the mysql database and a path address of the tomcat container in the Installer.bat so as to automatically start the tomcat container, the mysql database and Java Jre through the script and realize the services of the tomcat container, the mysql database and the Java Jre.
And 5) deploying and releasing the J2EE project in the step 4) in a tomcat container to construct the whole Web application environment.
step 6) double-click the instoller. bat file, install and start tomcat container, mysql database and project.
In the embodiment, a complete set of web application environment is formed by integrating the Java JDK, tomcat server and Mysql database of the J2EE system framework. The method comprises the steps of using a large number of scripting languages to control the starting operation and mutual calling of all parts, setting a log output position of an environment in the environment to monitor the operation condition of the environment and set a backup data directory for project data backup, and providing a set of complete web application libraries. Related configuration items are removed through the transformation of a Java JDK installation environment, and only a green Java Jre running environment is reserved. The script provides a global variable definition for Java Jre running environment, mainly comprising a path and a classpath, and the tomcat container can reference Java Jre to support the J2EE project. Through script transformation of the tomcat container environment, scripts including catalin, service, bat, setlastpatch, bat and the like are modified to become a tomcat container after script reshaping. The service transformation of the mysql database is carried out, the greening service of the mysql database is reserved, the green mysql database service can be called in the tomcat container, and the service operation mode is transformed through script driving. Bat initiation of services involves two main parts, one to install and initiate tomcat containers, and the other to install and initiate mysql databases and initialization data.
In this embodiment, the environment directory structure includes: back up, db, java, lib, mysql, temp, tomcat, webapps, installers, startup.
The process of modifying the reference and configuration of the Java JDK can be expressed as:
Java JDK configuration item in service.
Modifying the current directory into a way of finding a path: set "CURRENT _ DIR ═ cd%".
Reference position of configuration JDK: cd.. \\ java \ jdk
Modifying a path searching mode of JAVA _ HOME: set "JAVA _ HOME"
configuring the reference position of JAVA _ HOME: cd "% CURRENT _ DIR"
Configuration items in instoller.bat:
Configuring a running environment path set of java _ home: 'java _ home ═ current _ dir% \ jdk \'
Based on the service tomcat container script transformation, a tomcat installation-free version compressed packet needs to be downloaded from an official website, and after decompression, the tomcat installation-free version compressed packet enters a bin directory, so that the dependence of a running environment on a computer caused by the configuration of JAVA environment variables is avoided, catalin script files, setglasplash script files and service script files are modified respectively, and the setting operation of the environment variables JAVA _ HOME is added into the files.
Combining and matching the prepared configuration contents, and adding an environment one-key installation and initialization script. And the JDK package, the tomcat package and the Mysql package are placed under the same directory JTM, a backup and a lib folder are added under the JTM directory, the backup under the backup stores the backup of an initial database before the initialization of the Mysql database, and the lib directory places a class library common to the whole green release environment. Bat script is placed under JTM directory for completing the installation and start of tomcat service, Mysql service and database initialization operations.
In addition, as shown in fig. 1, the Web application environment is further provided with a backup data directory and a log file, which are respectively used for backing up the item data stored in the mysql database, the running state data of the recording item, and the running state data of the tomcat container.
Generally, the method for automatically deploying the Web application environment uses the green modified Java JDK, the script modified tomcat container and the servation modified green mysql database, integrates services of the three through script compiling and global variable definition, and provides services for the J2EE Web application project through a green mode.
FIG. 2 is a flow chart of an implementation of the servization transformation of the mysql database, which is to put the mysql database folder under the root directory of the tomcat container. Configuring a service path of the mysql database in the instoller. Judging whether the mysql service exists in the operating system, if not, installing the mysql service and initializing data, if so, further judging whether the mysql service is started, if the service is in a starting state, entering the next step of installing the tomcat service, if not, starting the mysql service, and then entering the next step of installing the tomcat service.
The specific implementation process of the mysql database installation and starting is as follows: firstly, configuring mysql database starting and data initialization, configuring a service path of the mysql database in an Installer. set "mysql _ home ═ current _ dir% \ mysql \ j.
And then searching whether the service of the mysql exists or not, if so, judging whether the service of the mysql is running or not, and jumping to a corresponding processing script according to the running state of the mysql service.
in the mysql run script, the information that mysql is running is printed out, and then jumps to the install tomcat service script.
In the MySQL stop script, the information that the MySQL service is stopped is printed out, the MySQL service is started by commanding start MySQL5, the information that MySQL5 is successfully started is printed out, and then the installation tomcat service is jumped to.
If the MySQL service does not exist, the MySQL service needs to be installed, the MySQL service is installed by commanding install MySQL5, the MySQL service is started by commanding start MySQL5, and the initialized database user name and password are set by the MySQL follow-up command.
The user information setting process of the mysql database comprises the following steps:
adding a database creating and data initializing operation script for mysql, inputting a user name and a password through related commands of mysql-h, finding an initialized database structure file, and creating a database table structure, wherein the commands are expressed as:
mysql-h localhost-uroot-proot<"%current_dir%\db\init.sql"
Fig. 3 is a flowchart of a tomcat container implementation, where a tomcat service needs to be installed first, whether the tomcat service is running is determined, if yes, execution of starting operation of the tomcat is stopped, if not, it is determined whether the tomcat is running in a windows service form, if yes, the tomcat service is started, if not, the tomcat service is stopped first, then service provision in a windows mode is started, and finally, an automatic installation and deployment process is stopped.
the tomcat service path setting method comprises the following steps: defining the path of tomcat, defining the JAVA _ HOME path.
set“tomcat_home=%current_dir%\tomcat\”
rem define JAVA_HOME
set"CURRENT_DIR=%cd%"
cd..\..\java\jdk
set"JAVA_HOME=%cd%"
cd"%CURRENT_DIR%"
The installation and operation method of the Tomcat service comprises the following steps: and entering a tomcat script installation module, finding a tomcat path, judging whether the tomcat exists or not, and respectively skipping to the corresponding modules. If yes, entering into yestomcat, judging whether tomcat operates, if yes, jumping to a tomcat running module, and if not, jumping to a tomcat stopped module. If tomcat is already running, judging the service mode of tomcat, and then stopping the starting process.
the handling method of tomcat service existing but not running: if the tomcat service exists but is not running, the tomcat service is started in the windows service by instructing start tomcat7 to print out the information that tomcat started successfully.
The method for processing the Tomcat without service comprises the following steps: if the tomcat service does not exist, the tomcat service is started in the form of windows service, the tomcat service is installed by commanding call service.bat instruction tomcat7, and the tomcat service is started by commanding start tomcat 7.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present invention and are not limited. Although the present invention has been described in detail with reference to the embodiments, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (5)

1. a method for automatically deploying a Web application environment, comprising:
Step 1), installing a Java JDK, and storing an Jre folder in a JDK storage path into a root directory of a tomcat container;
Step 2), storing the mysql database folder into a root directory of a tomcat container;
Step 3) configuring a global variable JAVA _ HOME in a script file of the tomcat container, and calling a Java Jre operating environment through the global variable JAVA _ HOME;
step 4) adding an Installer.bat file in the Web application environment, adding commands for defining, configuring and referencing a path address of JAVA _ HOME, a path address of a mysql database and a path address of a tomcat container in the Installer.bat file, and adding commands for installing and starting the tomcat container, installing and starting the mysql database, initializing a mysql database table structure and importing basic data in items to be deployed in the Web application environment;
Step 5) deploying and releasing the project in the step 4) in a tomcat container to construct a whole Web application environment;
Step 6) install and launch tomcat container, mysql database and project using instoller.
2. the method for automated deployment of a Web application environment according to claim 1, wherein the step of performing mysql database installation and launching by an insteller.
Judging whether a mysql database exists in an operating system or not, if not, installing the mysql database and initializing data; and if the mysql database exists, further judging whether the mysql database is started, if the mysql database is in a starting state, executing the installation operation of the tomcat container, and if the mysql database is not in a starting state, executing the installation operation of the tomcat container after the mysql database is started.
3. The method for automated deployment of a Web application environment according to claim 2, wherein the step of performing tomcat container installation and initiation in step 4) via an instoller.
And installing and operating the tomcat container, judging whether the tomcat container is in an operating state, stopping operation if the tomcat container is operated, otherwise, judging whether the tomcat container is operated in a windows service form, stopping operation after the tomcat container is started if the tomcat container is operated in the windows service form, stopping operating the tomcat container if the tomcat container is not operated in the windows service form, and finally stopping operation.
4. The method for automatically deploying a Web application environment according to claim 2, wherein a backup data directory is further provided in the Web application environment, and is used for backing up project data stored in the mysql database.
5. The method for automatically deploying a Web application environment according to claim 2, wherein a log file is further provided in the Web application environment, and is used for recording the operation state data of the project and the operation state data of the tomcat container.
CN201611247452.5A 2016-12-29 2016-12-29 Method for automatically deploying Web application environment Active CN106843936B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611247452.5A CN106843936B (en) 2016-12-29 2016-12-29 Method for automatically deploying Web application environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611247452.5A CN106843936B (en) 2016-12-29 2016-12-29 Method for automatically deploying Web application environment

Publications (2)

Publication Number Publication Date
CN106843936A CN106843936A (en) 2017-06-13
CN106843936B true CN106843936B (en) 2019-12-10

Family

ID=59115153

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611247452.5A Active CN106843936B (en) 2016-12-29 2016-12-29 Method for automatically deploying Web application environment

Country Status (1)

Country Link
CN (1) CN106843936B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108632331A (en) * 2017-08-28 2018-10-09 北京视联动力国际信息技术有限公司 A kind of installation method and device regarding working application
CN109818765B (en) * 2017-11-21 2022-03-11 成都鼎桥通信技术有限公司 Network element deployment method and device
CN108038353A (en) * 2017-12-26 2018-05-15 重庆佰诺吉生物科技有限公司 A kind of web page display method of genomic data
CN108536449A (en) * 2018-03-30 2018-09-14 新华三大数据技术有限公司 Web projects dispositions method and device
CN108733381A (en) * 2018-03-30 2018-11-02 四川九阵科技股份有限公司 A kind of medical software exempts from installation and deployment method
CN109062585A (en) * 2018-07-31 2018-12-21 安徽四创电子股份有限公司 A kind of safe city item server basic environment dispositions method
CN109343936A (en) * 2018-09-28 2019-02-15 北京中电普华信息技术有限公司 A kind of micro services automatic deployment method and device
CN109800002A (en) * 2019-01-17 2019-05-24 恒峰信息技术有限公司 A kind of automatic installation and deployment method of Java software
CN110941438A (en) * 2019-12-11 2020-03-31 东华大学 MySQL, Redis and Tomcat automatic deployment method in offline Centos7 environment
CN111209719A (en) * 2019-12-31 2020-05-29 西安翔腾微电子科技有限公司 Method, device, equipment and storage medium for automatically realizing IC design environment
CN113900677A (en) * 2021-10-18 2022-01-07 盐城金堤科技有限公司 Deployment method, device and equipment of program running environment and computer storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103581310A (en) * 2013-10-24 2014-02-12 深圳市远行科技有限公司 Automatic generating method for web service agent
CN106095408A (en) * 2016-05-31 2016-11-09 浙江网新恒天软件有限公司 A kind of system and method for data monitoring and Code automatic build and deployment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110029856A1 (en) * 2009-07-28 2011-02-03 International Business Machines Corporation Extensible Web Context in Web Containers
US9170797B2 (en) * 2012-01-31 2015-10-27 Red Hat, Inc. Automated deployment of an application in a computing platform

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103581310A (en) * 2013-10-24 2014-02-12 深圳市远行科技有限公司 Automatic generating method for web service agent
CN106095408A (en) * 2016-05-31 2016-11-09 浙江网新恒天软件有限公司 A kind of system and method for data monitoring and Code automatic build and deployment

Also Published As

Publication number Publication date
CN106843936A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
CN106843936B (en) Method for automatically deploying Web application environment
US11853774B2 (en) Dynamically loaded plugin architecture
US11599348B2 (en) Container image building using shared resources
US9811360B2 (en) Dynamic determination of application server runtime classloading
WO2017092672A1 (en) Method and device for operating docker container
US9280336B2 (en) Virtual machine disk image installation
US20140196022A1 (en) Cloud Based Application Packaging
CN106406960B (en) Method for rapidly deploying software in linux environment
CN108897547B (en) Software automation deployment method and device
US8024721B2 (en) System and method for implementing a safe framework
CN102929716B (en) Method for starting multiple processes
JP7311710B2 (en) runtime container
CN105204913A (en) Method and system for running Linux application on Android operating system and system
CN105893545A (en) Efficient Hadoop cluster deployment method
WO2017020459A1 (en) Method and apparatus for configuring plugin package for host
CN114398075A (en) Method and system for automatic deployment of go micro-service
CN111752635A (en) Application program running method and device, computer equipment and storage medium
US20080059949A1 (en) System and method for implementing a safe framework
CN110647349B (en) Method for realizing continuous delivery of iOS APP
CN114546819A (en) Code processing method and device, electronic equipment and readable medium
CN111913720A (en) Program deployment method and device
US20240069883A1 (en) Deriving a container from a package set
CN109976765B (en) Application group deployment method, device, equipment and storage medium
CN113568628B (en) ISO automated production method based on debrian system
US20080307446A1 (en) Interoperable Managed and Unmanaged Code in a Document Environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant