How to install OCS Inventory NG on Clear Linux

OCS Inventory NG is a free and open-source inventory and asset tracking software used for automatic inventory and software deployment. In this tutorial, we will guide you on how to install OCS Inventory NG on the latest version of Clear Linux.

Prerequisites

  1. Clear Linux latest version installed on your system
  2. A user account with sudo privileges
  3. Updated system packages

Step 1: Install Apache Web Server

OCS Inventory NG requires an Apache web server to function. To install Apache web server on Clear Linux, run the following command:

sudo swupd bundle-add apache

Step 2: Install PHP and PHP modules

Next, we need to install PHP and PHP modules to run OCS Inventory NG on Clear Linux. Run the following command to install PHP and required PHP modules:

sudo swupd bundle-add php-basic php-apache

Step 3: Install MariaDB

OCS Inventory NG stores its data in a database. Hence, we need to install MariaDB on Clear Linux to create a database for OCS Inventory NG. Run the following command to install MariaDB:

sudo swupd bundle-add mariadb-server

Step 4: Create a database for OCS Inventory NG

Once you have installed MariaDB, we will create a new database for OCS Inventory NG. Connect to the MariaDB server using the following command:

sudo mysql -u root -p

Enter the MariaDB root password when prompted. Then, create a new database for OCS Inventory NG using the following command:

CREATE DATABASE ocsweb;

Next, create a new user and grant privileges to the newly created database using the following commands:

CREATE USER 'ocsuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON ocsweb.* TO 'ocsuser'@'localhost';
FLUSH PRIVILEGES;

Remember to replace password with a strong password for security reasons.

Step 5: Download and install OCS Inventory NG

Download the latest version of OCS Inventory NG from the official website using the following command:

sudo wget https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.9.2/OCSNG_UNIX_SERVER_2.9.2.tar.gz

Extract the downloaded file using the following command:

sudo tar -xzf OCSNG_UNIX_SERVER_2.9.2.tar.gz

Move the extracted folder to the Apache web server's document root directory using the following command:

sudo mv ocsreports/ /var/www/htdocs/

Change the ownership of the OCS Inventory NG folder to the Apache web server user using the following command:

sudo chown -R apache:apache /var/www/htdocs/ocsreports

Step 6: Configure OCS Inventory NG

We need to configure OCS Inventory NG before we can use it. Copy the sample configuration file using the following command:

sudo cp /var/www/htdocs/ocsreports/ocsreports.conf.dist /var/www/htdocs/ocsreports/ocsreports.conf

Edit the configuration file using the following command:

sudo nano /var/www/htdocs/ocsreports/ocsreports.conf

Replace the database settings with the following:

define('DB_NAME', 'ocsweb');
define('DB_USER', 'ocsuser');
define('DB_PASS', 'password');

Replace password with the password you set for the OCS user.

Step 7: Start the Apache and MariaDB Services

To start the Apache web server and MariaDB services, run the following commands:

sudo systemctl start httpd
sudo systemctl start mariadb

To ensure that these services start automatically at system boot, run the following commands:

sudo systemctl enable httpd
sudo systemctl enable mariadb

Step 8: Access OCS Inventory NG

Open a web browser and navigate to http://localhost/ocsreports/. You will see the OCS Inventory NG login page. Your OCS Inventory NG installation is now complete!

Conclusion

In this tutorial, we have shown you how to install OCS Inventory NG on Clear Linux. With this software installed, you can automatically inventory and track software assets within your organization. We hope you found this tutorial helpful!

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!