<<<<<<< CURRENT_FILE

Instalación de OCSInventory Server en Linux. (Lado del Servidor) Vers. 2.0

======= DIFF_SEP_EXPLAIN

Instalación de OCSInventory Server en Linux. (Lado del Servidor) Vers. 2.0

>>>>>>> NEW_FILE
Foro destinado a la explicación de como instalar OCSInventory en linux

Moderador:Jaibol Santaella

Jaibol Santaella
Mensajes:297
Registrado:Mar Mar 17, 2015 8:28 am
Contactar:
Instalación de OCSInventory Server en Linux. (Lado del Servidor) Vers. 2.0

Mensaje por Jaibol Santaella » Jue Abr 27, 2017 12:30 pm

Open Computer and Software Inventory Next Generation (OCS) es un software libre que permite a los usuarios administrar el inventario de sus activos de TI.

A igual que GLPI es una herramienta muy útil si deseamos tener un registro de nuestros equipos, su código esta basado en el lenguaje de programación perl y hoy explicaré como instalarlo en un equipo con cualquier distribución Linux.

OCS puede utilizarse para visualizar el inventario a través de una interfaz web. Además, OCS comprende la posibilidad de implementación de aplicaciones en los equipos de acuerdo a criterios de búsqueda. Además, tiene muchas opciones más como escanear la red por medio del IPDiscovery, o instalar aplicaciones remotamente creando Builds

Es necesario que tengamos instalado Apache2, Php5 y Mysql . <------ Click sobre ellos para recordar como instalarlos.

Pero también requerimos unos módulos de Perl en nuestro apache2 y las librería correspondientes de perl.

Instalamos Apache2-perl para poder comunicar nuestras aplicaciones en nuestro servidor Apache2

Código: Seleccionar todo

 aptitude install   libapache2-mod-perl2 libapache-dbi-perl 

Código: Seleccionar todo

  aptitude install apache2 apache2-doc 
Instalamos las librerias Perl para integrar Mysql

Código: Seleccionar todo

 aptitude install libdbd-mysql-perl  
Instalamos otras librerías de Perl

Código: Seleccionar todo

 aptitude install  libxml-simple-perl libcompress-zlib-perl libdbi-perl  libnet-ip-perl 

Código: Seleccionar todo

  aptitude install  xmlformat-perl 

Código: Seleccionar todo

  aptitude install libphp-pclzip

Código: Seleccionar todo

 aptitude install libnet-ip-perl

Código: Seleccionar todo

 aptitude install libxml-simple-perl libcompress-zlib-perl libdbi-perl libdbd-mysql-perl libapache-dbi-perl libnet-ip-perl libsoap-lite-perl

Instalamos la Biblioteca de C de GNU

Código: Seleccionar todo

 aptitude install libc6-dev

Editamos el archivo de configuración de Apache2

Código: Seleccionar todo

 nano /etc/apache2/apache2.conf 
Agregamos el nombre de tu hostname en la ultima linea del archivo apache2.conf

Ejemplo;

Código: Seleccionar todo

 ServerName mi-equipo 
Si deseas saber cual es tu hostname sólo tienes que editar:

Código: Seleccionar todo

 nano /etc/hostname 

Reiniciamos Apache2

Código: Seleccionar todo

 /etc/init.d/apache2 restart 

Abrimos el Terminal de Perl

Código: Seleccionar todo

 sudo perl -MCPAN -e shell 
Una vez dentro del terminal Perl necesitamos realizar cuatro (4) Instalaciones

CPAN>

Instalamos SOAP Apache

Código: Seleccionar todo

 install SOAP::Lite 

Código: Seleccionar todo

 install SOAP::Apache 


Ahora instalamos el paquete XML::Entities

Código: Seleccionar todo

  install XML::Entities 

Código: Seleccionar todo

 install Archive::Zip 
Durante la instalación te encontraras con algo similar a esto:

Código: Seleccionar todo

