Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

Can't load Perl module Apache::Ocsinventory::Plugins [closed]

Hi,

I tried to install OcsInventory on my Ubuntu Server according to this manual:
http://wiki.ocsinventory-ng.org/index.php?title=Documentation:Server

After enabling the Apache configurations (ocsinventory-reports.conf and z-ocsinventory-server.conf), Apache doesn't start anymore. It reports the following error:

[Mon Apr 10 13:46:46.422442 2017] [perl:error] [pid 19115] Can't load Perl module Apache::Ocsinventory::Plugins for server myserver:0, exiting...

The setup script installed this module together with all others to /usr/local/share/perl/5.22.1/Apache. It's readable for all. I checked with instmodsh and cpan -l that it's known to Perl.
I already tried recompiling as suggested here, without success:
http://ask.ocsinventory-ng.org/2893/apache-cant-work-after-ocsinventory-ng-installed
I also tried to copy the modules over to all perl-related directories and also to /etc/ocsinventory-server/plugins and /etc/ocsinventory-server/perl. Still no luck. I think that Apache/mod_perl is indeed able to locate the module, but somehow there's an incompatibility or something that prevents loading.

I'd be very thankful to suggestions how to find the reason. I already thought of recompiling mod_perl with trace support enabled, but wanted to ask for better ideas first.

My system:
Ubuntu 16.04.2 LTS
Kernel version 4.4.0-042stab120.20 x86_64
Apache/2.4.18 (Ubuntu)
Ocs Inventory 2.3.1
Perl 5.22.1

Thanks a lot,
Alex

closed with the note: Problem solved
in OCS Inventory NG server for Unix by (200 points)
closed by

3 Answers

0 votes
Did you install any plugin at all ?

Yes : check if these files exist /etc/ocsinventory-server/perl/Apache/Ocsinventory/Plugins/Pluginname/Map.pm
                                           /etc/ocsinventory-server/plugins/Pluginname.conf
Be sure to chmod 755 and chown www-data:www-data these files.

No : I can only answer that I tried to install OCS on Ubuntu and ended up just using Debian 8 Jessie or CentOS7, both work fine with OCS 2.3.1
Use this guide to install, its unfinished but more up to date :
https://github.com/OCSInventory-NG/Wiki/blob/master/english/02.Basic-documentation/Setting-up-a-OCS-Inventory-Server.md
by (640 points)
0 votes
Hi Jeremy,

thanks for your reply. I'm not sure about those plugins. As already mentioned, I didn't do anything except for running setup.sh. /etc/ocsinventory-server/plugins was empty after that. When I realized that Apache didn't start, I tried to copy stuff from OCSNG_UNIX_SERVER-2.3.1/Apache there (readable for all), but it didn't help.

I also tried to remove the following lines from z-ocsinventory-server.conf:

# Ocs plugins
PerlModule Apache::Ocsinventory::Plugins::Apache
PerlModule Apache::Ocsinventory::Plugins

But then it's simply failing with the next module:

[Wed Apr 12 13:34:32.781169 2017] [perl:error] [pid 27364] Can't load Perl module Apache::Ocsinventory for server myserver:0, exiting...

So it's not about plugins. It seems that all ocs-provided modules refuse to load.

However, I will thoroughly study the manual that you provided, maybe I happen to discover something.

Alex
by (200 points)
0 votes
I've found the problem: Instead of enabling an Apache conf with a2enmod, I usually prefer to include them into the <VirtualHost> definition to limit their effect to a specific site/vhost. I did the same with "z-ocsinventory-server.conf". For some reason that caused the described error, although "PerlModule" and "PerlSetEnv" directives seem to work inside a <VirtualHost> tag when being inserted there directly. However, using the conf the intended way (a2enmod) solved the problem.

Alex
by (200 points)
 
Powered by Question2Answer
...