Installing OCS Inventory NG on NixOS Latest
This tutorial outlines the steps for installing OCS Inventory NG on NixOS Latest. OCS Inventory NG is a free and open-source computer and software inventory system.
Prerequisites
Before proceeding with the installation, you need to ensure that your NixOS Latest system is up-to-date and that the following packages are installed:
gitnginxphp
Installation
- Clone the OCS Inventory NG repository
git clone --depth 1 https://github.com/OCSInventory-NG/OCSInventory-ocsreports.git
- Move the cloned folder to the
nginxdirectory
mv OCSInventory-ocsreports /var/www/ocsinventory
- Change the ownership of the
ocsinventoryfolder towww-data
chown www-data:www-data /var/www/ocsinventory -R
- Configure
nginxfor OCS Inventory NG by creating a new server block
nano /etc/nginx/sites-available/ocsinventory.conf
- Add the following configuration to the file:
server {
listen 80;
server_name inventory.localhost;
root /var/www/ocsinventory/ocsreports;
access_log /var/log/nginx/access.OCS.log;
error_log /var/log/nginx/error.OCS.log;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* \.(php)$ {
include fastcgi_params;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
Save and exit the file.
Create a symbolic link to enable the new server block configuration.
ln -s /etc/nginx/sites-available/ocsinventory.conf /etc/nginx/sites-enabled/ocsinventory.conf
- Restart
nginx
systemctl restart nginx.service
- Start
php-fpm
systemctl start php-fpm.service
- Navigate to
http://inventory.localhostin your web browser to access OCS Inventory NG.
Congratulations! You have successfully installed OCS Inventory NG on your NixOS Latest system.