質問編集履歴

2

Serversのserver.xmlとcontext.xmlの追加

2019/08/18 06:43

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -90,7 +90,193 @@
90
90
 
91
91
  ```
92
92
 
93
-
93
+ ```
94
+
95
+ //サーバーのserver.xmlとcontext.xml
96
+
97
+ // server.xml少し省略
98
+
99
+ <?xml version="1.0" encoding="UTF-8"?>
100
+
101
+
102
+
103
+ <Server port="8005" shutdown="SHUTDOWN">
104
+
105
+ <Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
106
+
107
+ <!-- Security listener. Documentation at /docs/config/listeners.html
108
+
109
+ <Listener className="org.apache.catalina.security.SecurityListener" />
110
+
111
+ -->
112
+
113
+ <!--APR library loader. Documentation at /docs/apr.html -->
114
+
115
+ <Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
116
+
117
+ <!-- Prevent memory leaks due to use of particular java/javax APIs-->
118
+
119
+ <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
120
+
121
+ <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
122
+
123
+ <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
124
+
125
+
126
+
127
+
128
+
129
+ <GlobalNamingResources>
130
+
131
+ <!-- Editable user database that can also be used by
132
+
133
+ UserDatabaseRealm to authenticate users
134
+
135
+ -->
136
+
137
+ <Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
138
+
139
+ </GlobalNamingResources>
140
+
141
+
142
+
143
+ <Service name="Catalina">
144
+
145
+
146
+
147
+
148
+
149
+ <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
150
+
151
+ <!-- A "Connector" using the shared thread pool-->
152
+
153
+ <!--
154
+
155
+ <Connector executor="tomcatThreadPool"
156
+
157
+ port="8080" protocol="HTTP/1.1"
158
+
159
+ connectionTimeout="20000"
160
+
161
+ redirectPort="8443" />
162
+
163
+ -->
164
+
165
+
166
+
167
+ <!-- Define an AJP 1.3 Connector on port 8009 -->
168
+
169
+ <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+ <Engine defaultHost="localhost" name="Catalina">
178
+
179
+
180
+
181
+
182
+
183
+ <Realm className="org.apache.catalina.realm.LockOutRealm">
184
+
185
+ <!-- This Realm uses the UserDatabase configured in the global JNDI
186
+
187
+ resources under the key "UserDatabase". Any edits
188
+
189
+ that are performed against this UserDatabase are immediately
190
+
191
+ available for use by the Realm. -->
192
+
193
+ <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
194
+
195
+ </Realm>
196
+
197
+
198
+
199
+ <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
200
+
201
+
202
+
203
+ <!-- SingleSignOn valve, share authentication between web applications
204
+
205
+ Documentation at: /docs/config/valve.html -->
206
+
207
+ <!--
208
+
209
+ <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
210
+
211
+ -->
212
+
213
+
214
+
215
+ <!-- Access log processes all example.
216
+
217
+ Documentation at: /docs/config/valve.html
218
+
219
+ Note: The pattern used is equivalent to using pattern="common" -->
220
+
221
+ <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log" suffix=".txt"/>
222
+
223
+
224
+
225
+ <Context docBase="10_todo" path="/10_todo" reloadable="false" source="org.eclipse.jst.jee.server:10_todo"/></Host>
226
+
227
+ </Engine>
228
+
229
+ </Service>
230
+
231
+ </Server>
232
+
233
+
234
+
235
+ // context.xml
236
+
237
+ <?xml version="1.0" encoding="UTF-8"?>
238
+
239
+ <!DOCTYPE html>
240
+
241
+ <Context>
242
+
243
+
244
+
245
+ <!-- Default set of monitored resources. If one of these changes, the -->
246
+
247
+ <!-- web application will be reloaded. -->
248
+
249
+ <WatchedResource>WEB-INF/web.xml</WatchedResource>
250
+
251
+ <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
252
+
253
+
254
+
255
+ <!-- Uncomment this to disable session persistence across Tomcat restarts -->
256
+
257
+ <!--
258
+
259
+ <Manager pathname="" />
260
+
261
+ -->
262
+
263
+
264
+
265
+ <!-- Uncomment this to enable Comet connection tacking (provides events
266
+
267
+ on session expiration as well as webapp lifecycle) -->
268
+
269
+ <!--
270
+
271
+ <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
272
+
273
+ -->
274
+
275
+ </Context>
276
+
277
+
278
+
279
+ ```
94
280
 
95
281
  ```
96
282
 

1

追加

2019/08/18 06:43

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -92,7 +92,73 @@
92
92
 
93
93
 
94
94
 
95
-
95
+ ```
96
+
97
+ // 10_todo/WebContent/MATA-INF/context.xml
98
+
99
+ <?xml version="1.0" encoding="UTF-8"?>
100
+
101
+
102
+
103
+ <!DOCTYPE html>
104
+
105
+
106
+
107
+ <Context>
108
+
109
+
110
+
111
+ <Resource driverClassName="org.mariadb.jdbc.Driver"
112
+
113
+
114
+
115
+ auth="Container"
116
+
117
+
118
+
119
+ initialSize="1"
120
+
121
+
122
+
123
+ maxIdle="1"
124
+
125
+
126
+
127
+ maxWaitMillis="-1"
128
+
129
+
130
+
131
+ name="jdbc/localDB"
132
+
133
+
134
+
135
+ type="javax.sql.DataSource"
136
+
137
+
138
+
139
+ url="jdbc:mysql://127.0.0.1:3306/test"
140
+
141
+
142
+
143
+ username="root"
144
+
145
+
146
+
147
+ password="password"
148
+
149
+
150
+
151
+ defaultAutoCommit="false" />
152
+
153
+
154
+
155
+ <ResourceLink name="jdbc/authDB" global="jdbc/authDB" type="javax.sql.DataSource" />
156
+
157
+
158
+
159
+ </Context>
160
+
161
+ ```
96
162
 
97
163
 
98
164