Canalblog
Editer la page Suivre ce blog Administration + Créer mon blog
Des guides, des tutos

OCSNG

J'utilise comme beaucoup d'entre vous OCSNG et GLPI dans ma société.
Le tuto ci-dessous montre l'installation d'OCSNG, pas de GLPI.
Toujours sur du Ubuntu 13.10 le tuto est un peu en "prises de notes", et concerne MON architecture.
En espérant qu'il vous aide un maximum !

On commence par installer les prérequis :

Commencez par installer un Ubuntu propre tout beau tout neuf.
Pour ma part, je travaille en root (oui je sais, c'est très mal..)
Je commence donc par donner à l'utilisateur root un mot de passe.

Sudo passwd root

Pour passer en root

Su root


Mettre une IP fixe :

Repérer le nom de l’interface en cours (en général eth0)
Tapez ifconfig –a

Editer avec nano le fichier /etc/network/interfaces et ajouter les lignes suivantes :

# carte ethernet avec ip attribuée manuellement
auto eth0
iface eth0 inet static
address 172.16.X.X
netmask 255.255.255.0
gateway 172.16.x.x
dns-nameservers 172.16.x.x

Redémarrer le service network ou rebooter l’OS :

Service networking restart


J'active ensuite le SSH et je mets à l'heure avec NTP
Voir les 2 tutos correspondants sur ce blog :)

Petit affinage, le paramétrage du fichier /etc/hosts
Il faut rajouter la ligne :

172.16.x.x nom_server.domain.local nom_server


Enfin, on attaque les choses sérieuses. On va s'amuser à mettre à jour le noyau :

uname -r # Pour connaître la version du noyau #
apt-get update
apt-get install build-essential linux-headers-`version de votre noyau`


ou

apt-get install build-essential linux-headers-$(uname -r)


puis

apt-get install xinetd
apt-get install nfs-common
apt-get install apache2 libapache2-mod-perl2
apt-get install mysql-server -> l'install vous demandera de saisir le mdp root de Mysql
apt-get install libapache2-mod-php5
apt-get install libxml-simple-perl
apt-get install libio-compress-perl
apt-get install libdbi-perl libdbd-mysql-perl
apt-get install libnet-ip-perl libphp-pclzip make
apt-get install libapache-dbi-perl php-soap libsoap-lite-perl
apt-get install php5 php5-cgi php5-gd php5-mysql
apt-get install php5-curl php5-imagick php5-imap php5-ldap
apt-get install phpmyadmin

Pour PhpMyAdmin
-> ATTENTION a bien appuyer sur espace pour sélectionner le serveur apache ou lighttpd (apache en général)
-> Faut-il configurer la base de données de phpmyadmin avec dbconfig-common -> Oui
-> demande de mdp : remettre le même que pour MySql

Installation d'OCSNG

Commencez par télécharger OCSNG, par exemple ici
D'habitude, je le place dans /home/mon_user.

Le décompresser avec la commande suivante :

tar -xzvf nom_du_fichier_téléchargé.tar.gz


Aller dans le dossier créé, puis lancer le setup :

/home/user/OCSNG_UNIX_SERVER-2.0.5# sh setup.sh

+----------------------------------------------------------+
| |
| Welcome to OCS Inventory NG Management server setup ! |
| |
+----------------------------------------------------------+

Trying to determine whitch OS or Linux distribution you use
+----------------------------------------------------------+
| Checking for Apache web server binaries ! |
+----------------------------------------------------------+

CAUTION: If upgrading Communication server from OCS Inventory NG 1.0 RC2 and
previous, please remove any Apache configuration for Communication Server!

Do you wish to continue ([y]/n)?
Assuming Communication server 1.0 RC2 or previous is not installed
on this computer.

Starting OCS Inventory NG Management server setup from folder /home/user/OCSNG_UNIX_SERVER-2.0.5
Storing log in file /home/user/OCSNG_UNIX_SERVER-2.0.5/ocs_server_setup.log

+----------------------------------------------------------+
| Checking for database server properties... |
+----------------------------------------------------------+

Your MySQL client seems to be part of MySQL version 5.5.
Your computer seems to be running MySQL 4.1 or higher, good ;-)