Running install for module 'XML::Entities'
Fetching with LWP:
http://www.cpan.org/authors/id/S/SI/SIXTEASE/XML-Entities-1.0002.tar.gz
Fetching with LWP:
http://www.cpan.org/authors/id/S/SI/SIXTEASE/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/S/SI/SIXTEASE/XML-Entities-1.0002.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE
Configuring S/SI/SIXTEASE/XML-Entities-1.0002.tar.gz with Build.PL
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'XML-Entities' version '1.0002'
  SIXTEASE/XML-Entities-1.0002.tar.gz
  /usr/bin/perl Build.PL --installdirs site -- OK
Running Build for S/SI/SIXTEASE/XML-Entities-1.0002.tar.gz
Building XML-Entities
  SIXTEASE/XML-Entities-1.0002.tar.gz
  ./Build -- OK
Running Build test
t/00-xml-entities-data.t .. ok   
t/01-xml-entities.t ....... ok   
t/02-unicode.t ............ ok   
All tests successful.
Files=3, Tests=21,  2 wallclock secs ( 0.02 usr  0.01 sys +  2.20 cusr  0.01 csys =  2.24 CPU)
Result: PASS
  SIXTEASE/XML-Entities-1.0002.tar.gz
  ./Build test -- OK
Running Build install
Building XML-Entities
Installing /usr/local/man/man1/download-entities.pl.1p
Installing /usr/local/share/perl/5.20.2/XML/Entities.pm
Installing /usr/local/share/perl/5.20.2/XML/Entities/Data.pod
Installing /usr/local/share/perl/5.20.2/XML/Entities/Data.pm
Installing /usr/local/man/man3/XML::Entities::Data.3pm
Installing /usr/local/man/man3/XML::Entities.3pm
Installing /usr/local/bin/download-entities.pl
  SIXTEASE/XML-Entities-1.0002.tar.gz
  ./Build install  -- OK



Tenga en cuenta que si usted está instalando OCS Inventory y Mysql Server en equipos distintos debe realizar la siguiente adecuación en el servidor de base de datos MySQL

Ejecute el siguiente comando

Código: Seleccionar todo

 GRANT ALL PRIVILEGES ON *.* TO $user@$$ip_servidor IDENTIFIED BY '$senha' WITH GRANT OPTION;
Para permitir el acceso remoto a la base de datos, también necesitará comentar la siguiente línea en /etc/mysql/my.cnf en su servidor de Mysql-Server

Antes:

Código: Seleccionar todo

  bind-address           = 127.0.0.1 
Después:

Código: Seleccionar todo

 # bind-address           = 127.0.0.1 
Descargamos OCSInventory-Server

Código: Seleccionar todo

 wget https://github.com/OCSInventory-NG/OCSInventory-Server/archive/master.zip  

Click Aquí para descargar otra versión.

Descomprimimos:

Código: Seleccionar todo

 unzip master.zip 
Ingresamos al directorio generado:

Código: Seleccionar todo

 cd OCSInventory-Server-master 
Para evitar generar errores más adelante es necesario antes de iniciar la instalación descargar dentro del directorio OCSInventory-Server el OCSInventory-ocsreports

Descargue el comprimido de OCSInventory-ocsreports estando dentro del directorio OCSInventory-Server-master

Código: Seleccionar todo

  wget https://github.com/OCSInventory-NG/OCSInventory-ocsreports/archive/master.zip 
Descomprima

Código: Seleccionar todo

 unzip master.zip  
Renombre el directorio generado con el nombre ocsreports

Código: Seleccionar todo

 mv OCSInventory-ocsreports-master ocsreports 



Continúe con la instalación de OCS Server.

En la carpeta raíz de OCSInventory-Server-master se encuentra el Script instalador, por lo que deberá ejecutar el archivo de nombre setup.sh :


Iniciamos la Instalación

Código: Seleccionar todo

 sh setup.sh 

Código: Seleccionar todo

 
 
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)?

Presione la letra y luego presione Enter

Código: Seleccionar todo

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

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

Which host is running database server [localhost] ?
Debe indicar la ip del servidor de Base de Datos, en caso de una instalación local escriba localhost o presione Enter

Código: Seleccionar todo

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

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

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

On which port is running database server [3306]   
Presione Enter

Código: Seleccionar todo

 

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

