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.

Erreur 404 wiki [closed]

Bonjour à tous,

J'ai installé la dernière version d'ocs sur centos 7, j'ai le message d'erreut 404 sur mes clients, ce qui fait qu'ils ne remontent pas dans la console ocs, d'après le wiki l'erreur est connue, mais je ne comprends pas trop le sens de la phrase :

404: l'url "/ocsinventory" ne peut être trouvé sur le serveur. Vous avez fait une erreur dans la configuration d'Apache. Avez-vous inclu le contenu de configuration Apache dans le fichier de configuration d'Apache ? Avez-vous mis-à-jour ce contenu selon vos besoins ?

Malheureusement n'étant pas très doué sous linux, j'ai du mal à résoudre le problème, beaucoup parle de mon vhost qui ne serait pas bon car ocs créé son propre vhost, mais je n'y comprends pas grand chose, j'ai regardé dans mon /etc/httpd/conf.d/ocsinventory-reports.conf  et effectivement il n'y a rien en rapport avec /ocsinventory, il y a des vhost pour download et ocsreports et snmp mais pas ocsinventory, et je ne sais pas quoi rajouter, voici mon fichier :

Alias /ocsreports /usr/share/ocsinventory-reports/ocsreports

<Directory /usr/share/ocsinventory-reports/ocsreports>
    # By default, users can use console from everywhere
      <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all granted
          </IfModule>
          <IfModule !mod_authz_core.c>
        Order deny,allow
        Allow from all
      </IfModule>
    Options Indexes FollowSymLinks
    DirectoryIndex index.php
    AllowOverride None

    # Uncomment following to force use of HTTPS in Administration Server
    #SSLRequireSSL

    # PHP tuning (not working on all distribution, use php.ini instead)
    <IfModule mod_php5.c>
        AddType application/x-httpd-php .php
        php_flag file_uploads           on
        # Some PHP tuning for deployment feature up to 8 MB
        # post_max_size must be greater than upload_max_filesize
        # because of HTTP headers
        php_value post_max_size         101m
        php_value upload_max_filesize   100m

        # You may have to uncomment following on errors
        #php_value max_execution_time -1
        #php_value max_input_time -1

        # Uncomment following if you need to specify a mysql socket
        #php_value mysql.default_socket "path/to/mysql/unix/socket"

        #!! Mandatory !! : set magic_quotes_gpc to off (to make ocsreports works correctly)
        php_flag magic_quotes_gpc      off
    </IfModule>
    # Duplicate for php7 compatibility
    <IfModule mod_php7.c>
        AddType application/x-httpd-php .php
        php_flag file_uploads           on
        # Some PHP tuning for deployment feature up to 8 MB
        # post_max_size must be greater than upload_max_filesize
        # because of HTTP headers
        php_value post_max_size         101m
        php_value upload_max_filesize   100m
        # You may have to uncomment following on errors
        #php_value max_execution_time -1
        #php_value max_input_time -1

        # Uncomment following if you need to specify a mysql socket
        #php_value mysql.default_socket "path/to/mysql/unix/socket"

        #!! Mandatory !! : set magic_quotes_gpc to off (to make ocsreports works correctly)
        php_flag magic_quotes_gpc      off
    </IfModule>

    # Uncomment following to allow HTTP body request up to 4 MB
    # instead default 512 KB
    #LimitRequestBody 4194304

</Directory>

################################################################################
# Deployment packages download area
#
# Alias to put Deployment package files outside Apache document root directory
#
<Directory /var/lib/ocsinventory-reports/download>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     Require all granted
   </IfModule>
   <IfModule !mod_authz_core.c>
     Order deny,allow
     Allow from all
   </IfModule>
</Directory>
Alias /download /var/lib/ocsinventory-reports/download

################################################################################
# Snmp communities area
#
# Alias to put Snmp custom Mibs files outside Apache document root directory
#
<Directory /var/lib/ocsinventory-reports/snmp>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     Require all granted
   </IfModule>
   <IfModule !mod_authz_core.c>
     Order deny,allow
     Allow from all
   </IfModule>
</Directory>
Alias /snmp /var/lib/ocsinventory-reports/snmp

Merci par avance,

Cordialement,

Cédric

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

12 Answers

0 votes

Je viens de rajouter ça dans mon fichier /etc/httpd/conf/httpd.conf

