OCS Inventory NG installation on NethServer 6.x

UPDATE 2015-08-25
The package nethserver-ocsinventory is now available from nethserver-updates repository. To install it type:

  yum install nethserver-ocsinventory

Now you have to use NethServer admin credentials to access OCS web interface!

OCS Inventory NG is a powerful technical management solution of IT assets.

Here is how to install OCS on NethServer, using the great work done by Remi (source: http://blog.famillecollet.com/post/2014/02/14/OCS-Inventory-NG-2.1-en)

Here you can find all the documentation: http://wiki.ocsinventory-ng.org/index.php/Documentation:Main

  1. Install prerequisites for NethServer:

    yum install nethserver-httpd nethserver-mysql nethserver-samba -y

  2. Install and disable additional repos (to prevent unwanted updates):

    rpm -ihv http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    rpm -ihv http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    sed -i ā€˜s/enabled=1/enabled=0/ā€™ /etc/yum.repos.d/epel.repo

  3. Install requested additional packages:

    yum --enablerepo=epel install php-gd php-imap php-ldap php-mbstring php-mysql php-pear-CAS -y

  4. Install OCS packages:

    yum --enablerepo=epel,remi install ocsinventory -y

  5. Create and configure needed MySQL db:

    mysql -e ā€œcreate database ocsweb;
    grant all privileges on ocsweb.* to ā€˜ocsā€™@ā€˜localhostā€™
    identified by ā€˜ocspassā€™;
    flush privileges;ā€

  6. Populate db using OCS dump:

    mysql ocsweb < /usr/share/ocsinventory-reports/ocsreports/files/ocsbase_new.sql

  7. Edit ā€œocsinventory-server.confā€ file:

    vi /etc/httpd/conf.d/ocsinventory-server.conf

and modify db password you find at line 30:

...
PerlSetVar OCS_DB_PWD ocspass
...
  1. Create dbconfig.inc.php file:

    vi /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php

with the content below:

<?php
define("DB_NAME", "ocsweb");
define("SERVER_READ","localhost");
define("SERVER_WRITE","localhost");
define("COMPTE_BASE","ocs");
define("PSWD_BASE","ocspass");
?>
  1. Reload Apache with new parameters:

    service httpd reload

  2. As a good practice, rename installation script file:

    mv /usr/share/ocsinventory-reports/ocsreports/install.php
    /usr/share/ocsinventory-reports/ocsreports/install.php.ori

ā€¦done!

You can reach OCS Inventory NG using default url:

http://server.domain/ocsreports

and default credentials (admin/admin)

7 Likes

well doneā€¦iā€™ll try it in my development vm :smiley:

1 Like

1 Like

I moved 2 posts to an existing topic: Nethserver-adagios and nethserver-ocsinventory have been released

The agents are there

http://www.ocsinventory-ng.org/en/download/download-agent.html

Great job, a noob like me would never have done it so easily without your help, it would have taken hours to find the right informations. Iā€™ve just started using NethServer recently but I already like this user-friendly project.

Thanks to the whole NS team!

Ehi @FenyX
youā€™re welcome from whole NethServer Team! Can You tell us more about you?
Please introduce yourself here: Welcome to NethServer Community
How are you using these packages into your installation?

Hi Nicola.

At first, Iā€™ld like to suggest you to add a precision about the fact that the nethserver-ocsinventory package covers steps #1 to #8 of your installation guide, because this page became not so clear since its latest update in August. Maybe possible to divide tutorial in two parts? I mean one for Remiā€™s method and one through your nethserver-ocs bundleā€¦ Even if after successful tests I think that only your bundle should remain at the end, as long as itā€™s delivered with the right explanations. What do you think?

Secondly, Iā€™ve installed the new nethserver-ocsinventory package, then reloaded Apache service and renamed install.php as instructed. At the end of your guide itā€™s said that we can reach OCS using url http://server.domain/ocsreports. So Iā€™ve tried with NethServerā€™s local IP > http://192.168.0.x/ocsreports but it returns an Error 403 Forbidden page telling me that I donā€™t have permission to access /ocsreports.
When I try with https/SSL I see a pop-up titled ā€œNethServer LDAPā€ and it asks for authentication, of course admin/admin doesnā€™t work here. Note that OCS is installed on a fresh and clean NethServer VM, before adding OCS with yum I had only installed the nano text editor, the NS french language package and the latest updates from NS interface Software Manager.

During my investigations, Iā€™ve seen the following lines in /etc/httpd/conf.d/ocsinventory-reports.conf:

AuthName "NethServer LDAP"
AuthLDAPBindPassword same-strong-password-as-db
Require user admin

Iā€™ve tried again to access https://server_ip/ocsreports with user ā€œadminā€ and ā€œsame-strong-password-as-dbā€ for password but it didnā€™t work. And the user manual at OCS website also confirms that I should go to http://server/ocsreports as you instructed, not https. Wrong track.

Iā€™ve added an ā€œAllowOverride Optionsā€ line to ocsinventory-reports.conf as recommended here but it didnā€™t change the result, still 403 Forbidden page.

Iā€™ve also tried the ā€œsetenforce 0ā€ command to temporarily make SELinux protection permissive and check if SELinux could be the cause but it hasnā€™t fixed the Forbidden page.

Of course Iā€™ve restarted the httpd service after each try before testing again in my browser.

If I check the /var/log/httpd/error_log file I can see the following error:

[error] [client 192.168.0.x] access to /usr/share/ocsinventory-reports/ocsreports failed, reason: SSL connection required

But SSL access to /ocsreports still drives me to NethServer LDAP authentication popup. Now Iā€™m definitely lost. Iā€™ve imagined that it would be easier by doing it with this package, and indeed the automated installation was so simple. But Iā€™ve passed so much hours on this issueā€¦ it could mean itā€™s hard to fix or it could mean Iā€™m inefficient, lol.

Your full package installation on top of the guide followed by the full install instructions has been confusing me, but above all I had the impression that you did some changes in your new nethserver-ocsinventory package install process that you didnā€™t explain here (ie. ocspass replaced by a randomly generated strong password, or the absence of the usual OCS installation script ā€œsetup.shā€). I see also the Nethesis name on top of some OCS config files so I guess that the setup is customized in depth.

Iā€™m stuck at this issue, impossible to access /ocsreports, more because of my lack of web admin knowledge rather than a problem with your instructions, but the only thing Iā€™m sure about is that I need your help.

Iā€™m convinced that the fix will look so easy compared to all my efforts, as usual in this kind of situations :smile:

Hi FenyX,

I think you are making this too difficult for yourself! :slight_smile: Simply log in with your NethServer credentials.

I believe the admin/admin reference is for those that run through the process top to bottom without the aid of the package!

enjoy,
Nick

1 Like

Itā€™s one of the first things that Iā€™ve tried, of course. But thanks for the suggestion.

Because itā€™s a virtual machine I just reverted back to last snapshot before OCS installation then Iā€™ve tried again wihtout the new package today, only following ā€œoldā€ step-by-step instructions above. And Iā€™ve been successful at first try.

Some (maybe important) things are modified in the new bundle package compared to the instructions above, and I thought it could be interesting to understand how to make it work correctly, at least to get a final setup as reliable as the step-by-step method. I shouldnā€™t care about as Iā€™ve done it successfully now but future users will think the new package is simpler while itā€™s not: install process is more simple but user couldnā€™t access the ocsreports page at the end.

If you publish this package thinking itā€™s ready for end-users, some of them could be disappointed. Reporting logs and tests is not just to complain but to help fixing, itā€™s the meaning and goal of feedback :wink:

Edit: By the way, if youā€™ve read the Apache log Iā€™ve posted it says ā€œSSL connection requiredā€ while OCS guides everywhere precise http:// before the first connection URL. And when I follow step-by-step instructions above I also connect without SSL so it should work without.
Now if I go to https://ip/ocsreports it works too! Also routing me to OCS page. So why did the same https URL go yesterday to ā€œNethServer LDAPā€ login popup after having installed the new ā€˜nethserver-ocsinventoryā€™ package? No tracks of this LDAP things today when doing the step-by-step instructions. I have no answer, I just ask questions trying to be logical.

Hi FenyX,
i think iā€™ve not fully understood some of your installation stepsā€¦
iā€™ve re-tried installation on a clean 6.6 vm fully updated no packages installed

  1. yum install nethserver-ocsinventory

  2. then from webui, refresh the page, you should see a yellow alert ā€œChange adminā€™s passwordā€, do it.

  3. then always from web ui: Dashboard > Applications > OCS Inventory NG
    it should redirect you to
    https://IP_nethserver/ocsreports/

  4. login with admin/password (just created on point 2)

no other steps required, seems to work fine to meā€¦ if i have some time tomorrow iā€™ll retest with other packages installedā€¦ please could you retry on a vm these steps and post here any problem? tnx

1 Like

Hi,
thatā€™s the problem. I didnā€™t arrive to webui.

It means, on a fresh NethServer :

  1. yum install nethserver-ocsinventory

  2. step #9 above : # service httpd reload
  3. step #10 ā€œAs a good practice, rename installation script file to install.php.oriā€

Thatā€™s all, nothing exotic. I will try again this week-end but Iā€™m near sure itā€™s a matter of file rights or something like this. Maybe a file with roots-only access while it shouldnā€™t. But if you canā€™t reproduce the same error, itā€™s weird. Have to research further.

Thanks for your help

1 Like

just to be clear, when i say from webui, i refer to nethserver https://ip_nethserver:980 not ocs.
it would be quite strange if after the installation of ocs you could not enter in nethserver anymore, so please let us know your tests results. tnx

Ah ok. No, no problem with NethServer UI. Now that I understand your instructions correctly it makes sense (Dashboard, etcā€¦). And I see that youā€™ve added ā€œNow you have to use NethServer admin credentials to access OCS web interface!ā€ to make things more clear. If at least Iā€™ve been useful for that, itā€™s cool :smile:

To be honest I didnā€™t have the time to try again. Will do for sure, then will tell you here how it gone. Thanks again

Tried this on 6.7 and had the problem reported access denied looking around
logs to see if i can find the cause.

1 Like

true,i did not control logs yet, but the error doesnā€™t seem on auth but on httpdā€¦
btw the packages ar not the same, probably not updated on 6.7
on 6.6 updates: nethserver-ocsinventory-1.0.2-1.ns6.noarch.rpm
on 6.7 base: nethserver-ocsinventory-1.0.0-1.ns6.noarch.rpm

@davidep will the latest updates to 6.6 be released with 6.7rc1?

Yes, I donā€™t see any problem here!