Which host is running database server [localhost] ?
OK, database server is running on host localhost ;-)

On which port is running database server [3306] ?
OK, database server is running on port 3306 ;-)


+----------------------------------------------------------+
| Checking for Apache web server daemon... |
+----------------------------------------------------------+

Where is Apache daemon binary [/usr/sbin/apache2] ?
OK, using Apache daemon /usr/sbin/apache2 ;-)

+----------------------------------------------------------+
| Checking for Apache main configuration file... |
+----------------------------------------------------------+

[Wed Nov 27 13:14:32.714149 2013] [core:warn] [pid 1363] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Wed Nov 27 13:14:32.714248 2013] [core:warn] [pid 1363] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Wed Nov 27 13:14:32.714272 2013] [core:warn] [pid 1363] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Wed Nov 27 13:14:32.714283 2013] [core:warn] [pid 1363] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Wed Nov 27 13:14:32.714352 2013] [core:warn] [pid 1363] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Wed Nov 27 13:14:32.722179 2013] [core:warn] [pid 1363] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Wed Nov 27 13:14:32.722508 2013] [core:warn] [pid 1363] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Wed Nov 27 13:14:32.722543 2013] [core:warn] [pid 1363] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}
[Wed Nov 27 13:14:32.762415 2013] [core:warn] [pid 1369] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Wed Nov 27 13:14:32.762570 2013] [core:warn] [pid 1369] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Wed Nov 27 13:14:32.762641 2013] [core:warn] [pid 1369] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Wed Nov 27 13:14:32.762708 2013] [core:warn] [pid 1369] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Wed Nov 27 13:14:32.762821 2013] [core:warn] [pid 1369] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Wed Nov 27 13:14:32.770386 2013] [core:warn] [pid 1369] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Wed Nov 27 13:14:32.770880 2013] [core:warn] [pid 1369] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Wed Nov 27 13:14:32.770962 2013] [core:warn] [pid 1369] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}
Where is Apache main configuration file [] ?/etc/apache2/apache2.conf
OK, using Apache main configuration file /etc/apache2/apache2.conf ;-)

+----------------------------------------------------------+
| Checking for Apache user account... |
+----------------------------------------------------------+

Which user account is running Apache web server [www-data] ?
OK, Apache is running under user account www-data ;-)

+----------------------------------------------------------+
| Checking for Apache group... |
+----------------------------------------------------------+

Which user group is running Apache web server [www-data] ?
OK, Apache is running under users group www-data ;-)

+----------------------------------------------------------+
| Checking for Apache Include configuration directory... |
+----------------------------------------------------------+

Setup found Apache Include configuration directory in
Setup will put OCS Inventory NG Apache configuration in this directory.
Where is Apache Include configuration directory [] ?/etc/apache2/conf-available
OK, Apache Include configuration directory /etc/apache2/conf-available found ;-)

+----------------------------------------------------------+
| Checking for PERL Interpreter... |
+----------------------------------------------------------+

Found PERL Intrepreter at ;-)
Where is PERL Intrepreter binary [/usr/bin/perl] ?
OK, using PERL Intrepreter /usr/bin/perl ;-)

+----------------------------------------------------------+
| Checking for Make utility... |
+----------------------------------------------------------+

OK, Make utility found at ;-)

+----------------------------------------------------------+
| Checking for Apache mod_perl version... |
+----------------------------------------------------------+

Checking for Apache mod_perl version 1.99_22 or higher
Found that mod_perl version 1.99_22 or higher is available.
OK, Apache is using mod_perl version 1.99_22 or higher ;-)

+----------------------------------------------------------+
| Checking for Communication server log directory... |
+----------------------------------------------------------+

Communication server can create detailled logs. This logs can be enabled
by setting interger value of LOGLEVEL to 1 in Administration console
menu Configuration.
Where to put Communication server log directory [/var/log/ocsinventory-server] ?
OK, Communication server will put logs into directory /var/log/ocsinventory-server ;-)

+----------------------------------------------------------+
| Checking for required Perl Modules... |
+----------------------------------------------------------+

