質問編集履歴

1

補足追加

2019/06/16 15:45

投稿

mk222222
mk222222

スコア59

test CHANGED
File without changes
test CHANGED
@@ -55,3 +55,165 @@
55
55
 
56
56
 
57
57
  よろしくお願いいたします。
58
+
59
+
60
+
61
+ 補足
62
+
63
+ ファイルの権限は777で確認しました。
64
+
65
+
66
+
67
+ shawさんのアドバイスの元追記しました。[Service]とかのキーワードもいるみたいですね。
68
+
69
+
70
+
71
+ 変更後tomcat9.service
72
+
73
+ ```ここに言語を入力
74
+
75
+ [Unit]
76
+
77
+ Description = test
78
+
79
+
80
+
81
+ [Service]
82
+
83
+ ExecStart = /home/centos/app/test.jar
84
+
85
+ Restart = always
86
+
87
+ Type = simple
88
+
89
+ User = centos
90
+
91
+ Group = centos
92
+
93
+ SuccessExitStatus = 143
94
+
95
+
96
+
97
+ [Install]
98
+
99
+ WantedBy = multi-user.target
100
+
101
+
102
+
103
+ ```
104
+
105
+ sudo systemctl daemon-reload
106
+
107
+ sudo systemctl restart tomcat9→エラーメッセージでなくなりました
108
+
109
+
110
+
111
+ でもステータスはアクティブじゃない。。。泣き
112
+
113
+
114
+
115
+ sudo systemctl status tomcat9
116
+
117
+ ```ここに言語を入力
118
+
119
+ ● tomcat9.service - test
120
+
121
+ Loaded: loaded (/usr/lib/systemd/system/tomcat9.service; disabled; vendor preset: disabled)
122
+
123
+ Active: failed (Result: start-limit) since Sun 2019-06-16 15:07:52 UTC; 26min ago
124
+
125
+ Process: 2114 ExecStart=/home/centos/app/test.jar (code=exited, status=203/EXEC)
126
+
127
+ Main PID: 2114 (code=exited, status=203/EXEC)
128
+
129
+ ```
130
+
131
+
132
+
133
+ build.gradle(特に変更してない)
134
+
135
+ ```ここに言語を入力
136
+
137
+ plugins {
138
+
139
+ id 'org.springframework.boot' version '2.1.5.RELEASE'
140
+
141
+ id 'java'
142
+
143
+ }
144
+
145
+
146
+
147
+ apply plugin: 'io.spring.dependency-management'
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+ group = 'com.example'
156
+
157
+ version = '0.0.1-SNAPSHOT'
158
+
159
+ sourceCompatibility = '11'
160
+
161
+
162
+
163
+ configurations {
164
+
165
+ developmentOnly
166
+
167
+ runtimeClasspath {
168
+
169
+ extendsFrom developmentOnly
170
+
171
+ }
172
+
173
+ }
174
+
175
+
176
+
177
+ repositories {
178
+
179
+ mavenCentral()
180
+
181
+ }
182
+
183
+
184
+
185
+ dependencies {
186
+
187
+ implementation 'org.springframework.boot:spring-boot-starter-data-rest'
188
+
189
+ implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
190
+
191
+ implementation 'org.springframework.boot:spring-boot-starter-web'
192
+
193
+ developmentOnly 'org.springframework.boot:spring-boot-devtools'
194
+
195
+ testImplementation 'org.springframework.boot:spring-boot-starter-test'
196
+
197
+ }
198
+
199
+
200
+
201
+ ```
202
+
203
+
204
+
205
+ ローカルでのspringboot起動...〇
206
+
207
+ java -jar test.jar...〇(ただしブラウザからポート8080で応答帰ってこなかった)
208
+
209
+ apache起動確認...〇
210
+
211
+ ポート8080解放確認...〇
212
+
213
+ apacheとtomcatの連携...未(必要なのかわかってない)
214
+
215
+ もしかしたら前提条件たりてないのでしょうか。。
216
+
217
+
218
+
219
+ Linuxむっずいよお。