You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-02-19 13:10:53

sachka
Member
Registered: 2024-02-19
Posts: 6

Problème connexion sur mon GLPI

Bonjour,

Je n'ai pas trouver de topic parlant de cela, si jamais il existe, je m'excuse d'avance de l'avoir redondé !

Voici mon problème:

J'ai installé un GLPI sur un debian12 et tout était ok, mais j'ai voulu installer un reverse proxy pour masquer mon ip public. Et la c'est le drame ! Déjà j'ai pas réussi et quand je suis revenu en arrière, ben, plus moyen de me connecter à mon GLPI. voici ce qui s'affiche quand j'essaie de me connecter via mon navigateur en local (pareil via l'ip public).


<?php

/**
* ---------------------------------------------------------------------
*
* GLPI - Gestionnaire Libre de Parc Informatique
*
* *http://glpi-project.org*
*
* @copyright 2015-2023 Teclib' and contributors.
* @copyright 2003-2014 by the INDEPNET Development Team.
* @licence   *https://www.gnu.org/licenses/gpl-3.0.html*
*
* ---------------------------------------------------------------------
*
* LICENSE
*
* This file is part of GLPI.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <*https://www.gnu.org/licenses/*>.
*
* ---------------------------------------------------------------------
*/

/**
* GLPI web router.
*
* This router is used to be able to expose only the `/public` directory on the webserver.
*/

$glpi_root  = realpath(dirname(__FILE__, 2));

if (preg_match('/^\/public/', $_SERVER['REQUEST_URI']) !== 1 && $_SERVER['SCRIPT_NAME'] === '/public/index.php') {
    // When requested URI does not start with '/public' but `$_SERVER['SCRIPT_NAME']` is '/public/index.php',
    // it means that document root is the GLPI root directory, but a rewrite rule redirects the request to the PHP router.
    // This case happen when redirection to PHP router is made by an `.htaccess` file placed in the GLPI root directory,
    // and has to be handled to support shared hosting where it is not possible to change the web server root directory.
    $uri_prefix = '';
} else {
    // `$_SERVER['SCRIPT_NAME']` corresponds to the script path relative to server document root.
    // -> if server document root is `/public`, then `$_SERVER['SCRIPT_NAME']` will be equal to `/index.php`
    // -> if script is located into a `/glpi-alias` alias directory, then `$_SERVER['SCRIPT_NAME']` will be equal to `/glpi-alias/index.php`
    $uri_prefix = rtrim(str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'])), '/');
}

// Get URI path relative to GLPI (i.e. without alias directory prefix).
$path       = preg_replace(
    '/^' . preg_quote($uri_prefix, '/') . '/',
    '',
    parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH)
);

require $glpi_root . '/src/Http/ProxyRouter.php';

$proxy = new \Glpi\Http\ProxyRouter($glpi_root, $path);

if ($proxy->isTargetAPhpScript() && $proxy->isPathAllowed() && ($target_file = $proxy->getTargetFile()) !== null) {
    // Ensure `getcwd()` and inclusion path is based on requested file FS location.
    chdir(dirname($target_file));

    // Redefine some $_SERVER variables to have same values whenever scripts are called directly
    // or through current router.
    $target_path     = $uri_prefix . $proxy->getTargetPath();
    $target_pathinfo = $proxy->getTargetPathInfo();
    $_SERVER['PATH_INFO']       = $target_pathinfo;
    $_SERVER['PHP_SELF']        = $target_path;
    $_SERVER['SCRIPT_FILENAME'] = $target_file;
    $_SERVER['SCRIPT_NAME']     = $target_path;

    // Execute target script.
    require($target_file);
    exit();
}

$proxy->proxify();



Je sais pas si mon histoire et clair !

mercie d'avance pour votre aide !

Offline

#2 2024-02-19 13:14:54

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,437
Website

Re: Problème connexion sur mon GLPI

Quel logiciel de serveur Web utilisez-vous ? Apaches ?


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#3 2024-02-19 13:19:02

sachka
Member
Registered: 2024-02-19
Posts: 6

Re: Problème connexion sur mon GLPI

Oui, j'utilise apache

Offline

#4 2024-02-19 14:25:30

sachka
Member
Registered: 2024-02-19
Posts: 6

Re: Problème connexion sur mon GLPI

j'ai l'impression que l'installation et la configuration du proxy a modifié une conf du glpi (touchant le proxy apparemment) mais je ne sais pas quoi !

Offline

#5 2024-02-19 16:09:26

sachka
Member
Registered: 2024-02-19
Posts: 6

Re: Problème connexion sur mon GLPI

Re-bonjour à tous ..

C'est bon j'ai trouver la solution. j'ai juste réactiver le module suivant : "sudo a2enmod proxy_fcgi setenvif"

merci quand même !

Offline

Board footer

Powered by FluxBB