OCS Inventory NG is a powerful open-source inventory and asset management system for Windows and Linux based computers. In this tutorial, we will learn how to install OCS Inventory NG on FreeBSD latest version. The installation process requires some basic knowledge of the FreeBSD operating system and command line.
Before we start the installation process, we need to ensure that the following packages are installed on your FreeBSD system:
OCS Inventory NG uses MySQL as its default database. Hence, we need to create a new MySQL database and user for OCS Inventory NG.
To create a new database, open the MySQL console by typing the following command.
# mysql -u root -p
Enter the MySQL root password, and then run the following command to create a new database called ocsweb.
> CREATE DATABASE ocsweb CHARACTER SET utf8 COLLATE utf8_general_ci;
Next, we need to create a new MySQL user and grant full access to the newly created database. Run the following commands to create a new user called ocsuser
with the password 'ocsuserpassword'.
> CREATE USER 'ocsuser'@'localhost' IDENTIFIED BY 'ocsuserpassword';
> GRANT ALL PRIVILEGES ON ocsweb.* TO 'ocsuser'@'localhost';
> FLUSH PRIVILEGES;
We can download the latest version of OCS Inventory NG from the official website or use the following command to download it directly on the FreeBSD system.
# fetch https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.8/OCSNG_UNIX_SERVER_2.8.tar.gz
Extract the downloaded archive to the /usr/local/bin
directory using the following command:
# tar -xzvf OCSNG_UNIX_SERVER_2.8.tar.gz -C /usr/local/bin
Navigate to the /usr/local/bin/OCSNG_UNIX_SERVER_2.8
directory and execute the installation script using the following command:
# cd /usr/local/bin/OCSNG_UNIX_SERVER_2.8/
# ./setup.sh
The script will ask some basic configuration questions. Follow the instructions given by the script to choose the database backend, database server name, and database username and password.
We need to configure the Apache webserver to serve the web interface of OCS Inventory NG. Open the Apache configuration file in your preferred text editor.
# vi /usr/local/etc/apache24/httpd.conf
Add the following lines at the bottom of the file:
Alias /ocsreports "/usr/local/bin/OCSNG_UNIX_SERVER_2.8/ocsreports"
<Directory "/usr/local/bin/OCSNG_UNIX_SERVER_2.8/ocsreports">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Save and close the file.
We are now ready to start the Apache webserver and the OCS Inventory NG service.
Start the Apache webserver using the following command:
# /usr/local/etc/rc.d/apache24 start
Start the OCS Inventory NG service using the following command:
# service ocsinventory-ng start
Open a web browser and enter the following URL.
http://localhost/ocsreports
Now, you should be able to access the OCS Inventory NG web interface. Login using admin as the username and password.
Congratulations! You have successfully installed and configured OCS Inventory NG on FreeBSD latest version. You can now use this inventory and asset management system to manage your IT infrastructure efficiently.
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!