Alias /ocsinventory "/usr/share/ocsinventory-reports/ocsreports/"
   <Directory "/usr/share/ocsinventory-reports/ocsreports/">
       Options Indexes MultiViews FollowSymLinks
       AllowOverride None
       Order allow,deny
       Allow from all
   </Directory>

Je n'ai plus l'erreur dans le log du client, mais rien ne remonte.

by (450 points)
+1 vote
Justement, il ne faut pas faire d'alias pour ocsinventory, l'agent effectivement contactera le serveur mais ne pourra pas faire remonter l'inventaire alors supprime ce que tu as rajouté ;)

Qu'est ce qui est dit dans tes logs apache ?

/var/log/httpd/error_log

+ fais voir la conf de ton agent OCS + les logs de l'agent :)
by (4.9k points)
0 votes

Bonjour,

Tout d'abord, merci de votre réponse, je viens de supprimer l'alias, voici les résultats des fichiers demandés,

voici mon fichier de log apache :

[Thu Mar 09 08:44:35.325688 2017] [mpm_prefork:notice] [pid 3910] AH00170: caught SIGWINCH, shutting down gracefully
[Thu Mar 09 08:44:36.442522 2017] [core:notice] [pid 15830] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Mar 09 08:44:36.443747 2017] [suexec:notice] [pid 15830] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using simonintranet02.simon-local.fr. Set the 'ServerName' directive globally to suppress this message
[Thu Mar 09 08:44:36.482365 2017] [auth_digest:notice] [pid 15830] AH01757: generating secret for digest authentication ...
[Thu Mar 09 08:44:36.483459 2017] [lbmethod_heartbeat:notice] [pid 15830] AH02282: No slotmem from mod_heartmonitor
[Thu Mar 09 08:44:36.614272 2017] [mpm_prefork:notice] [pid 15830] AH00163: Apache/2.4.6 (CentOS) PHP/5.6.30 configured -- resuming normal operations
[Thu Mar 09 08:44:36.614319 2017] [core:notice] [pid 15830] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Mar 09 08:48:33.982334 2017] [core:notice] [pid 15917] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Mar 09 08:48:33.983603 2017] [suexec:notice] [pid 15917] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using simonintranet02.simon-local.fr. Set the 'ServerName' directive globally to suppress this message
[Thu Mar 09 08:48:34.021134 2017] [auth_digest:notice] [pid 15917] AH01757: generating secret for digest authentication ...
[Thu Mar 09 08:48:34.022092 2017] [lbmethod_heartbeat:notice] [pid 15917] AH02282: No slotmem from mod_heartmonitor
[Thu Mar 09 08:48:34.151550 2017] [mpm_prefork:notice] [pid 15917] AH00163: Apache/2.4.6 (CentOS) PHP/5.6.30 configured -- resuming normal operations
[Thu Mar 09 08:48:34.151602 2017] [core:notice] [pid 15917] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Mar 09 08:56:02.885898 2017] [mpm_prefork:notice] [pid 15917] AH00170: caught SIGWINCH, shutting down gracefully
[Thu Mar 09 08:56:03.999397 2017] [core:notice] [pid 16077] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Mar 09 08:56:04.000631 2017] [suexec:notice] [pid 16077] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using simonintranet02.simon-local.fr. Set the 'ServerName' directive globally to suppress this message
[Thu Mar 09 08:56:04.039606 2017] [auth_digest:notice] [pid 16077] AH01757: generating secret for digest authentication ...
[Thu Mar 09 08:56:04.040911 2017] [lbmethod_heartbeat:notice] [pid 16077] AH02282: No slotmem from mod_heartmonitor
[Thu Mar 09 08:56:04.172945 2017] [mpm_prefork:notice] [pid 16077] AH00163: Apache/2.4.6 (CentOS) PHP/5.6.30 configured -- resuming normal operations
[Thu Mar 09 08:56:04.172991 2017] [core:notice] [pid 16077] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Et voici la conf de mon agent :

[OCS Inventory Agent]
ComProvider=ComHTTP.dll
Debug=0
Local=
NoSoftware=0
HKCU=0
NoTAG=0
IpDisc=
[HTTP]
Server=http://10.88.1.18/ocsinventory
SSL=1
CaBundle=cacert.pem
AuthRequired=0
User=
Pwd=
ProxyType=1
Proxy=simonfw01.simon-local.fr
ProxyPort=8080
ProxyAuthRequired=1
ProxyUser=
ProxyPwd=
[OCS Inventory Service]
PROLOG_FREQ=10
OLD_PROLOG_FREQ=10
TTO_WAIT=0
INVENTORY_ON_STARTUP=0

