安装 GLPI

请按以下步骤操作:

  1. Configure your webserver,

  2. 版本选择,

  3. 下载档案,

  4. 安装 :)

选择版本

备注

强烈建议您为生产用途选择最新的稳定版本。

GLPI遵循3位数的语义版本控制方案。第一个是主要版本,第二个是次要版本,第三个是修订版本。

主要版本可能具有重要的不兼容性和新功能;次要版本也可能带来新功能,但在主要版本内保持完美兼容。

修复版本只会修复报告的问题而不添加任何新内容。

下载

警告

在GitHub上,总有两个名为*Source code*的档案,不应该使用。不应该这样说啊,github上不使用的source code好像没这说法。

点击 下载 按钮 GLPI 官方网站 (或从Github获取 Github release) 选择 glpi-{version}.tgz 文档.

安装

GLPI安装由三个步骤组成:

  1. 解压缩您网站中的存档;

  2. 让你的web服务器写入``files``和``config``目录;

  3. :doc:启动安装向导<wizard>`(或使用:ref:`命令行安装脚本<cdline_install>)。

完成这三个步骤后,即可使用该应用程序。

If you need to set advanced configuration, like SSL connection parameters, please refer to advanced configuration.

文件和目录位置

和许多其他Web应用程序一样,只需将整个目录复制到任何Web服务器即可安装GLPI。但是,这可能不太安全

警告

直接从Web服务器访问的每个文件都必须被视为不安全!

GLPI将一些数据存储在``files``目录中,数据库账号密码等访问配置信息都存储在``config``目录中,等等。即使GLPI提供了一些方法来防止Web服务器直接访问文件,最佳做法是将数据存储在Web根目录之外。 这样,无法直接从Web服务器访问敏感文件。

您可以使用一些配置指令来实现该指令(在提供的下游包中使用的指令):

  • GLPI_CONFIG_DIR:设置配置目录的路径;

  • GLPI_VAR_DIR : 设置 files 目录路径;

  • GLPI_LOG_DIR : 设置日志文件路径.

备注

还有许多其他配置指令可供使用,我们讨论的那些指令主要考虑更安全的安装。

目录的选择完全取决于你;以下示例将遵循`FHS <http://www.pathname.com/fhs/>`_建议。

我们的GLPI实例将安装在``/var/www/glpi``中,Web服务器配置中的特定虚拟主机将反映此路径。

GLPI configuration will be stored in /etc/glpi, just copy the contents of the config directory to this place. GLPI requires read rights on this directory to work; and write rights during the installation process.

GLPI data will be stored in /var/lib/glpi, just copy the contents of the files directory to this place. GLPI requires read and write rights on this directory.

GLPI日志文件将存储在``/var/log/glpi``中,此处无需复制,只需创建目录即可。GLPI需要对此目录进行读写访问。

按照这些说明,我们将在GLPI目录中创建一个``inc/downstream.php``文件,其中包含以下内容:

<?php
define('GLPI_CONFIG_DIR', '/etc/glpi/');

if (file_exists(GLPI_CONFIG_DIR . '/local_define.php')) {
   require_once GLPI_CONFIG_DIR . '/local_define.php';
}

警告

GLPI包肯定会提供一个``inc/downstream.php``文件。这个不能编辑!

GLPI looks for a local_define.php file in its own config directory. If you want to use one from new config directory, you have to load it.

然后,使用以下内容在`/etc/glpi/local_define.php``中创建一个文件:

<?php
define('GLPI_VAR_DIR', '/var/lib/glpi');
define('GLPI_LOG_DIR', '/var/log/glpi');

备注

在 9.2.2 版本加入.

对于9.2.2之前的GLPI,``GLPI_VAR_DIR``常量不存在,需要分别设置所有路径:

<?php
define('GLPI_VAR_DIR', '/var/lib/glpi');
define('GLPI_DOC_DIR',        GLPI_VAR_DIR);
define('GLPI_CRON_DIR',       GLPI_VAR_DIR . '/_cron');
define('GLPI_DUMP_DIR',       GLPI_VAR_DIR . '/_dumps');
define('GLPI_GRAPH_DIR',      GLPI_VAR_DIR . '/_graphs');
define('GLPI_LOCK_DIR',       GLPI_VAR_DIR . '/_lock');
define('GLPI_PICTURE_DIR',    GLPI_VAR_DIR . '/_pictures');
define('GLPI_PLUGIN_DOC_DIR', GLPI_VAR_DIR . '/_plugins');
define('GLPI_RSS_DIR',        GLPI_VAR_DIR . '/_rss');
define('GLPI_SESSION_DIR',    GLPI_VAR_DIR . '/_sessions');
define('GLPI_TMP_DIR',        GLPI_VAR_DIR . '/_tmp');
define('GLPI_UPLOAD_DIR',     GLPI_VAR_DIR . '/_uploads');
define('GLPI_CACHE_DIR',      GLPI_VAR_DIR . '/_cache');

define('GLPI_LOG_DIR', '/var/log/glpi');

Of course, it is always possible to redefine any of those paths if needed.

安装后

一旦安装了GLPI,你就快完成了。

An extra step would be to secure installation directory. As an example, you can consider adding the following to your Apache virtual host configuration (or in the glpi/install/.htaccess file):

<IfModule mod_authz_core.c>
    Require local
</IfModule>
<IfModule !mod_authz_core.c>
    order deny, allow
    deny from all
    allow from 127.0.0.1
    allow from ::1
</IfModule>
ErrorDocument 403 "<p><b>Restricted area.</b><br />Only local access allowed.<br />Check your configuration or contact your administrator.</p>"

在这个例子中,`install`目录访问将仅限于localhost,否则将显示错误消息。当然,您可能需要根据您的需要进行调整;

|CC-by-NC-ND|