Where is Apache daemon binary [/usr/sbin/apache2ctl] ?
 
Presione Enter

Código: Seleccionar todo

 Where is Apache main configuration file [/etc/apache2/apache2.conf] ?
 
Presione Enter

Código: Seleccionar todo

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

Which user account is running Apache web server [www-data] ?

 
Presione Enter

Código: Seleccionar todo

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

Which user group is running Apache web server [www-data] ?


 
Presione Enter

Código: Seleccionar todo

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

Código: Seleccionar todo

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

Found PERL Intrepreter at </usr/bin/perl> ;-)
Where is PERL Intrepreter binary [/usr/bin/perl] ?
 
Presione Enter

Código: Seleccionar todo

Do you wish to setup Communication server on this computer ([y]/n)? 
Escriba la letra y Presione Enter

Código: Seleccionar todo

 Where to put Communication server log directory [/var/log/ocsinventory-server] ?
 
Presione Enter

Código: Seleccionar todo

 +----------------------------------------------------------------------------+
|    Checking for Communication server plugins configuration directory...    |
+----------------------------------------------------------------------------+

Communication server need a directory for plugins configuration files. 
Where to put Communication server plugins configuration files [/etc/ocsinventory-server/plugins] ?
 
Presione Enter




El siguiente mensaje indica que su instalación fue realizada satisfactoriamente.

Código: Seleccionar todo

  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 /ruta-de-su-Instalación/OCSInventory-Server-master/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 ;-)


Reiniciamos el servicio de Apache2

Código: Seleccionar todo

service apache2 reload 

AHORA NOS TOCA MODIFICAR LA CONFIGURACIÓN DE NUESTRO SERVIDOR APACHE2

Vamos a crear un virtualhost para nuestro OCSinventory

Código: Seleccionar todo

 cd /etc/apache2/sites-available 

Generamos nuestro virtualhost OCSinventory

Código: Seleccionar todo

 touch ocsreports.conf 
Edite para agregar la siguiente información:

Código: Seleccionar todo

 nano ocsreports.conf 
Copie y pegue lo siguiente:

Código: Seleccionar todo

Alias / "/usr/share/ocsinventory-reports/ocsreports/" 
   <Directory "/usr/share/ocsinventory-reports/ocsreports/"> 
       Options Indexes MultiViews FollowSymLinks 
       AllowOverride None 
       Order allow,deny 
       Allow from all 
   </Directory> 
Activamos nuestro virtualhost

Código: Seleccionar todo

 a2ensite ocsreports.conf 
Reiniciamos nuestro servicio Apache2

Código: Seleccionar todo

 /etc/init.d/apache2 restart  

Editaremos el archivo de configuración de nuestro ocsreports

Código: Seleccionar todo

  nano  /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php 

agregamos la clave y el usuario de nuestra base de datos MySQL

Ejemplo:

Código: Seleccionar todo

<?php
 $_SESSION["SERVEUR_SQL"]="Dirección IP de MYSQL-SERVER";
 $_SESSION["COMPTE_BASE"]="$Usuario-de-la-BD-MYSQL";
 $_SESSION["PSWD_BASE"]="$Clave-de-MYSQL";
?>
Tenga en cuenta que si desea verificar la configuración de Ocsinventory en su servidor apache2 deberá editar ocsinventory-reports.conf

Código: Seleccionar todo

 nano /etc/apache2/conf-available/ocsinventory-reports.conf 

Cambiamos los permisos de ocsreports

Código: Seleccionar todo

chmod -R 777 /var/lib/ocsinventory-reports

Código: Seleccionar todo

chmod -R 777 /usr/share/ocsinventory-reports/ocsreports  

Ahora usted deberá abrir un navegador y colocar la ip del servidor Apache2 donde instaló ocsinventory

Ejemplo:

http://ip-servidors


Tenga en cuenta que si usted trabaja a modo local podrá escribir:

localhost

Ahora podrá iniciar la instalación de Ocsinventory Report en su servidor

Para ver más sobre la instalación de OCS-Report haga click aquí

Imagen
Fue útil este documento?,
Publica tus opiniones

Responder

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 1 invitado