File tree Expand file tree Collapse file tree 5 files changed +50
-1
lines changed Expand file tree Collapse file tree 5 files changed +50
-1
lines changed Original file line number Diff line number Diff line change
1
+ version : 0.0
2
+ os : linux
3
+ files :
4
+ - source : /target/nextwork-web-project.war
5
+ destination : /usr/share/tomcat/webapps/
6
+ hooks :
7
+ BeforeInstall :
8
+ - location : scripts/install_dependencies.sh
9
+ timeout : 300
10
+ runas : root
11
+ ApplicationStart :
12
+ - location : scripts/start_server.sh
13
+ timeout : 300
14
+ runas : root
15
+ ApplicationStop :
16
+ - location : scripts/stop_server.sh
17
+ timeout : 300
18
+ runas : root
19
+
Original file line number Diff line number Diff line change @@ -20,4 +20,6 @@ phases:
20
20
artifacts :
21
21
files :
22
22
- target/nextwork-web-project.war
23
- discard-paths : no
23
+ - appspec.yml
24
+ - scripts/**/*
25
+ discard-paths : no
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ sudo yum install tomcat -y
3
+ sudo yum -y install httpd
4
+ sudo cat << EOF > /etc/httpd/conf.d/tomcat_manager.conf
5
+ <VirtualHost *:80>
6
+ ServerAdmin root@localhost
7
+ ServerName app.nextwork.com
8
+ DefaultType text/html
9
+ ProxyRequests off
10
+ ProxyPreserveHost On
11
+ ProxyPass / http://localhost:8080/nextwork-web-project/
12
+ ProxyPassReverse / http://localhost:8080/nextwork-web-project/
13
+ </VirtualHost>
14
+ EOF
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ sudo systemctl start tomcat.service
3
+ sudo systemctl enable tomcat.service
4
+ sudo systemctl start httpd.service
5
+ sudo systemctl enable httpd.service
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ isExistApp=" $( pgrep httpd) "
3
+ if [[ -n $isExistApp ]]; then
4
+ sudo systemctl stop httpd.service
5
+ fi
6
+ isExistApp=" $( pgrep tomcat) "
7
+ if [[ -n $isExistApp ]]; then
8
+ sudo systemctl stop tomcat.service
9
+ fi
You can’t perform that action at this time.
0 commit comments