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 http://wiki.ocsinventory-ng.org. Read it before asking your question.

OCS access to /download/ forbidden

Bonjour à tous.

Depuis un certain temps j'ai des problèmes d'accès à mon répertoire download sur mon serveur OCS.

Version OCS : 2.4 et Apache/2.4.25 (Debian) et Debian : 9.3

Je vous donne mes fichiers de configuration ocs :

/etc/apache2/conf-available/ocsinventory-reports.conf

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 Options

        # 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         501m

        php_value upload_max_filesize   500m

        # 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         501m

        php_value upload_max_filesize   500m

        # 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 254194304

</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

     AllowOverride All

     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

-------------------------------------------------------------------------------------------------------------------------------------------

/etc/apache2/sites-available/default-ssl.conf

<IfModule mod_ssl.c>

<VirtualHost _default_:443>

ServerAdmin webmaster@localhost

DocumentRoot /var/www/html

#DocumentRoot /usr/share/ocsinventory-reports/ocsreports

ErrorLog ${APACHE_LOG_DIR}/error.log

CustomLog ${APACHE_LOG_DIR}/access.log combined

SSLEngine on

SSLCertificateFile /etc/ssl/certs/ocsng.pem

SSLCertificateKeyFile /etc/ssl/private/ocsng.key

<FilesMatch "\.(cgi|shtml|phtml|php)$">

SSLOptions +StdEnvVars

</FilesMatch>

<Directory /usr/lib/cgi-bin>

SSLOptions +StdEnvVars

</Directory>

<Directory /var/lib/ocsinventory-reports/download>

<IfModule mod_authz_core.c>

Require all granted

</IfModule>

<IfModule !mod_authz_core.c>

#Order deny,allow

#Allow from all

</IfModule>

</Directory>

Alias /download /var/lib/ocsinventory-reports/download

</VirtualHost>

</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

En plus tester l'accessibilité du répertoire download j'y ai crée un petit fichier test.html dont root est propriétaireh

https://ip_ocs/download/test.html ou http://ip_ocs/download/test.html Accès OK

https://ip_ocs/download/1519651014/ ou http://ip_ocs/download/1519651014/ Accès forbidden

Quelqun'un peut-il m'aider svp ? Je vous remercie d'avance.
in OCS Inventory NG server for Unix by (120 points)

1 Answer

0 votes
Did you find a solution? Thanks beforehand.
by (290 points)
 
Powered by Question2Answer
...