Checking for DBI PERL module...
Found that PERL module DBI is available.
Checking for Apache::DBI PERL module...
Found that PERL module Apache::DBI is available.
Checking for DBD::mysql PERL module...
Found that PERL module DBD::mysql is available.
Checking for Compress::Zlib PERL module...
Found that PERL module Compress::Zlib is available.
Checking for XML::Simple PERL module...
Found that PERL module XML::Simple is available.
Checking for Net::IP PERL module...
Found that PERL module Net::IP is available.

+----------------------------------------------------------+
| Checking for optional Perl Modules... |
+----------------------------------------------------------+

Checking for SOAP::Lite PERL module...
Found that PERL module SOAP::Lite is available.
Checking for XML::Entities PERL module...
*** Warning: PERL module XML::Entities is not installed !
This module is only required by OCS Inventory NG SOAP Web Service.
Do you wish to continue ([y]/n] ?y

+----------------------------------------------------------+
| OK, looks good ;-) |
| |
| Configuring Communication server Perl modules... |
+----------------------------------------------------------+

Checking if your kit is complete...
Looks good
Writing Makefile for Apache::Ocsinventory
Writing MYMETA.yml

+----------------------------------------------------------+
| OK, looks good ;-) |
| |
| Preparing Communication server Perl modules... |
+----------------------------------------------------------+

+----------------------------------------------------------+
| OK, prepare finshed ;-) |
| |
| Installing Communication server Perl modules... |
+----------------------------------------------------------+

+----------------------------------------------------------+
| OK, Communication server Perl modules install finished;-)|
| |
| Creating Communication server log directory... |
+----------------------------------------------------------+

Creating Communication server log directory /var/log/ocsinventory-server.

Fixing Communication server log directory files permissions.
Configuring logrotate for Communication server.
Removing old communication server logrotate file /etc/logrotate.d/ocsinventory-NG
Writing communication server logrotate to file /etc/logrotate.d/ocsinventory-server

+----------------------------------------------------------+
| OK, Communication server log directory created ;-) |
| |
| Now configuring Apache web server... |
+----------------------------------------------------------+

To ensure Apache loads mod_perl before OCS Inventory NG Communication Server,
Setup can name Communication Server Apache configuration file
'z-ocsinventory-server.conf' instead of 'ocsinventory-server.conf'.
Do you allow Setup renaming Communication Server Apache configuration file
to 'z-ocsinventory-server.conf' ([y]/n) ?
OK, using 'z-ocsinventory-server.conf' as Communication Server Apache configuration file
Removing old communication server configuration to file /etc/apache2/conf-available/ocsinventory.conf
Writing communication server configuration to file /etc/apache2/conf-available/z-ocsinventory-server.conf

+----------------------------------------------------------+
| OK, Communication server setup sucessfully finished ;-) |
| |
| Please, review /etc/apache2/conf-available/z-ocsinventory-server.conf
| to ensure all is good. Then restart Apache daemon. |
+----------------------------------------------------------+

Do you wish to setup Administration Server (Web Administration Console)
on this computer ([y]/n)?

+----------------------------------------------------------+
| Checking for Administration Server directories... |
+----------------------------------------------------------+

CAUTION: Setup now install files in accordance with Filesystem Hierarchy
Standard. So, no file is installed under Apache root document directory
(Refer to Apache configuration files to locate it).
If you're upgrading from OCS Inventory NG Server 1.01 and previous, YOU
MUST REMOVE (or move) directories 'ocsreports' and 'download' from Apache
root document directory.
If you choose to move directory, YOU MUST MOVE 'download' directory to
Administration Server writable/cache directory (by default
/var/lib/ocsinventory-reports), especialy if you use deployement feature.

Do you wish to continue ([y]/n)?
Assuming directories 'ocsreports' and 'download' removed from
Apache root document directory.

Where to copy Administration Server static files for PHP Web Console
[/usr/share/ocsinventory-reports] ?
OK, using directory /usr/share/ocsinventory-reports to install static files ;-)

Where to create writable/cache directories for deployement packages,
administration console logs, IPDiscover [/var/lib/ocsinventory-reports] ?
OK, writable/cache directory is /var/lib/ocsinventory-reports ;-)

+----------------------------------------------------------+
| Checking for required Perl Modules... |
+----------------------------------------------------------+

