Install GLPI under Gentoo
Documentation written by Aurel and translated by Simon Depiets
GLPI installation under Gentoo
First, as before any new installation, synchronise your portage tree. Type in the command below to update your portage. (All the commands must be entered in root)
The installation order isn't important, but for an easier dependances management, I recommand you to install the archives in the same order than I did.
I. "Packages" installation :
1. Apache 2 Installation :
emerge apache [ebuild N ] net-www/apache-2.0.51-r1
2. MySQL Installation :
emerge mysql [ebuild N ] dev-db/mysql-4.0.20-r1 +berkdb -debug -innodb +perl +readline -(selinux) +ssl -static +tcpd 13,484 kB [ebuild N ] dev-perl/Net-Daemon-0.37 29 kB [ebuild N ] dev-perl/Storable-2.07-r1 94 kB [ebuild N ] dev-perl/PlRPC-0.2016-r1 17 kB [ebuild N ] dev-perl/DBI-1.38 292 kB [ebuild N ] dev-perl/DBD-mysql-2.1027 95 kB
3. PHP Installation :
USE="mysql" emerge php [ebuild N ] app-text/sablotron-1.0 -doc +perl [ebuild N ] net-libs/libwww-5.4.0-r2 +mysql -ssl [ebuild N ] dev-php/php-4.3.9 -X +berkdb -crypt -curl -debug -debug -doc -fdftk -firebird -flash -freetds -gd -gd-external +gdbm -gmp -hardenedphp -imap -informix -ipv6 -java -jpeg -kerberos -ldap -mcal -memlimit -mssql +mysql +ncurses +nls -oci8 -odbc +pam -pdflib -png -postgres -qt +readline -snmp -spell -ssl -tiff -truetype +xml2 -yaz 3,908 kB
USE=“mysql” isn't useless, it make php compilation with mysql support.
4. mod_php Installation :
USE="apache2 mysql" emerge dev-php/mod_php
Once again USE=“apache2 mysql” is useful to build mod_php by telling him he will work with an apache2 server and a MySQL database.
II. GLPI Installation :
1. Apache configuration:
Before starting the installation, you will have to enter some commands ;). First you have to tell the Apache server he must support PHP. You will have to add this line in the /etc/conf.d/apache2 file.
Enter “/etc/init.d/apache2 start” command to start the server. If you see “!!”, it is that the server didn't start correctly. To know why, enter the following command:
If you see the following error (it produces very often), « Name or service not known: mod_unique_id: unable to find IPv4 address of “XP2700” » this willtell you that your computer name isn't in the /etc/hosts file. So if you do a ping XP2700 (XP 2700 is the computer name), the computer will send back : ping: unknown host XP2700. To avoid this error, edit hosts file and add following line:
your_ip your_computer_name Ex: 127.0.0.1 localhost (by default in your file) 192.168.0.20 XP2700
Now re-enter “/etc/init.d/apache2 restart” command and the server should start.
2. MySQL Configuration:
Enter the command: “/etc/init.d/mysql start” and if once again it doesn't work it's normal. The following message will appear on your screen :
You don't appear to have the mysql database installed yet. * Please run /usr/bin/mysql_install_db to have this done…
So it asks you to enter the “/usr/bin/mysql_install_db” command so the server will be able to start.
When it's done, enter the command:
MySQL is started but you have to secure it a little. So we have to give a password to the mysql root user. Enter the following command:
mysqladmin -u root password 'new-password'
Type a password in new-password but don't delete the ' which are importants. To make GLPI running you have to create a base called “glpidb”. Enter the following command to create it:
mysql -u root -p
Once you will have pressed “Enter” it will display “Enter password:”. Enter the password you've submitted and press “Enter” again. If all went good, you should see a prompt :
Now create glpidb database. Enter the following command:
create database glpidb;
Now we have to create a glpiuser user which will be able to administrate the database.
mysql>grant all privileges on glpidb.* to glpiuser@localhost ->identified by 'glpiuser_password';
Some are thinking I forgot the “;” at the end of the first line, but no, i shouldn't. We put a “;” at the end of a command, not at the end of the line. Put a password in place of glpiuser_password and enter exit to exit.
3. GLPI package Installation :
You now have to download the last version of GPLI on the http://glpi-project.org website, “Download” section.
Then you have to unzip the tarball in the /var/www directory Apache created for you :
hector# hector#tar -xvzf glpi-X.X.X.tar.gz -C /var/www/
If you take a turn into /var/www/ directory, you will see GLPI has created a GLPI folder.
Now you will have to give rights to some folders :
hector# hector#cd /var/www/glpi hector#chmod 777 /backups/dump /glpi/config /docs/
Now, you will do all online, you have to “visit” your « http://your_server/glpi » directory with a browser.
At the first connection to this adress, an install process step-by-step will begin. The frontend is easy, you just have to enter informations asked. Once over, the system will ask you the identification you have types in and you will be able to use GPLI.
In case of a major error (ie: you have lost your access to GLPI…), to “rerun” this installation process, you just have delete the followinf file :
The next connection into « http://your_server/glpi » folder will run again the configuration process (in fact, it's because there is no « config_db.php » file).
For more informations about GLPI configuration : see Install GLPI