Et voici les logs de l'agent :

==============================================================================
Starting OCS Inventory NG Agent on Thursday, March 09, 2017 09:07:35.
AGENT => Running OCS Inventory NG Agent Version 2.3.0.0
AGENT => Using OCS Inventory NG FrameWork Version 2.3.0.0
AGENT => Loading plug-in(s)
AGENT => Using network connection with Communication Server
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.3.0.0>
AGENT => Sending Prolog
ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #404>
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:00.

Merci beaucoup pour votre aide,

Cordialement,

Cédric.

by (450 points)
0 votes

Tu ne dois pas avoir mis ton FQDN dans le fichier hosts :

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using simonintranet02.simon-local.fr. Set the 'ServerName' directive globally to suppress this message

Essaye ça :

/etc/hosts:

127.0.0.1   localhost.localdomain localhost simonintranet02.simon-local.fr
::1         localhost.localdomain localhost simonintranet02.simon-local.fr

/etc/httpd/httpd.conf:

ServerName simonintranet02.simon-local.fr
service httpd restart 

Modifie ton agent comme ceci, relance l'agent et re-poste les 

logs de l'agent, il y aura plus d'informations

[OCS Inventory Agent]
ComProvider=ComHTTP.dll
Debug=2
Local=
NoSoftware=0
HKCU=0
NoTAG=0
IpDisc=
[HTTP]
Server=http://10.88.1.18/ocsinventory
SSL=0
CaBundle=cacert.pem
AuthRequired=0
User=
Pwd=
ProxyType=
Proxy=
ProxyPort=
ProxyAuthRequired=

ProxyUser=
ProxyPwd=
[OCS Inventory Service]
PROLOG_FREQ=10
OLD_PROLOG_FREQ=10
TTO_WAIT=0
INVENTORY_ON_STARTUP=0

by (4.9k points)
0 votes

Je viens de tout modifier, en ayant bien arrété le service ocs agent avant modif, et voici ce que me donne le log :

==============================================================================
Starting OCS Inventory NG Agent on Thursday, March 09, 2017 12:29:38.
AGENT => Running OCS Inventory NG Agent Version 2.3.0.0
AGENT => Using OCS Inventory NG FrameWork Version 2.3.0.0
AGENT => Loading plug-in(s)
    DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins>
    DLL PLUGIN => 0 DLL Plug-in(s) successfully loaded on 0 DLL(s) found
AGENT => Using network connection with Communication Server
    COM PROVIDER => Loading Communication Provider <C:\Program Files (x86)\OCS Inventory Agent\ComHTTP.dll>
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.3.0.0>
AGENT => Sending Prolog
    DID_CHECK => Read DeviceID <N04-023-2016-03-22-14-50-51> and MACs <30:8D:99:6B:BF:7534:E6:AD:7C:5D:B134:E6:AD:7C:5D:AD36:E6:AD:7C:5D:AD> in file <ocsinventory.dat>
    COM SERVER => Initializing cURL library for sendRequest
    COM SERVER => Using cURL without server authentication
    COM SERVER => Disabling cURL proxy support
    COM SERVER => Disabling cURL SSL server validation support
    COM SERVER => Sending HTTP Post request to URL <http://10.88.1.18/ocsinventory>
    COM SERVER => HTTP Post response received <HTTP Status Code #404>
    COM SERVER => Cleaning cURL library
================= TRACE START ===============

================= TRACE STOP ===============
ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #404>
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:01.

==============================================================================
Starting OCS Inventory NG Agent on Thursday, March 09, 2017 12:30:27.
AGENT => Running OCS Inventory NG Agent Version 2.3.0.0
AGENT => Using OCS Inventory NG FrameWork Version 2.3.0.0
AGENT => Loading plug-in(s)
    DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins>
    DLL PLUGIN => 0 DLL Plug-in(s) successfully loaded on 0 DLL(s) found
