0% found this document useful (0 votes)
24 views3 pages

Guia Ocs Server

The document provides instructions to install OCSinventory-Server and its dependencies on a Linux server. It includes steps to install LAMP stack (Apache, MariaDB, PHP), configure PHP, install required Perl modules, set up the MySQL database, clone the OCSinventory GitHub repositories, run the setup script, configure Apache virtual hosts, and restart services. The final steps are to access the web panel to complete configuration and set environment variables for the database credentials.

Uploaded by

maxofficer9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views3 pages

Guia Ocs Server

The document provides instructions to install OCSinventory-Server and its dependencies on a Linux server. It includes steps to install LAMP stack (Apache, MariaDB, PHP), configure PHP, install required Perl modules, set up the MySQL database, clone the OCSinventory GitHub repositories, run the setup script, configure Apache virtual hosts, and restart services. The final steps are to access the web panel to complete configuration and set environment variables for the database credentials.

Uploaded by

maxofficer9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Comandos para instalar OCSserver.

- sudo apt update


- sudo apt upgrade -y
- sudo apt install make cmake gcc git curl -y

___________________________________________________________________________________
____
Instalar LAMP (Apache, MariaDB, PHP)

APACHE
- sudo apt install apache2 -y
- sudo systemctl status apache2 (Ver estatus de Apache)
- sudo systemctl enable apache2
- sudo ufw allow http
- sudo ufw enable
- sudo ufw status numbered (Ver estatus del puerto)
- Ingresar la ip del servidor en el navegador para testeo de apache2

PHP
- sudo apt install php libapache2-mod-php php-mysql php-cli php-gd -y
- php -v (Ver version de PHP)
- sudo apt install vim -y
- sudo nano /etc/apache2/mods-enabled/dir.conf
- sudo nano /var/www/html/test.php
Agregar la siguiente informacion en el archivo:
<?php
phpinfo();
?>
- sudo systemctl restart apache2

MariaDB
- sudo apt install mariadb-server mariadb-client -y
- sudo systemctl status mariadb (Ver estatus de MariaDB)
- sudo systemctl enable mariadb
- sudo mysql_secure_installation
*Enter
*Enter
Password MariaDB: Spmgroup2021.
*Enter
*Enter
*Enter
*Enter
- sudo mysql -uroot -p

___________________________________________________________________________________
____

- sudo nano /etc/php/7.4/apache2/php.ini


Modificar las siguientes lineas:
*Line 187: short_open_tag = On
*Line 388: max_execution_time = 360
*Line 409: memory_limit = 256m
*Line 694: post_max_size = 100m
*Line 837: file_uploads = On
*Line 846: upload_max_filesize = 100m
*Line 962: data.timezone: America/Caracas

- sudo apt install -y libapache2-mod-perl2 libapache-dbi-perl libapache-db-perl


libapache2-mod-php php-zip php-pclzip php-gd php-soap php-curl php-json php-
mbstring php-xml
- sudo apt install -y perl libxml-simple-perl libcompress-zlib-perl libdbi-perl
libdbd-mysql-perl libnet-ip-perl libsoap-lite-perl libio-compress-perl libapache-
dbi-perl libapache2-mod-perl2 libapache2-mod-perl2-dev

- sudo perl -MCPAN -e 'install Apache2::SOAP'


*Enter
- sudo perl -MCPAN -e 'install XML::Entities'
- sudo perl -MCPAN -e 'install Net::IP'
- sudo perl -MCPAN -e 'install Apache::DBI'
- sudo perl -MCPAN -e 'install Mojolicious'
- sudo perl -MCPAN -e 'install Switch'
- sudo perl -MCPAN -e 'install Plack::Handler'
- sudo perl -MCPAN -e shell
*install Archive::Zip
*install Parse::EDID
*install Compress::Zlib

- sudo mysql -uroot -p


*Ingresar contraseña: Spmgroup2021.
*create database ocsdb;
*create user ocsuser@localhost identified by 'ocspwd';
*grant all on ocsdb.* to ocsuser@localhost;
*flush privileges;

- cd /opt/

- sudo git clone https://github.com/OCSInventory-NG/OCSInventory-Server.git


- cd /opt/OCSInventory-Server/
- ls
- sudo git clone https://github.com/OCSInventory-NG/OCSInventory-ocsreports.git
ocsreports
- ls
- cd ocsreports/
- curl -sS https://getcomposer.org/installer | sudo php --
--install-dir=/usr/local/bin --filename=composer
- sudo composer install
- sudo nano setup.sh
*DB_SERVER_USER="ocsuser"
*DB_SERVER_PWD="ocspwd"

- sudo ./setup.sh
*Enter all time

- sudo ln -s /etc/apache2/conf-available/ocsinventory-reports.conf
/etc/apache2/conf-enabled/ocsinventory-reports.conf
- sudo ln -s /etc/apache2/conf-available/z-ocsinventory-server.conf
/etc/apache2/conf-enabled/z-ocsinventory-server.conf
- sudo ln -s /etc/apache2/conf-available/zz-ocsinventory-restapi.conf
/etc/apache2/conf-enabled/zz-ocsinventory-restapi.conf

- ls /etc/apache2/conf-enabled/
- sudo chown -R www-data:www-data /var/lib/ocsinventory-reports
- sudo systemctl restart apache2

Ingresar al panel web http://192.168.192.129/ocsreports/install.php


Configurar el OCS-NG Inventory
MySQL Login: ocsuser
MySQL Password: ocspwd
Name of Database: ocsdb
MySQL HostName: localhost

Dar en Send y terminar de configurar.

Renombrar el siguiente archivo ingresando en


cd /usr/share/ocsinventory-reports/ocsreports
- ls
- Renombrar o eliminar "install.php"
sudo mv install.php /usr/share/ocsinventory-reports/install.php.bak
- ls (Verificar archivo)
- sudo systemctl restart apache2
- cd /etc/apache2/conf-available
- sudo nano z-ocsinventory-server.conf
*PerlSetEnv OCS_DB_NAME ocsdb
*PerlSetEnv OCS_DB_LOCAL ocsdb
*PerlSetEnv OCS_DB_USER ocsuser
*PerlSetEnv OCS_DB_PWD ocspwd

- sudo nano zz-ocsinventory-restapi.conf


*$ENV{OCS_DB_LOCAL} = 'ocsdb';
*$ENV{OCS_DB_USER} = 'ocsuser';
*$ENV{OCS_DB_PWD} = 'ocspwd';

- sudo systemctl restart apache2

You might also like