{"id":1004,"date":"2024-11-27T14:44:23","date_gmt":"2024-11-27T20:44:23","guid":{"rendered":"https:\/\/thecweb.com\/?p=1004"},"modified":"2024-11-27T16:49:44","modified_gmt":"2024-11-27T22:49:44","slug":"itsm-glpi-installation","status":"publish","type":"post","link":"https:\/\/thecweb.com\/index.php\/2024\/11\/27\/itsm-glpi-installation\/","title":{"rendered":"ITSM &#8211; GLPI &#8211; Installation"},"content":{"rendered":"\n<p>I have a couple fairly complicated and hopefully long-term projects I&#8217;d like to do, and things are much easier to work on if I have a good way to store information about various components and incidents, so I&#8217;m going to see how hard it is to roll my own install of <a href=\"https:\/\/glpi-project.org\/\" data-type=\"link\" data-id=\"https:\/\/glpi-project.org\/\">GLPI<\/a>(<em><a href=\"https:\/\/en.wikipedia.org\/wiki\/GLPi\" data-type=\"link\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/GLPi\">Gestionnaire Libre de Parc Informatique<\/a><\/em>, or &#8220;Free IT Equipment Manager&#8221;).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"506\" src=\"https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-6-1024x506.png\" alt=\"screenshot stolen from official docs\" class=\"wp-image-1005\" srcset=\"https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-6-1024x506.png 1024w, https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-6-300x148.png 300w, https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-6-768x379.png 768w, https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-6-1536x759.png 1536w, https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-6.png 1913w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Installation<\/h2>\n\n\n\n<p>Downloaded <a href=\"https:\/\/github.com\/glpi-project\/glpi\/releases\/download\/10.0.17\/glpi-10.0.17.tgz\" data-type=\"link\" data-id=\"https:\/\/github.com\/glpi-project\/glpi\/releases\/download\/10.0.17\/glpi-10.0.17.tgz\">this<\/a>.  Moved extracted folder to \/var\/www.  <\/p>\n\n\n\n<p>Create directories for configs, data, and logs.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>GLPI_CONFIG_DIR<\/code>: set path to the configuration directory;\n<ul class=\"wp-block-list\">\n<li>\/etc\/glpi <\/li>\n\n\n\n<li>GLPI requires read rights on this directory to work; and write rights during the installation process.<\/li>\n\n\n\n<li>copy the contents of the&nbsp;<code>config<\/code>&nbsp;directory to this place.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>GLPI_VAR_DIR<\/code>&nbsp;: set path to the&nbsp;<code>files<\/code>&nbsp;directory;\n<ul class=\"wp-block-list\">\n<li>\/var\/lib\/glpi<\/li>\n\n\n\n<li>GLPI requires read and write rights on this directory.<\/li>\n\n\n\n<li>copy the contents of the&nbsp;<code>files<\/code>&nbsp;directory to this place.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>GLPI_LOG_DIR<\/code>&nbsp;: set path to logs files.\n<ul class=\"wp-block-list\">\n<li>\/var\/log\/glpi<\/li>\n\n\n\n<li>GLPI requires read and write access on this directory.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>Create a&nbsp;<code>inc\/downstream.php<\/code>&nbsp;file into GLPI directory with the following contents:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\ndefine('GLPI_CONFIG_DIR', '\/etc\/glpi\/');\n\n<strong>if<\/strong> (file_exists(GLPI_CONFIG_DIR . '\/local_define.php')) {\n   <strong>require_once<\/strong> GLPI_CONFIG_DIR . '\/local_define.php';\n}<\/code><\/pre>\n\n\n\n<p>Create a file in&nbsp;<code>\/etc\/glpi\/local_define.php<\/code>&nbsp;with the following contents:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\ndefine('GLPI_VAR_DIR', '\/var\/lib\/glpi');\ndefine('GLPI_LOG_DIR', '\/var\/log\/glpi');<\/code><\/pre>\n\n\n\n<p>Add info Apache virtual server.  I&#8217;ll lock it down to my local network, so this won&#8217;t be accessible from the internet for now.  Added to \/etc\/apache2\/sites-enabled\/glpi.conf.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost *:80>\n        ServerName glpi\n\n        ServerAdmin webmaster@localhost\n        DocumentRoot \/var\/www\/glpi\/public\n\n        ErrorLog ${APACHE_LOG_DIR}\/glpi-error.log\n        CustomLog ${APACHE_LOG_DIR}\/glpi-access.log combined\n\n    # If you want to place GLPI in a subfolder of your site (e.g. your virtual host is serving multiple applications),\n    # you can use an Alias directive. If you do this, the DocumentRoot directive MUST NOT target the GLPI directory itself.\n    # Alias \"\/glpi\" \"\/var\/www\/glpi\/public\"\n\n    &lt;Directory \/var\/www\/glpi\/public>\n        Require all granted\n\n        RewriteEngine On\n\n        # Ensure authorization headers are passed to PHP.\n        # Some Apache configurations may filter them and break usage of API, CalDAV, ...\n        RewriteCond %{HTTP:Authorization} ^(.+)$\n        RewriteRule .* - &#91;E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]\n\n        # Redirect all requests to GLPI router, unless file exists.\n        RewriteCond %{REQUEST_FILENAME} !-f\n        RewriteRule ^(.*)$ index.php &#91;QSA,L]\n    &lt;\/Directory>\n\n\n&lt;\/VirtualHost><\/code><\/pre>\n\n\n\n<p>I of course had to add an entry for glpi in the hosts file on my laptop for this to work.<\/p>\n\n\n\n<p>Looks like it&#8217;s installed!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"316\" src=\"https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-7-1024x316.png\" alt=\"\" class=\"wp-image-1009\" srcset=\"https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-7-1024x316.png 1024w, https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-7-300x93.png 300w, https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-7-768x237.png 768w, https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-7-1536x474.png 1536w, https:\/\/thecweb.com\/wp-content\/uploads\/2024\/11\/image-7.png 1641w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a couple fairly complicated and hopefully long-term projects I&#8217;d like to do, and things are much easier to work on if I have a good way to store information about various components and incidents, so I&#8217;m going to see how hard it is to roll my own install of GLPI(Gestionnaire Libre de Parc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1005,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[42,43,14],"class_list":["post-1004","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-glpi","tag-itsm","tag-linux"],"_links":{"self":[{"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/posts\/1004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=1004"}],"version-history":[{"count":5,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/posts\/1004\/revisions"}],"predecessor-version":[{"id":1019,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/posts\/1004\/revisions\/1019"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/media\/1005"}],"wp:attachment":[{"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=1004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=1004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=1004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}