Bonjour,

Je viens de réaliser l'installation de Cacti à l'aide de yum.

Je décide ensuite de le configurer en suivant le tutorial décrit ici :
http://planet.fedora-fr.org/tag/cacti

Il est fait référence à un dossier /var/www/cacti que je n'ai pas !
Il y a bien un dossier /usr/share/cacti dont le contenu semble similaire (dossiers include, install, fichiers php...), mais rien dans /var/www.

Que dois-je faire ? Est-ce qu'il faut que je fasse ma configuration depuis ce dossier /usr/share/cacti, en supposant qu'il créera lui-même le dossier /var/www/cacti quand je lancerai le cacti (il se lance comment, d'ailleurs ? Rien vu dans /usr/(s)bin ou dans /(s)bin) ?

Remarque : le tutorial concerne une FC6, alors que je suis sur F7. Peut-être est-ce lié ?

Merci d'avance

Totoffe
15 jours plus tard
Tiens, personne ne t'as répondu... 🙁

J'espère que tu as trouvé des réponses à tes questions dans l'intervalle.

Sinon, Cacti est en fait une application Web écrite en PHP (pour simplifier). Pour la faire fonctionner, il te faut donc un serveur Web (Apache) et PHP d'installé sur la même machine. Il faut, de plus, qu'Apache soit configuré pour gérer le contenu PHP.

A l'install du RPM de Cacti, un fichier "cacti.conf" a été ajouté dans ton répertoire "/etc/httpd" (qui contient déjà, si Apache est installé, le fichier "httpd.conf", càd la configuration d'Apache). Normalement il devrait être lu automatiquement lors du prochain démarrage d'Apache (commande "service httpd restart" ou redémarrage de la machine). Le fichier cacti.conf dit à Apache de "mapper" le répertoire web "/cacti" au répertoire "/usr/share/cacti" sur le disque de ta machine.
Si ce fichier est correctement lu au démarrage d'Apache et que ce dernier sait gérer correctement le PHP, il te suffit donc de taper "http://nom_de_mon_serveur_web/cacti" dans la barre d'URL de ton navigateur préférée pour accéder à cette application.
17 jours plus tard
hello j'ai suivi le billet du planet fedora sur cacti , et j'ai le même problème, j'ai fais : /etc/init.d/httpd restart

mais toujours impossible de me connecter
You don't have permission to access /cacti on this server.
1/ c'est pas "/etc/init.d/httpd restart" mais "service httpd restart" (la différence est subtile, mais elle existe)

2/ consulte le journal (/var/log/httpd/error_log) mais je pense qu'il y a une restriction dans le fichier de config de cacti.

3/ essaie http://localhost/cacti

A+
je suis en ssh
service httpd restart
bash: service: command not found

[Mon Jul 23 13:41:54 2007] [error] [client 192.168.1.254] client denied by server configuration: /usr/share/cacti


en localhost

The requested URL /cacti was not found on this server.
freaks wrote:bash: service: command not found
On devient root en faisant
su -
(pour la 23 523ème fois)
[Mon Jul 23 13:41:54 2007] [error] [client 192.168.1.254] client denied by server configuration: /usr/share/cacti
C'est bien ce que je disais.

Voir les restrictions dans /etc/httpd/conf.d/cacti.conf

A+
oki j'arrive bien a redemarrer le service,
cd /var/www/cacti
-bash: cd: /var/www/cacti: Aucun fichier ou répertoire de ce type

et je ne trouve pas dans /usr/share/cacti le fichier sql
freaks wrote:oki j'arrive bien a redemarrer le service,
cd /var/www/cacti
-bash: cd: /var/www/cacti: Aucun fichier ou répertoire de ce type
Heu... :-? c'est normal... :roll: vu que c'est dans /usr/share/cacti qu'il faut chercher !
ok je sui le billet du planet à propos de cacti
http://planet.fedora-fr.org/?q=cacti

/var/www/cacti/include/config.php
du coup je vais dans /usr/share/cacti/include/config.php
mais je n'ai pas
il nous faut maintenant paramétrer le fichier de configuration de Cacti qui se trouve sur /var/www/cacti/include/config.php

    $database_type = "mysql";
    $database_default = "cacti";
    $database_hostname = "localhost";
    $database_username = "cactiuser";
    $database_password = "votremotdepasse";
    $database_port = "3306";
j'ai ça
<?php
/*
 +-------------------------------------------------------------------------+
 | Copyright (C) 2004 Ian Berry                                            |
 |                                                                         |
 | 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 2          |
 | 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.                            |
 +-------------------------------------------------------------------------+
 | cacti: a php-based graphing solution                                    |
 +-------------------------------------------------------------------------+
 | Most of this code has been designed, written and is maintained by       |
 | Ian Berry. See about.php for specific developer credit. Any questions   |
 | or comments regarding this code should be directed to:                  |
 | - iberry@raxnet.net                                                     |
 +-------------------------------------------------------------------------+
 | - raXnet - http://www.raxnet.net/                                       |
 +-------------------------------------------------------------------------+
*/
require_once("db.php");
/* ----- you probably do not need to change anything below this line ----- */

/* Files that do not need http header information - Command line scripts */
$no_http_header_files = array(
    "poller.php",
    "cmd.php",
    "copy_cacti_user.php",
    "query_host_cpu.php",
    "query_host_partitions.php",
    "poller_reindex_hosts.php",
    "poller_export.php",
    "poller_commands.php",
    "rebuild_poller_cache.php",
    "script_server.php",
    "sql.php",
    "ss_host_cpu.php",
    "ss_host_disk.php",
    "ss_sql.php"
);

$config = array();
$colors = array();

