You are not logged in.
Bonjour,
j'ai migré il y a peu de la version GLPI 10.0.3 à la 10.0.14.
Depuis j'ai droit au message :
Web server root directory configuration is not safe as it permits access to non-public files. See installation documentation for more details.
The following directories should be placed outside "/var/www/html/glpi": ‣ "/var/www/html/glpi/files" ("GLPI_VAR_DIR") You can ignore this suggestion if your web server root directory is "/var/www/html/glpi/public".The following directories should be placed outside "/var/www/html/glpi":
‣ "/var/www/html/glpi/files" ("GLPI_VAR_DIR")
Bien entendu mon installation est sous /var/www/html/glpi.
Quand je modifie mon default-ssl.conf et 000-default.conf avec /var/www/html/glpi/public, je me retrouve avec une jolie page avec une erreur...
Voici mes 2 fichiers.
Que dois je faire svp ? j'ai fait déjà beaucoup de chose et ne sais plus ce que je dois faire.
merci à vous.
le fichier 000-default.conf du serveur :
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/glpi/public
<Directory /var/www/html/glpi/public>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Redirect permanent / https://support.prod.fr/
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#<Directory /var/www/html/glpi>
# Options Indexes FollowSymLinks MultiViews
# AllowOverride limit
# Require all granted
#</Directory>
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
le fichier default-ssl.conf du serveur.
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
ServerName nomglpi
ServerAlias support.prod.fr
# DocumentRoot /var/www/html
DocumentRoot /var/www/html/glpi
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error_443.log
CustomLog ${APACHE_LOG_DIR}/access_443.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
# A self-signed (snakeoil) certificate can be created by installing
# the ssl-cert package. See
# /usr/share/doc/apache2/README.Debian.gz for more info.
# If both key and certificate are stored in the same file, only the
# SSLCertificateFile directive is needed.
# SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
# SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SSLCertificateFile /etc/ssl/certs/prod_GLPI.crt
SSLCertificateKeyFile /etc/ssl/private/prod_GLPI01.key
SSLCertificateChainFile /etc/ssl/certs/prod_GLPI.pem
<Directory /var/www/html/glpi>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
# Server Certificate Chain:
# Point SSLCertificateChainFile at a file containing the
# concatenation of PEM encoded CA certificates which form the
# certificate chain for the server certificate. Alternatively
# the referenced file can be the same as SSLCertificateFile
# when the CA certificates are directly appended to the server
# certificate for convinience.
#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
# Certificate Authority (CA):
# Set the CA certificate verification path where to find CA
# certificates for client authentication or alternatively one
# huge file containing all of them (file must be PEM encoded)
# Note: Inside SSLCACertificatePath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCACertificatePath /etc/ssl/certs/
#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
# Certificate Revocation Lists (CRL):
# Set the CA revocation path where to find CA CRLs for client
# authentication or alternatively one huge file containing all
# of them (file must be PEM encoded)
# Note: Inside SSLCARevocationPath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCARevocationPath /etc/apache2/ssl.crl/
#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
# Client Authentication (Type):
# Client certificate verification type and depth. Types are
# none, optional, require and optional_no_ca. Depth is a
# number which specifies how deeply to verify the certificate
# issuer chain before deciding the certificate is not valid.
#SSLVerifyClient require
#SSLVerifyDepth 10
# SSL Engine Options:
# Set various options for the SSL engine.
# o FakeBasicAuth:
# Translate the client X.509 into a Basic Authorisation. This means that
# the standard Auth/DBMAuth methods can be used for access control. The
# user name is the `one line' version of the client's X.509 certificate.
# Note that no password is obtained from the user. Every entry in the user
# file needs this password: `xxj31ZMTZzkVA'.
# o ExportCertData:
# This exports two additional environment variables: SSL_CLIENT_CERT and
# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
# server (always existing) and the client (only existing when client
# authentication is used). This can be used to import the certificates
# into CGI scripts.
# o StdEnvVars:
# This exports the standard SSL/TLS related `SSL_*' environment variables.
# Per default this exportation is switched off for performance reasons,
# because the extraction step is an expensive operation and is usually
# useless for serving static content. So one usually enables the
# exportation for CGI and SSI requests only.
# o OptRenegotiate:
# This enables optimized SSL connection renegotiation handling when SSL
# directives are used in per-directory context.
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
# SSL Protocol Adjustments:
# The safe and default but still SSL/TLS standard compliant shutdown
# approach is that mod_ssl sends the close notify alert but doesn't wait for
# the close notify alert from client. When you need a different shutdown
# approach you can use one of the following variables:
# o ssl-unclean-shutdown:
# This forces an unclean shutdown when the connection is closed, i.e. no
# SSL close notify alert is send or allowed to received. This violates
# the SSL/TLS standard but is needed for some brain-dead browsers. Use
# this when you receive I/O errors because of the standard approach where
# mod_ssl sends the close notify alert.
# o ssl-accurate-shutdown:
# This forces an accurate shutdown when the connection is closed, i.e. a
# SSL close notify alert is send and mod_ssl waits for the close notify
# alert of the client. This is 100% SSL/TLS standard compliant, but in
# practice often causes hanging connections with brain-dead browsers. Use
# this only for browsers where you know that their SSL implementation
# works correctly.
# Notice: Most problems of broken clients are also related to the HTTP
# keep-alive facility, so you usually additionally want to disable
# keep-alive for those clients, too. Use variable "nokeepalive" for this.
# Similarly, one has to force some clients to use HTTP/1.0 to workaround
# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
# "force-response-1.0" for this.
# BrowserMatch "MSIE [2-6]" \
# nokeepalive ssl-unclean-shutdown \
# downgrade-1.0 force-response-1.0
</VirtualHost>
</IfModule>
Last edited by utilisateurUGMR (2024-04-24 10:35:37)
Offline
La solution est : https://forum.glpi-project.org/viewtopic.php?id=286749
Donnée par cconard96
<VirtualHost *:80>
ServerName glpi.localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/glpi/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/glpi/public>
Require all granted
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerName glpi.localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/glpi/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/glpi.crt
SSLCertificateKeyFile /etc/ssl/private/glpi.key
<Directory "/var/www/html/glpi/public">
Require all granted
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
</VirtualHost>
Surtout ne pas oublier le :
sudo a2enmod rewrite
Offline
Bonjour,
Je me permets de reprendre ce thread pour y ajouter une autre contrainte.
Il se trouve qu'historiquement, l'URL d'accès à mon service GLPI était https://www.example.com/glpi puis https://support.example.com/glpi, puis cela est devenu https://support.example.com/assistance. Il faut donc comprendre que ça et là, j'ai paramétré des agents FusionInventory, pius Agent GLPI pour utiliser la base de cette URL afin de remonter des inventaires.
Les choses évoluent à nouveau, et j'aimerai simplifier l'URL de GLPI en utilisant directement la racine de l'URL, soit https://support.example.com/
Cependant, par soucis de compatibilité ascendante, j'aimerai que les agents qui sont restés configurés avec les URL historiques puissent continuer d'effectuer des remontées d'inventaires sans que je n'ai besoin d'intervenir sur la configuration des agents.
En ces sens, si un agent demande l'URL https://www.example.com/glpi alors Apache2 la reformule en https://support.example.com/.
De même, si un agent demande l'URL https://support.example.com/glpi alors Apache2 la reformule en https://support.example.com/ et enfin si un agent interroge l'URL https://support.example.com/assistance alors Apache2 la reformule en https://support.example.com/
Dans le même contexte que la configuration proposée par @cconard96 et au ServerName près, quelle serait la/les règles de Rewrite à mettre en place pour répondre à mon besoin ?
D'avance merci pour vos remarques et suggestions précieuses.
Marc-Henri
Marc-Henri PAMISEUX - Maine Services Informatique
Intégrateur de solutions Libre - Être Libre, c'est choisir.
Offline
Bonjour,
J'avais la même erreur sur un hébergement mutualisé dont la configuration du domaine hxxps://glpi.mondomaine.fr pointe vers le répertoire /home/user/glpi.
La solution mise en place a été d'ajouter les lignes suivantes dans le fichier /home/user/glpi/.htaccess :
<IfModule mod_rewrite.c>
RewriteEngine On
# If URL doesn't start with /public/, redirect to /public/index.php
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/index.php [L,QSA]
</IfModule>
On peux maintenant profiter de la sécurisation du code de la page /public/index.php.
Vos retours sont les bienvenus.
"Don´t THINK you are, KNOW you are" - Morpheus (Matrix, 1999)
Offline