NOTE<\/strong>: As much there is no support for Ubuntu 22.04 on the APT repository, the repos for Ubuntu 20.04 should still be able to work.<\/p>\n\n\n\nThus, to install the OCS APT repository on Ubuntu 22.04\/Ubuntu 20.04;<\/p>\n\n\n\n
Install the Repository signing key;<\/p>\n\n\n\n
apt install gnupg2 curl wget -y<\/code><\/pre>\n\n\n\ncurl -sS http:\/\/deb.ocsinventory-ng.org\/pubkey.gpg | \\\ngpg --dearmor -o \/etc\/apt\/trusted.gpg.d\/ocs.gpg<\/code><\/pre>\n\n\n\nNext, install the repo itself;<\/p>\n\n\n\n
echo \"deb http:\/\/deb.ocsinventory-ng.org\/ubuntu\/ `lsb_release -sc` main\" | \\\ntee \/etc\/apt\/sources.list.d\/ocsinventory.list<\/code><\/pre>\n\n\n\nInstalling OCS Inventory Server on Ubuntu<\/h3>\n\n\n\n The use of the APT repository installed above ensures that some of the package dependencies required to setup OCS inventory server on Ubuntu installed.<\/p>\n\n\n\n
Run system package cache update;<\/p>\n\n\n\n
apt update<\/code><\/pre>\n\n\n\nBefore you can proceed, install some other required Perl module;<\/p>\n\n\n\n
apt install make<\/code><\/pre>\n\n\n\nperl -MCPAN -e 'install XML::Entities'<\/code><\/pre>\n\n\n\nWhen prompted, enter yes<\/strong> and press ENTER to proceed.<\/p>\n\n\n\nNext, install OCS Inventory server and web console; on Ubuntu;<\/p>\n\n\n\n
apt install ocsinventory<\/code><\/pre>\n\n\n\nUpdate OCS Inventory DB Connection Settings<\/h3>\n\n\n\n Open the Communication Server Apache configuration file and update the database connection details<\/p>\n\n\n\n
vim \/etc\/apache2\/conf-available\/z-ocsinventory-server.conf<\/code><\/pre>\n\n\n\n\n...\n<IfModule mod_perl.c>\n \n # Which version of mod_perl we are using\n # For mod_perl <= 1.999_21, replace 2 by 1\n # For mod_perl > 1.999_21, replace 2 by 2\n PerlSetEnv OCS_MODPERL_VERSION 2\n\n # Master Database settings\n # Replace localhost by hostname or ip of MySQL server for WRITE\n PerlSetEnv OCS_DB_HOST localhost<\/strong>\n # Replace 3306 by port where running MySQL server, generally 3306\n PerlSetEnv OCS_DB_PORT 3306<\/strong>\n # Name of database\n PerlSetEnv OCS_DB_NAME ocsng_db\n PerlSetEnv OCS_DB_LOCAL ocsng_db<\/strong>\n # User allowed to connect to database\n PerlSetEnv OCS_DB_USER ocsadmin<\/strong>\n # Password for user\n PerlSetVar OCS_DB_PWD ChangeME<\/strong>\n # SSL Configuration\n...\n<\/code><\/pre>\n\n\n\nSave and exit the configuration file when done.<\/p>\n\n\n\n
Next, update the database connection details on the API config;<\/p>\n\n\n\n
vim \/etc\/apache2\/conf-available\/zz-ocsinventory-restapi.conf<\/code><\/pre>\n\n\n\n\n...\n<Perl>\n $ENV{PLACK_ENV} = 'production';\n $ENV{MOJO_HOME} = '\/usr\/share\/perl5';\n $ENV{MOJO_MODE} = 'deployment';\n $ENV{OCS_DB_HOST} = 'localhost';\n $ENV{OCS_DB_PORT} = '3306';\n $ENV{OCS_DB_LOCAL} = 'ocsng_db';\n $ENV{OCS_DB_NAME} = 'ocsng_db';\n $ENV{OCS_DB_USER} = 'ocsadmin';\n $ENV{OCS_DB_PWD} = 'ChangeME';<\/strong>\n $ENV{OCS_DB_SSL_ENABLED} = 0;\n...\n<\/code><\/pre>\n\n\n\nSave and exit the file.<\/p>\n\n\n\n
Similarly, update the web console database connection settings;<\/p>\n\n\n\n
vim \/etc\/ocsinventory-reports\/dbconfig.inc.php<\/code><\/pre>\n\n\n\n\n<?php\n define(\"DB_NAME\", \"ocsng_db\");\n define(\"SERVER_READ\",\"localhost\");\n define(\"SERVER_WRITE\",\"localhost\");\n define(\"SERVER_PORT\",\"3306\");\n define(\"COMPTE_BASE\",\"ocsadmin\");\n define(\"PSWD_BASE\",\"ChangeMe\");<\/strong>\n define(\"ENABLE_SSL\",\"\");\n define(\"SSL_MODE\",\"\");\n define(\"SSL_KEY\",\"\");\n define(\"SSL_CERT\",\"\");\n define(\"CA_CERT\",\"\");\n ?>\n<\/code><\/pre>\n\n\n\nSave the changes and exit the file<\/p>\n\n\n\n
Update PHP Settings<\/h3>\n\n\n\n Edit the PHP php.ini<\/code><\/strong> to optimize certain settings for OSC best suited for your env.<\/p>\n\n\n\nvim \/etc\/php\/8.2\/apache2\/php.ini<\/code><\/pre>\n\n\n\nOCS recommends disabling max_execution_time<\/code> and max_input_time<\/code>by setting the following value:<\/p>\n\n\n\nmax_execution_time = -1\nmax_input_time = -1<\/code><\/pre>\n\n\n\nThese settings define the maximum life time of the script and the time that the script should spend in accepting input.<\/p>\n\n\n\n
Adjust file upload limit size:<\/p>\n\n\n\n
upload_max_filesize = 50M\npost_max_size = 50M<\/code><\/pre>\n\n\n\nAdditionally you can adjust size of memory for php engine.<\/p>\n\n\n\n
memory_limit = 256M<\/code><\/pre>\n\n\n\nSave and exit the file.<\/p>\n\n\n\n
Update OCS Configs Owership and Permissions<\/h3>\n\n\n\n Set the proper permissions and ownership of OCS configuration files.<\/p>\n\n\n\n
chmod -R 766 \/usr\/share\/ocsinventory-reports<\/code><\/pre>\n\n\n\nchown -R www-data:www-data \/usr\/share\/ocsinventory-reports \\\n\/var\/lib\/ocsinventory-reports<\/code><\/pre>\n\n\n\nDisable default Apache site;<\/p>\n\n\n\n
a2dissite 000-default.conf<\/code><\/pre>\n\n\n\nRestart Apache and MariaDB.<\/p>\n\n\n\n
systemctl restart apache2 mariadb<\/code><\/pre>\n\n\n\nFinalize OCS-NG Configuration via Web Interface<\/h3>\n\n\n\n If there is a firewall in place, open web ports to allow external access to OCS inventory web console.<\/p>\n\n\n\n
Navigate to http:\/\/server-hostname-or-IP\/ocsreports<\/code> on your browser to access OCS.<\/p>\n\n\n\nConfigure OCS Inventory database connection details and click Send.<\/strong><\/p>\n\n\n\n <\/figure>\n\n\n\nInstallation complete;<\/p>\n\n\n\n <\/figure>\n\n\n\nNext, click Click here to enter OCS-NG GUI<\/strong><\/em> to proceed.<\/p>\n\n\n\nIf prompted to perform database update, please do so and proceed to login page when update is done.<\/p>\n\n\n\n <\/figure>\n\n\n\nNext, click Click here to enter OCS-NG GUI<\/strong><\/em> to login to OCS web interface.<\/p>\n\n\n\nOCS Inventory Server Web Dashboard<\/h3>\n\n\n\n Use the default credentials:<\/p>\n\n\n\n
\nlogin: admin<\/strong><\/em><\/li>\n\n\n\npassword: admin<\/strong><\/em><\/li>\n<\/ul>\n\n\n\n <\/figure>\n\n\n\nOCS Inventory server dashboard;<\/p>\n\n\n\n <\/figure>\n\n\n\nReset the password: Settings gear > My account > Password.<\/strong><\/p>\n\n\n\nRemove the installation script.<\/p>\n\n\n\n
mv \/usr\/share\/ocsinventory-reports\/ocsreports\/install.php{,.old}<\/code><\/pre>\n\n\n\nThat marks the end of our guide on how to install OCS NG Inventory server on Ubuntu 22.04\/Ubuntu 20.04.<\/p>\n\n\n\n
Reference: OCS Inventory Documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"In this tutorial, you will learn how to install OCS Inventory Server on Ubuntu 22.04\/Ubuntu 20.04. OCS (Open Computers and Software Inventory Next Generation) is<\/p>\n","protected":false},"author":10,"featured_media":11497,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,984,1094],"tags":[7102,7101,7098,1096,7099,7100],"class_list":["post-18054","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-asset-management","category-ocs-inventory","tag-asset-manager-ubuntu","tag-install-ocs-server-ubuntu","tag-install-ocs-server-ubuntu-22-04","tag-ocs-inventory","tag-ocs-inventory-server-ubuntu-22-04","tag-ubuntu-22-04-ocs-ng-inventory-server","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/18054"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=18054"}],"version-history":[{"count":7,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/18054\/revisions"}],"predecessor-version":[{"id":20809,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/18054\/revisions\/20809"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/11497"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=18054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=18054"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=18054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}