IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

SUSE Discussion :

Configurer Tomcat sous Opensuse Leap 15.1


Sujet :

SUSE

  1. #1
    Expert éminent
    Avatar de CinePhil
    Homme Profil pro
    Ingénieur d'études en informatique
    Inscrit en
    Août 2006
    Messages
    16 814
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Ingénieur d'études en informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Août 2006
    Messages : 16 814
    Billets dans le blog
    14
    Par défaut Configurer Tomcat sous Opensuse Leap 15.1
    Bonjour,

    J'ai un serveur Kimsufi sous Opensuse Leap 15.1.

    J'ai installé, avec Yast, tomcat, tomcat-admin-webapps et apache2-mod_jk.
    J'ai modifié le tomcat-users.xml pour activer les rôles et le user admin.

    Un curl -v -L http://localhost:8080/manager donne ceci :
    * Trying ::1...
    * TCP_NODELAY set
    * Connected to localhost (::1) port 8080 (#0)
    > GET /manager HTTP/1.1
    > Host: localhost:8080
    > User-Agent: curl/7.60.0
    > Accept: */*
    >
    < HTTP/1.1 302
    < Location: /manager/
    < Transfer-Encoding: chunked
    < Date: Mon, 23 Dec 2019 15:04:31 GMT
    <
    * Ignoring the response-body
    * Connection #0 to host localhost left intact
    * Issue another request to this URL: 'http://localhost:8080/manager/'
    * Found bundle for host localhost: 0x55fa02631390 [can pipeline]
    * Re-using existing connection! (#0) with host localhost
    * Connected to localhost (::1) port 8080 (#0)
    > GET /manager/ HTTP/1.1
    > Host: localhost:8080
    > User-Agent: curl/7.60.0
    > Accept: */*
    >
    < HTTP/1.1 302
    < Location: /manager/html
    < Content-Type: text/html
    < Content-Length: 0
    < Date: Mon, 23 Dec 2019 15:04:31 GMT
    <
    * Connection #0 to host localhost left intact
    * Issue another request to this URL: 'http://localhost:8080/manager/html'
    * Found bundle for host localhost: 0x55fa02631390 [can pipeline]
    * Re-using existing connection! (#0) with host localhost
    * Connected to localhost (::1) port 8080 (#0)
    > GET /manager/html HTTP/1.1
    > Host: localhost:8080
    > User-Agent: curl/7.60.0
    > Accept: */*
    >
    < HTTP/1.1 401
    < Cache-Control: private
    < Expires: Thu, 01 Jan 1970 00:00:00 GMT
    < WWW-Authenticate: Basic realm="Tomcat Manager Application"
    < Content-Type: text/html;charset=ISO-8859-1
    < Content-Length: 2499
    < Date: Mon, 23 Dec 2019 15:04:31 GMT
    <
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>401 Unauthorized</title>
    <style type="text/css">
    <!--
    BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}
    H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
    PRE, TT {border: 1px dotted #525D76}
    A {color : black;}A.name {color : black;}
    -->
    </style>
    </head>
    <body>
    <h1>401 Unauthorized</h1>
    <p>
    You are not authorized to view this page. If you have not changed
    any configuration files, please examine the file
    <tt>conf/tomcat-users.xml</tt> in your installation. That
    file must contain the credentials to let you use this webapp.
    </p>
    <p>
    For example, to add the <tt>manager-gui</tt> role to a user named
    <tt>tomcat</tt> with a password of <tt>s3cret</tt>, add the following to the
    config file listed above.
    </p>
    <pre>
    &lt;role rolename="manager-gui"/&gt;
    &lt;user username="tomcat" password="s3cret" roles="manager-gui"/&gt;
    </pre>
    <p>
    Note that for Tomcat 7 onwards, the roles required to use the manager
    application were changed from the single <tt>manager</tt> role to the
    following four roles. You will need to assign the role(s) required for
    the functionality you wish to access.
    </p>
    <ul>
    <li><tt>manager-gui</tt> - allows access to the HTML GUI and the status
    pages</li>
    <li><tt>manager-script</tt> - allows access to the text interface and the
    status pages</li>
    <li><tt>manager-jmx</tt> - allows access to the JMX proxy and the status
    pages</li>
    <li><tt>manager-status</tt> - allows access to the status pages only</li>
    </ul>
    <p>
    The HTML interface is protected against CSRF but the text and JMX interfaces
    are not. To maintain the CSRF protection:
    </p>
    <ul>
    <li>Users with the <tt>manager-gui</tt> role should not be granted either
    the <tt>manager-script</tt> or <tt>manager-jmx</tt> roles.</li>
    <li>If the text or jmx interfaces are accessed through a browser (e.g. for
    testing since these interfaces are intended for tools not humans) then
    the browser must be closed afterwards to terminate the session.</li>
    </ul>
    <p>
    For more information - please see the
    <a href="/docs/manager-howto.html" rel="noopener noreferrer">Manager App How-To</a>.
    </p>
    </body>

    </html>
    * Connection #0 to host localhost left intact
    Que manque t-il ?
    Philippe Leménager. Ingénieur d'étude à l'École Nationale Supérieure de Formation de l'Enseignement Agricole, en retraite... mais toujours Autoentrepreneur à l'occasion.
    Mon ancien blog sur la conception des BDD, le langage SQL, le PHP... et mon nouveau blog sur les mêmes sujets.
    « Ce que l'on conçoit bien s'énonce clairement, et les mots pour le dire arrivent aisément ». (Nicolas Boileau)
    À la maison comme au bureau, j'utilise la suite Linux Mageïa !

  2. #2
    Expert éminent
    Avatar de CinePhil
    Homme Profil pro
    Ingénieur d'études en informatique
    Inscrit en
    Août 2006
    Messages
    16 814
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Ingénieur d'études en informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Août 2006
    Messages : 16 814
    Billets dans le blog
    14
    Par défaut
    J'ai désinstallé / réinstallé avec cette fois les applications exemple.

    J'ai commenté la section valve dans le context.xml de l'appli manager ; j'ai modifié le tomcat-users.xml de /etc/tomcat/conf.

    Avec un browser, j'accède bien à [ip du serveur]:8080/ qui affiche la page d'accueil de Tomcat mais quand je clique sur le lien du manager, j'obtiens un beau "403 Access Denied" !

    Je ne vois vraiment pas ce qui cloche.
    Philippe Leménager. Ingénieur d'étude à l'École Nationale Supérieure de Formation de l'Enseignement Agricole, en retraite... mais toujours Autoentrepreneur à l'occasion.
    Mon ancien blog sur la conception des BDD, le langage SQL, le PHP... et mon nouveau blog sur les mêmes sujets.
    « Ce que l'on conçoit bien s'énonce clairement, et les mots pour le dire arrivent aisément ». (Nicolas Boileau)
    À la maison comme au bureau, j'utilise la suite Linux Mageïa !

  3. #3
    Expert éminent
    Avatar de CinePhil
    Homme Profil pro
    Ingénieur d'études en informatique
    Inscrit en
    Août 2006
    Messages
    16 814
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Ingénieur d'études en informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Août 2006
    Messages : 16 814
    Billets dans le blog
    14
    Par défaut
    Solution :
    Comme indiqué en de nombreux endroits sur Internet, il faut commenter la section valve du fichier context.xml... mais partout où on trouve cette section valve !

    Il y en a deux cachées dans /etc/tomcat/server.xml, une pour chaque application manager et host-manager !

    Bien sûr, en production, il faut configurer cette section valve en n'autorisant que les IP autorisées à administrer Tomcat.
    Philippe Leménager. Ingénieur d'étude à l'École Nationale Supérieure de Formation de l'Enseignement Agricole, en retraite... mais toujours Autoentrepreneur à l'occasion.
    Mon ancien blog sur la conception des BDD, le langage SQL, le PHP... et mon nouveau blog sur les mêmes sujets.
    « Ce que l'on conçoit bien s'énonce clairement, et les mots pour le dire arrivent aisément ». (Nicolas Boileau)
    À la maison comme au bureau, j'utilise la suite Linux Mageïa !

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Configuration site sous Tomcat
    Par creusois dans le forum Tomcat et TomEE
    Réponses: 1
    Dernier message: 10/02/2011, 13h05
  2. configuration tomcat sous netbeans
    Par youssef222 dans le forum Tomcat et TomEE
    Réponses: 2
    Dernier message: 05/02/2010, 19h09
  3. Configuration Tomcat sous debian
    Par debiancrash dans le forum Tomcat et TomEE
    Réponses: 1
    Dernier message: 27/12/2006, 11h18
  4. Réponses: 1
    Dernier message: 21/07/2006, 18h19

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo