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.11.1 available

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

Server and Agent cant communicate HTTP 403

Hi everyone,

I am having an issue when sending the agent's info on the server. I get an http 403 error when trying to access to the http://myServerIp/ocsinventory.

When installing the agent and choosing the address, I am making sure it is in the correct way (aka http://myServerIp/ocsinventory)

However the server can't receive the agent's info.

The OcsReports panel seems to be installed proprely and correctly. I have fully access to http://myServerIp/ocsreports.

I put the correct database name, username and password in the configuration files.

After checking the agent's logs, i can see that there is an http error 403, http://myServerIP/ocsinventory access being forbidden.

I have tried searching on the internet but i haven't found any solution, and I have reinstalled a second time to server to make sure I installed the server correctly.

Here's a list of what ive tried :

- Updated my system

- Install php extensions and packages required by the server

- Install and enable perl modules

- Create a database

- Download, configurate the setup.sh (with correct db user and db password) and install

- Configurate (put the correct db name, db user and db password) and enable the 3 .conf files
- Change the ownership of  the ocsinventory-reports directory to www-data user, and change the permission to 755

- And finally finishing the installation on http://MyServerIp/ocsreports, and delete the installer.

Please help

Thanks!

PS : Je parle français

OS Server : Ubuntu 22.04

OCS Server : 12.0

OCS Agent : 2.10.1_0

Error obtained in the agent log : ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #403>
in OCS Inventory NG agent for Windows by (200 points)

5 Answers

0 votes

did you add z-oscinventory-server.conf and ocsinventory-reports.conf to httpd.conf ? Have you set the correct access to the database in this file? There are paths in the ocsinventory-reports.conf file, check if they exist in your system and if they have permissions to the Apache server

by (460 points)
0 votes

did you add z-oscinventory-server.conf and ocsinventory-reports.conf to httpd.conf ? Have you set the correct access to the database in this file? There are paths in the ocsinventory-reports.conf file, check if they exist in your system and if they have permissions to the Apache server

by (460 points)
0 votes
The most efficient is to follow a tutorial (e.g with Debian).

Then you'll need to check your configuration files, check for services running (apache2).(Setting of configuration files are part of tutorial ...)

And I suggest you install locally agent (from Debian repository) and verify the 2 main log : apache : access.log, ocs : inventory.log

(I write one and I use it some times with succes ... but I know enough which files and service sto check !)
by (19.4k points)
edited by
0 votes

Hi slawekdw, thanks for your response.

I made sure apache has access to the files present in the ocsinventory-reports.conf file (aka making sure that apache has access to /usr/share/ocsinventory-reports/ocsreports folder) by using chown command and apache username being www:data. 

On my apache2.conf file (httpd), the /usr/share and /var/www directories has been added with "require all granted". The apache2.conf file hasn't been edited on the tutorials i've followed.

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

Once again, what is weird is that my OCS website works fine (http://myIP/ocsreports), but i get error 403 when trying to access to http://myIP/ocsinventory, and the agent gets the same error.

by (200 points)
0 votes
Hi jacquesh, thanks for your answer.

I did follow tutorials. There is nothing pertinent in access log

Apache error log :
ocsinventory-server: Bad setting. `GENERATE_OCS_FILES_SNMP` is not set. Default: `0`
ocsinventory-server: Bad setting. `SCAN_TYPE_IPDISCOVER` is not set. Default: `ICMP`
ocsinventory-server: Bad setting. `SCAN_TYPE_SNMP` is not set. Default: `ICMP`
ocsinventory-server: Bad setting. `IPDISCOVER_LINK_TAG_NETWORK` is not set. Default: `0`
ocsinventory-server: Bad setting. `SCAN_ARP_BANDWIDTH` is not set. Default: `256`

And for OCS, i have no files in /var/log/ocsinventory-server either ocsinventory-client
by (200 points)
 
Powered by Question2Answer
...