Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédente | |||
elearning:workbooks:tomcat:tc04 [2023/10/04 14:19] – admin | elearning:workbooks:tomcat:tc04 [2023/10/04 14:53] (Version actuelle) – old revision restored (2023/04/11 05:56) admin | ||
---|---|---|---|
Ligne 74: | Ligne 74: | ||
* arrêter une application, | * arrêter une application, | ||
* supprimer un application. | * supprimer un application. | ||
- | |||
- | Afin d' | ||
- | |||
- | < | ||
- | [root@centos8 work]# vi $CATALINA_HOME/ | ||
- | [root@centos8 work]# cat $CATALINA_HOME/ | ||
- | <?xml version=" | ||
- | <!-- | ||
- | Licensed to the Apache Software Foundation (ASF) under one or more | ||
- | contributor license agreements. | ||
- | this work for additional information regarding copyright ownership. | ||
- | The ASF licenses this file to You under the Apache License, Version 2.0 | ||
- | (the " | ||
- | the License. | ||
- | |||
- | http:// | ||
- | |||
- | Unless required by applicable law or agreed to in writing, software | ||
- | distributed under the License is distributed on an "AS IS" BASIS, | ||
- | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
- | See the License for the specific language governing permissions and | ||
- | limitations under the License. | ||
- | --> | ||
- | <Context antiResourceLocking=" | ||
- | < | ||
- | | ||
- | <!-- <Valve className=" | ||
- | | ||
- | <Manager sessionAttributeValueClassNameFilter=" | ||
- | </ | ||
- | </ | ||
- | |||
- | <WRAP center round important 60%> | ||
- | **Important** : Notez que cette modification ne necéssite **pas** le redémarrage du serveur Tomcat. | ||
- | </ | ||
====L' | ====L' | ||
Ligne 142: | Ligne 107: | ||
< | < | ||
- | [root@centos8 work]# lynx --dump -auth=admin: | + | [root@centos7 bin]# lynx --dump -auth=admin: |
- | OK - Listed applications for virtual host [localhost] | + | OK - Listed applications for virtual host localhost |
/: | /: | ||
/ | / | ||
Ligne 149: | Ligne 114: | ||
/ | / | ||
/ | / | ||
+ | |||
</ | </ | ||
Ligne 160: | Ligne 126: | ||
< | < | ||
- | [root@centos8 work]# lynx --dump -auth admin: | + | [root@centos7 bin]# lynx --dump -auth admin: |
- | OK - Deployed application at context path [/sample] | + | OK - Deployed application at context path /sample |
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Notez l' | **Important** : Notez l' | ||
</ | </ | ||
Ligne 171: | Ligne 138: | ||
< | < | ||
- | [root@centos8 work]# ls ../webapps/ | + | [root@centos7 bin]# ls ../webapps/ |
docs examples | docs examples | ||
</ | </ | ||
Ligne 180: | Ligne 147: | ||
< | < | ||
- | [root@centos8 work]# lynx --dump -auth admin: | + | [root@centos7 bin]# lynx --dump -auth admin: |
- | OK - Started application at context path [/sample] | + | OK - Started application at context path /sample |
</ | </ | ||
Ligne 189: | Ligne 156: | ||
< | < | ||
- | [root@centos8 work]# lynx --dump -auth admin: | + | [root@centos7 bin]# lynx --dump -auth admin: |
- | OK - Stopped application at context path [/sample] | + | OK - Stopped application at context path /sample |
</ | </ | ||
Ligne 198: | Ligne 165: | ||
< | < | ||
- | [root@centos8 work]# lynx --dump -auth admin: | + | [root@centos7 bin]# lynx --dump -auth admin: |
- | OK - Started application at context path [/sample] | + | OK - Started application at context path /sample |
- | + | [root@centos7 bin]# | |
- | [root@centos8 work]# lynx --dump -auth admin: | + | [root@centos7 bin]# lynx --dump -auth admin: |
- | OK - Reloaded application at context path [/sample] | + | OK - Reloaded application at context path /sample |
</ | </ | ||
Ligne 210: | Ligne 177: | ||
< | < | ||
- | [root@centos8 work]# lynx --dump -auth admin: | + | [root@centos7 bin]# lynx --dump -auth admin: |
- | OK - Undeployed application at context path [/sample] | + | OK - Undeployed application at context path /sample |
</ | </ | ||
Ligne 217: | Ligne 184: | ||
< | < | ||
- | [root@centos8 work]# ls ../webapps/ | + | [root@centos7 bin]# ls ../webapps/ |
docs examples | docs examples | ||
</ | </ | ||
Ligne 226: | Ligne 193: | ||
< | < | ||
- | [root@centos8 work]# lynx --dump -auth admin: | + | [root@centos7 bin]# lynx --dump -auth admin: |
+ | OK - Listed global resources of all types | ||
UserDatabase: | UserDatabase: | ||
</ | </ | ||
Ligne 241: | Ligne 209: | ||
< | < | ||
- | [root@centos8 work]# lynx --dump -auth admin: | + | [root@centos7 bin]# lynx --dump -auth admin: |
OK - Server info | OK - Server info | ||
- | Tomcat Version: | + | Tomcat Version: Apache Tomcat/8.0.36 |
- | OS Name: [Linux] | + | OS Name: Linux |
- | OS Version: | + | OS Version: |
- | OS Architecture: | + | OS Architecture: |
- | JVM Version: | + | JVM Version: 1.8.0_232-b09 |
- | JVM Vendor: | + | JVM Vendor: |
</ | </ | ||
Ligne 255: | Ligne 223: | ||
Afin de pouvoir utiliser l' | Afin de pouvoir utiliser l' | ||
- | <code> | + | <file> |
- | [root@centos8 work]# vi $CATALINA_HOME/ | + | |
- | [root@centos8 work]# cat $CATALINA_HOME/ | + | |
<?xml version=' | <?xml version=' | ||
< | < | ||
Ligne 271: | Ligne 237: | ||
<user username=" | <user username=" | ||
</ | </ | ||
- | </code> | + | </file> |
- | Re-démarrez le serveur Tomcat : | + | Arrêtez puis démarrez le serveur Tomcat : |
< | < | ||
- | [root@centos8 work]# systemctl restart tomcat | + | [root@centos7 bin]# ./ |
- | [root@centos8 work]# systemctl status tomcat | + | Using CATALINA_BASE: |
- | ● tomcat.service - Apache Tomcat Web Application Container | + | Using CATALINA_HOME: |
- | Loaded: loaded (/etc/systemd/system/tomcat.service; | + | Using CATALINA_TMPDIR: / |
- | Active: active (running) since Wed 2023-10-04 10:09:53 EDT; 6s ago | + | Using JRE_HOME: / |
- | | + | Using CLASSPATH: |
- | Process: 75813 ExecStart=/usr/tomcat10/ | + | [root@centos7 bin]# ./ |
- | Main PID: 75825 (java) | + | Using CATALINA_BASE: / |
- | Tasks: 50 (limit: 100949) | + | Using CATALINA_HOME: / |
- | | + | Using CATALINA_TMPDIR: /usr/tomcat8/ |
- | CGroup: /system.slice/tomcat.service | + | Using JRE_HOME: |
- | └─75825 | + | Using CLASSPATH: |
+ | Tomcat started. | ||
+ | </code> | ||
- | Oct 04 10:09:53 centos8.ittraining.loc systemd[1]: Starting Apache Tomcat Web Application Container... | + | Si vous vous êtes connecté à votre machine virtuelle via ssh, passez la VM CentOS 7 en démarrage en mode graphique |
- | Oct 04 10:09:53 centos8.ittraining.loc startup.sh[75813]: Existing PID file found during start. | + | |
- | Oct 04 10:09:53 centos8.ittraining.loc startup.sh[75813]: Removing/clearing stale PID file. | + | < |
- | Oct 04 10:09:53 centos8.ittraining.loc startup.sh[75813]: Tomcat started. | + | [root@centos7 bin]# ls -l / |
- | Oct 04 10:09:53 centos8.ittraining.loc | + | lrwxrwxrwx. 1 root root 37 Apr 30 2016 / |
+ | [root@centos7 bin]# rm -rf / | ||
+ | [root@centos7 bin]# ln -s /lib/ | ||
+ | [root@centos7 bin]# ls -l / | ||
+ | lrwxrwxrwx. 1 root root 36 Oct 29 13:27 / | ||
+ | [root@centos7 bin]# shutdown -h now | ||
</ | </ | ||
- | Connectez-vous | + | Une fois la VM arrêtée, augmentez la mémoire qui lui est allouée |
- | Dans la boîte d' | + | Connectez-vous à votre machine virtuelle et **démarrez** Tomcat via ssh et démarrez Tomcat |
- | {{ :elearning:workbooks:tomcat:capture_d_ecran_du_2023-10-04_16-14-03.png?600 |}} | + | < |
+ | [root@centos7 bin]# ./ | ||
+ | Using CATALINA_BASE: / | ||
+ | Using CATALINA_HOME: / | ||
+ | Using CATALINA_TMPDIR: / | ||
+ | Using JRE_HOME: / | ||
+ | Using CLASSPATH: | ||
+ | Tomcat started. | ||
+ | </ | ||
- | Vous obtiendrez l' | + | Lancez ensuite le navigateur |
- | {{ : | + | Dans la boîte d' |
- | <WRAP center round todo 60%> | + | Validez. Vous obtiendrez l' |
- | **A faire** : Explorez cette interface. Ensuite passez en revue chacun des exemples dans les applications **jsp-examples** et **servlets-examples** en affichant le résultat ainsi que le code. | + | |
- | </ | + | |
+ | Explorez cette interface. Ensuite passez en revue chacun des exemples dans les applications **jsp-examples** et **servlets-examples** en affichant le résultat ainsi que le code. | ||
====L' | ====L' | ||
Ligne 388: | Ligne 368: | ||
<?xml version=" | <?xml version=" | ||
<project name=" | <project name=" | ||
- | < | + | < |
< | < | ||
< | < |