Checking for DBI PERL module...
Found that PERL module DBI is available.
Checking for DBD::mysql PERL module...
Found that PERL module DBD::mysql is available.
Checking for XML::Simple PERL module...
Found that PERL module XML::Simple is available.
Checking for Net::IP PERL module...
Found that PERL module Net::IP is available.

+----------------------------------------------------------+
| Installing files for Administration server... |
+----------------------------------------------------------+

Creating PHP directory /usr/share/ocsinventory-reports/ocsreports.
Copying PHP files to /usr/share/ocsinventory-reports/ocsreports.
Fixing permissions on directory /usr/share/ocsinventory-reports/ocsreports.
Creating database configuration file /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php.
Creating IPDiscover directory /var/lib/ocsinventory-reports/ipd.
Fixing permissions on directory /var/lib/ocsinventory-reports/ipd.
Creating packages directory /var/lib/ocsinventory-reports/download.
Fixing permissions on directory /var/lib/ocsinventory-reports/download.
Creating Administration server log files directory /var/lib/ocsinventory-reports/logs.
Fixing permissions on directory /var/lib/ocsinventory-reports/logs.
Creating Administration server scripts log files directory /var/lib/ocsinventory-reports/scripts.
Fixing permissions on directory /var/lib/ocsinventory-reports/scripts.
Configuring IPDISCOVER-UTIL Perl script.
Installing IPDISCOVER-UTIL Perl script.
Fixing permissions on IPDISCOVER-UTIL Perl script.
Writing Administration server configuration to file /etc/apache2/conf-available/ocsinventory-reports.conf

+----------------------------------------------------------+
| OK, Administration server installation finished ;-) |
| |
| Please, review /etc/apache2/conf-available/ocsinventory-reports.conf
| to ensure all is good and restart Apache daemon. |
| |
| Then, point your browser to http://server//ocsreports
| to configure database server and create/update schema. |
+----------------------------------------------------------+

Setup has created a log file /home/user/OCSNG_UNIX_SERVER-2.0.5/ocs_server_setup.log. Please, save this file.
If you encounter error while running OCS Inventory NG Management server,
we can ask you to show us his content !

DON'T FORGET TO RESTART APACHE DAEMON !

Enjoy OCS Inventory NG ;-)

#Puis redémarrer Apache
service apache2 restart


Dans WinSCP : créer dans /etc/apache2/conf-enabled le lien suivant :
Fichier Lien/Raccourci : ocsinventory-reports.conf
Choisir le lien/raccourci : ../conf-available/ocsinventory-reports.conf
Attention a ne pas doubler les ".." au début du raccourci.
Après validation de la création du lien, si la petite flèche du lien est rouge, le lien est faux. revérifier la syntaxe.

Idem avec z-ocsinventory-server.conf

Dans z-ocsinventory-server.conf, commentez ceci :

# Web service apache settings
#PerlModule Apache::Ocsinventory::SOAP

#
# SetHandler perl-script
# PerlHandler "Apache::Ocsinventory::SOAP"
#
# # By default, you can query web service from everywhere with a valid user
# Order deny,allow
# Allow from all
# AuthType Basic
# AuthName "OCS Inventory SOAP Area"
# # Use htpasswd to create/update soap-user (or another granted user)
# AuthUserFile "APACHE_AUTH_USER_FILE"
# require "SOAP_USER"
#

service apache2 restart


Maintenant, votre site est accessible via navigateur à l'URL :
http://Mon_IP/ocsreports

Il faut ici mettre un login et un mdp, pour le nom de base et le hostname, on touche à rien.
Perso, j'ai mis root et son mdp (attention, le root MySql, pas le root de l'OS)

S'en suit une page ou il y a juste à valider sur le bouton gris en bas de page.
Puis on nous indique que le login mdp par défaut d'OcsReport est admin/admin

Publicité
Publicité
Des guides, des tutos
  • Quelques guides informatiques variés, pour les novices et les plus calés. N'hésitez pas à laisser des commentaires, si vous voyez des corrections ou des améliorations à apporter, vous êtes les bienvenus !
  • Accueil du blog
  • Créer un blog avec CanalBlog
Publicité
Archives
Publicité