AGENT => Using network connection with Communication Server
    COM PROVIDER => Loading Communication Provider <C:\Program Files (x86)\OCS Inventory Agent\ComHTTP.dll>
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.3.0.0>
AGENT => Sending Prolog
    DID_CHECK => Read DeviceID <N04-023-2016-03-22-14-50-51> and MACs <30:8D:99:6B:BF:7534:E6:AD:7C:5D:B134:E6:AD:7C:5D:AD36:E6:AD:7C:5D:AD> in file <ocsinventory.dat>
    COM SERVER => Initializing cURL library for sendRequest
    COM SERVER => Using cURL without server authentication
    COM SERVER => Disabling cURL proxy support
    COM SERVER => Disabling cURL SSL server validation support
    COM SERVER => Sending HTTP Post request to URL <http://10.88.1.18/ocsinventory>
    COM SERVER => HTTP Post response received <HTTP Status Code #404>
    COM SERVER => Cleaning cURL library
================= TRACE START ===============

================= TRACE STOP ===============
ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #404>
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:00.

Merci encore pour ton aide.

Cordialement,

Cédric.

by (450 points)
0 votes

Pas de problème :)

Tu as toujours cette erreur dans ton error_log d'apache ? 

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using simonintranet02.simon-local.fr. Set the 'ServerName' directive globally to suppress this message

Bon il n'y a rien de bien intéressant dans les logs de l'agent à part l'erreur 404. Cela signifie qu'il ne trouve pas ton serveur. Est-ce que le PC où il y a l'agent et le serveur ocs se ping ? 

by (4.9k points)
0 votes

Je n'ai plus l'erreur dans le log apache, merci :

[Thu Mar 09 12:21:21.227198 2017] [mpm_prefork:notice] [pid 16077] AH00170: caught SIGWINCH, shutting down gracefully
[Thu Mar 09 12:21:26.349188 2017] [core:notice] [pid 18626] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Mar 09 12:21:26.350325 2017] [suexec:notice] [pid 18626] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Mar 09 12:21:26.386722 2017] [auth_digest:notice] [pid 18626] AH01757: generating secret for digest authentication ...
[Thu Mar 09 12:21:26.387807 2017] [lbmethod_heartbeat:notice] [pid 18626] AH02282: No slotmem from mod_heartmonitor
[Thu Mar 09 12:21:26.513181 2017] [mpm_prefork:notice] [pid 18626] AH00163: Apache/2.4.6 (CentOS) PHP/5.6.30 configured -- resuming normal operations
[Thu Mar 09 12:21:26.513220 2017] [core:notice] [pid 18626] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Sur le windows 7 où l'agent est installer je ping bien mon serveur, et j'accède bien à la page ocsreports.

Par contre est ce normal que lorsque je me rend à l'adresse http://simonintranet02.simon-local.fr/ocsinventory , il ne trouve aucune page ?

PS : Je ne sais pas si ça peut aider, mais pour information j'ai également un glpi d'installé sur ce serveur, et 2 sites web.

De plus nous avons un proxy sur notre réseau.

Cordialement,

by (450 points)
0 votes

Concernant url/ocsinventory c'est normal. C'est une page virtuelle pour la remontée des inventaires en XML, elle n'existe pas vraiment.

Ok donc si tu as un proxy, autant pour moi, remets la configuration proxy

ProxyType=1
Proxy=simonfw01.simon-local.fr
ProxyPort=8080
ProxyAuthRequired=1
ProxyUser=tonuser
ProxyPwd=tonpassword

 Relance l'inventaire, encore une fois partage les logs de l'agent + /var/log/httpd/access_log

ps: juste comme ça, ton serveur OCS est bien en http ? Pas en https ?

by (4.9k points)
0 votes

Oui, c'est bien du http.

Voici le log de l'agent après avoir remis mon proxy :

Starting OCS Inventory NG Agent on Thursday, March 09, 2017 14:40:57.
AGENT => Running OCS Inventory NG Agent Version 2.3.0.0
AGENT => Using OCS Inventory NG FrameWork Version 2.3.0.0
AGENT => Loading plug-in(s)
    DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins>
    DLL PLUGIN => 0 DLL Plug-in(s) successfully loaded on 0 DLL(s) found