/* this should be auto-detected, set it manually if needed */
$config["cacti_server_os"] = (strstr(PHP_OS, "WIN")) ? "win32" : "unix";

/* built-in snmp support */
$config["php_snmp_support"] = function_exists("snmpget");

/* used for includes */
$config["base_path"] = strtr(ereg_replace("(.*)[\/\\]include", "\\1", dirname(__FILE__)), "\\", "/");
$config["library_path"] = ereg_replace("(.*[\/\\])include", "\\1lib", dirname(__FILE__));
$config["include_path"] = dirname(__FILE__);

/* colors */
$colors["dark_outline"] = "454E53";
$colors["dark_bar"] = "AEB4B7";
$colors["panel"] = "E5E5E5";
$colors["panel_text"] = "000000";
$colors["panel_link"] = "000000";
$colors["light"] = "F5F5F5";
$colors["alternate"] = "E7E9F2";
$colors["panel_dark"] = "C5C5C5";

$colors["header"] = "00438C";
$colors["header_panel"] = "6d88ad";
$colors["header_text"] = "ffffff";http://planet.fedora-fr.org/?q=cacti
$colors["form_background_dark"] = "E1E1E1";

$colors["form_alternate1"] = "F5F5F5";
$colors["form_alternate2"] = "E5E5E5";

if ((!in_array(basename($_SERVER["PHP_SELF"]), $no_http_header_files, true)) && ($_SERVER["PHP_SELF"] != "")) {
    /* we don't want these pages cached */
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");

    /* initilize php session */
    session_start();

    /* detect and handle get_magic_quotes */
    if (!get_magic_quotes_gpc()) {
        function addslashes_deep($value) {
            $value = is_array($value) ? array_map('addslashes_deep', $value) : addslashes($value);
            return $value;
        }

        $_POST = array_map('addslashes_deep', $_POST);
        $_GET = array_map('addslashes_deep', $_GET);
        $_COOKIE = array_map('addslashes_deep', $_COOKIE);
    }

    /* make sure to start only only Cacti session at a time */
    if (!isset($_SESSION["cacti_cwd"])) {
        $_SESSION["cacti_cwd"] = $config["base_path"];
    }else{
        if ($_SESSION["cacti_cwd"] != $config["base_path"]) {
            session_unset();
            session_destroy();
        }
    }
}

/* emulate 'register_globals' = 'off' if turned on */
if ((bool)ini_get("register_globals")) {
    $not_unset = array("_GET", "_POST", "_COOKIE", "_SERVER", "_SESSION", "_ENV", "_FILES", "database_type", "database_default", "database_hostname", "database_username", "database_password", "config", "colors");

    /* Not only will array_merge give a warning if a parameter is not an array, it will
    * actually fail. So we check if HTTP_SESSION_VARS has been initialised. */
    if (!isset($_SESSION)) {
        $_SESSION = array();
    }

    /* Merge all into one extremely huge array; unset this later */
    $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_SESSION, $_ENV, $_FILES);

    unset($input["input"]);
    unset($input["not_unset"]);

    while (list($var,) = @each($input)) {
        if (!in_array($var, $not_unset)) {
            unset($$var);
        }
    }

    unset($input);
}

/* display ALL errors */
error_reporting(E_ALL);

/* include base modules */
include($config["library_path"] . "/adodb/adodb.inc.php");
include($config["library_path"] . "/database.php");
include_once($config["library_path"] . "/functions.php");
include_once($config["include_path"] . "/config_constants.php");
include_once($config["include_path"] . "/config_arrays.php");
include_once($config["include_path"] . "/config_settings.php");

/* connect to the database server */
db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);

/* include additional modules */
include_once($config["include_path"] . "/config_form.php");
include_once($config["library_path"] . "/html.php");
include_once($config["library_path"] . "/html_form.php");
include_once($config["library_path"] . "/html_utility.php");
include_once($config["library_path"] . "/html_validate.php");
include_once($config["library_path"] . "/variables.php");
include_once($config["library_path"] . "/auth.php");

/* current cacti version */
$config["cacti_version"] = "0.8.6j";

?>
ATTENTION le TUTO que tu cite est pour FC6 et donc pour une version précédente de cacti...

Ensuite, je suis pas sûr, mais essaie d'ajouter tes lignes entre
require_once("db.php");
et
/* ----- you probably do not need to change anything below this line ----- */
Salut remi,
Une question éclair :
remi wrote:1/ c'est pas "/etc/init.d/httpd restart" mais "service httpd restart" (la différence est subtile, mais elle existe)
Ou se trouve la différence ?

Merci 🙂
Suffit de lire le script /sbin/service pour comprendre (c'est du shell).

L'environnement est nettoyé avant l'appel au script de gestion du service.
Cela permet de se retrouver dans les mêmes conditions (ou presque) que lors du démarrage.

Cela évite les mauvaises surprises (j'ai rencontré le cas) ou un service démarre dans l'environnement de l'administrateur (PATH, LD_LIBRARY_PATH, etc...) et pas lors du démarrage.

A+
17 jours plus tard
SALUT,
Alors, t'en es où ? PErsonnelement, j'ai installé une FC7 specialement pour CACTI, et tout a été pour le mieux, en tous cas au niveau instal...
J'ai suivi le tuto pour FC6 en modifiant 2 ou 3 trucs et ça a tout de suite fonctionné....
Si t'as encore besoin d'aide...
@+
3 ans plus tard
salue j'ai probleme similaire quand je tape "http://localhost/cacti/install"
il m'affiche ce message "You don't have permission to access /cacti/install on this server.
Apache/2.2.16 (Fedora) Server at localhost Port 80"
aidez moi sil vous plait