OCS Server installation on Ubuntu-24.04

OCS Inventory NG Setup on Ubuntu 24.04

1. System Update & Package Installation

sudo apt update && sudo apt upgrade -y
sudo apt install apache2 mysql-server php php-mysql libapache2-mod-php php-xml php-zip php-curl php-cli php-gd php-mbstring wget unzip build-essential perl libdbi-perl libdbd-mysql-perl libapache2-mod-perl2 libapache-dbi-perl libxml-simple-perl libnet-ip-perl libarchive-zip-perl libmojolicious-perl libswitch-perl libplack-perl -y
sudo cpan Apache::DBI XML::Simple Net::IP Archive::Zip Mojolicious::Lite Switch Plack::Handler

===
2. Create MySQL Database

sudo mysql
CREATE DATABASE ocs_db;
CREATE USER ocs_user@localhost IDENTIFIED BY 'password';
GRANT ALL ON ocs_db.* TO ocs_user@localhost;
FLUSH PRIVILEGES;
exit
===
3. Download and Extract OCS Inventory

OCS Inventory Link:  : https://ocsinventory-ng.org/?page_id=1548&lang=en

wget https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.12.3/OCSNG_UNIX_SERVER-2.12.3.tar.gz
tar -xvzf OCSNG_UNIX_SERVER-2.12.3.tar.gz
cd OCSNG_UNIX_SERVER-2.12.3
====
4. Configure OCS Setup

sudo vi setup.sh
# Update DB_SERVER_USER and DB_SERVER_PASSWORD
sudo ./setup.sh

===
5. Apache Configuration

cd /etc/apache2/conf-available/
# Create symlink as required

Update - dbname , dbuser, dbpassword in 
/etc/apache2/conf-available/z-ocsinventory-server.conf 
/etc/apache2/conf-available/zz-ocsinventory-restapi.conf

then

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 -sf /etc/apache2/conf-available/zz-ocsinventory-restapi.conf /etc/apache2/conf-enabled/zz-ocsinventory-restapi.conf

sudo chown -R www-data:www-data /var/lib/ocsinventory-reports
sudo systemctl restart apache2
===

6. Final Setup Access the OCS setup via:

http://Server_ip/ocsreports/install.php

===
Login:

    Username: admin
    Password: admin

# increass database size:

sudo vi /etc/php/8.3/apache2/php.ini

upload_max_filesize = 2048M
post_max_size = 3000M

Agent installtion -

update only http://ocsinventory with server IP
specify TAG and activate verbose mode 

Article Details

Article ID:
12
Category:
Rating :