AGENT => Using network connection with Communication Server
    COM PROVIDER => Loading Communication Provider <C:\Program Files (x86)\OCS Inventory Agent\ComHTTP.dll>
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.3.0.0>
AGENT => Sending Prolog
    DID_CHECK => Read DeviceID <N04-023-2016-03-22-14-50-51> and MACs <30:8D:99:6B:BF:7534:E6:AD:7C:5D:B134:E6:AD:7C:5D:AD36:E6:AD:7C:5D:AD> in file <ocsinventory.dat>
    COM SERVER => Initializing cURL library for sendRequest
    COM SERVER => Using cURL without server authentication
    COM SERVER => Using cURL HTTP type proxy <simonfw01.simon-local.fr:8080>
    COM SERVER => Using cURL proxy with authentication
    COM SERVER => Disabling cURL SSL server validation support
    COM SERVER => Sending HTTP Post request to URL <http://simonintranet02.simon-local.fr/ocsinventory>
    COM SERVER => HTTP Post response received <HTTP Status Code #404>
    COM SERVER => Cleaning cURL library
================= TRACE START ===============

================= TRACE STOP ===============
ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #404>
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:00.

Et voici les logs access d'apache, mais il n'y a pas grand chose concernant l'ocs, à savoir que l'ip 10.88.1.250 est celle de mon proxy :

::1 - - [09/Mar/2017:14:32:48 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) PHP/5.6.30 (internal dummy connection)"
10.88.1.250 - - [09/Mar/2017:14:33:48 +0100] "POST /ocsinventory HTTP/1.1" 404 210 "-" "OCS-NG_WINDOWS_AGENT_v2.1.1.1"
10.88.1.250 - - [09/Mar/2017:14:33:49 +0100] "POST /ocsinventory HTTP/1.1" 404 210 "-" "OCS-NG_WINDOWS_AGENT_v2.1.1.1"
10.88.1.250 - - [09/Mar/2017:14:34:11 +0100] "POST /ocsinventory HTTP/1.1" 404 210 "-" "OCS-NG_WINDOWS_AGENT_v2.1.1.1"

10.88.1.250 - - [09/Mar/2017:14:34:58 +0100] "POST /ocsinventory HTTP/1.1" 404 210 "-" "OCS-NG_WINDOWS_AGENT_v2.3.0.0"
::1 - - [09/Mar/2017:14:35:05 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) PHP/5.6.30 (internal dummy connection)"
10.88.1.3 - - [09/Mar/2017:14:35:49 +0100] "-" 408 - "-" "-""
::1 - - [09/Mar/2017:14:43:17 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) PHP/5.6.30 (internal dummy connection)"
::1 - - [09/Mar/2017:14:43:18 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) PHP/5.6.30 (internal dummy connection)"
::1 - - [09/Mar/2017:14:43:19 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) PHP/5.6.30 (internal dummy connection)"
10.88.1.250 - - [09/Mar/2017:14:43:54 +0100] "POST /ocsinventory HTTP/1.1" 404 210 "-" "OCS-NG_WINDOWS_AGENT_v2.1.1.1"
10.88.1.35 - - [09/Mar/2017:14:43:55 +0100] "-" 408 - "-" "-"
10.88.1.250 - - [09/Mar/2017:14:44:06 +0100] "POST /ocsinventory HTTP/1.1" 404 210 "-" "OCS-NG_WINDOWS_AGENT_v2.1.1.1"
10.88.1.250 - - [09/Mar/2017:14:44:21 +0100] "POST /ocsinventory HTTP/1.1" 404 210 "-" "OCS-NG_WINDOWS_AGENT_v2.3.0.0"

Cordialement,

by (450 points)
0 votes

Je n'ai malheureusement jamais utilisé OCS avec un proxy donc sur cette partie je ne peux pas t'aider, j'aurais tendance à dire que c'est de sa faute vu que je ne connais pas mais ce ne serait pas juste ;) 

Je ne peux pas te confirmer que ta configuration proxy est correcte non plus, il faudrait que quelqu'un d'OCS vienne t'aider car avec ce que tu m'as montré, je ne vois aucun problème dont je connais la solution malheureusement.


Je vais quand même suivre la procédure classique quand il y a un problème avec OCS :

/etc/httpd/conf.d/z-ocsinventory-server.conf + dans le dossier d'ocs : dbconfig.inc.php

Vérifie que le user sql de la DB d'OCS et son mot de passe sont corrects puis réessaye (redemarre httpd si tu fais des modifs)

by (4.9k points)
 
Powered by Question2Answer
...