Skip to main content

How to Setup OCS Inventory Server on Ubuntu



 Installation Steps:

Install Dependency packages

apt install make cmake gcc make libapache2-mod-perl2 libapache-dbi-perl libapache-db-perl libapache2-mod-php 

Edit PHP configuration

nano /etc/php/7.2/apache2/php.ini

file_uploads = On

allow_url_fopen = On

short_open_tag = On

memory_limit = 256M

upload_max_filesize = 100M

max_execution_time = 360

date.timezone = America/Chicago

Mysql Database setup

CREATE DATABASE ocs;

CREATE USER 'ocsuser'@'localhost' IDENTIFIED BY 'password';

GRANT ALL ON ocs.* TO 'ocsuser'@'localhost' WITH GRANT OPTION;

FLUSH PRIVILEGES;

EXIT;

Install and Enable Perl Modules

apt -y install 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

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

perl -MCPAN -e 'install XML::Entities'

perl -MCPAN -e 'install Net::IP'

perl -MCPAN -e 'install Apache::DBI'

perl -MCPAN -e 'install Mojolicious'

perl -MCPAN -e 'install Switch'

perl -MCPAN -e 'install Plack::Handler'

Download OCSInventory-NG  and ocsreports packages

apt install git curl

cd /tmp

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

cd OCSInventory-Server

git clone https://github.com/OCSInventory-NG/OCSInventory-ocsreports.git ocsreports

cd /tmp/OCSInventory-Server/ocsreports

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

sudo composer install

cd .. 

Edit setup.sh file

nano setup.sh

 This code is open source and may be copied and modified as long as the source

# code is always made freely available.

# Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt

################################################################################

#

# Which host run database server

DB_SERVER_HOST="localhost"

# On which port run database server

DB_SERVER_PORT="3306"

# Database server credentials

DB_SERVER_USER="ocsuser"

DB_SERVER_PWD="password"

# Where is Apache daemon binary (if empty, will try to find it)

APACHE_BIN=""

# Where is Apache configuration file (if empty, will try to find it)

Run setup file

./setup.sh

Add Soft links

ln -s /etc/apache2/conf-available/ocsinventory-reports.conf /etc/apache2/conf-enabled/ocsinventory-reports.conf

ln -s /etc/apache2/conf-available/z-ocsinventory-server.conf /etc/apache2/conf-enabled/z-ocsinventory-server.conf

ln -s /etc/apache2/conf-available/zz-ocsinventory-restapi.conf /etc/apache2/conf-enabled/zz-ocsinventory-restapi.conf

Change ownership

chown -R www-data:www-data /var/lib/ocsinventory-reports

systemctl restart apache2.service

Open browser and access below URL

http://ipaddress/ocsreports/install.php

After configuration is done and logging in, rename below file.

mv /usr/share/ocsinventory-reports/ocsreports/install.php /usr/share/ocsinventory-reports/ocsreports/install.php.bak

Comments

Popular posts from this blog

VMware Features-Part 1

In this video i have discussed about VMware ESXi,VMware ESX,VMkernel,VMware vCenter Server,Advanced Features,vCenter Server packages,vSphere Update Manager,VMware vSphere Web Client and vSphere Desktop Client.
LAPSTER HDMI Switch Splitter, 2 Port Bi-Directional Manual HDMI Switch 2 in 1 Out or 1 in 2 Out Splitter Supports 4K 2K 3D Full HD 1080p - 1 Year Warranty