You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-11-11 17:34:04

mertbeyaz
Member
Registered: 2022-11-24
Posts: 10

Plugin is not working after changeing webserver root directory

After version upgrade to 10.0.11 the DocumentRoot folder must be moved to the “Public” folder. We do this in the vhost config as follows:
Alias /glpi-dev /var/www/sites/default/apps/glpi-dev/public
<Directory /var/www/sites/default/apps/glpi-dev/public>
    AllowOverride All
    Allow from All
    Options FollowSymLinks
    DirectoryIndex index.php
    <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule api/(.*)$ apirest.php/$1
       RewriteRule ^(.*)$ index.php [QSA,L]
    </IfModule>
</Directory>

After that, however, the reports of our self-written plugin no longer work with the following error message:
Access to server.domain was denied
You don't have authorization to view this page.
HTTP ERROR 403

default_access_ssl_log -->
"GET /glpi-dev/plugins/swisstxt/reports/solutions.php HTTP/1.1" 403 - "https://server/glpi-dev/front/report.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"


Someone has any idea what the problem could be and how to solve it?

Last edited by mertbeyaz (2024-11-11 17:41:38)

Offline

#2 2024-11-12 21:11:44

larsen
Member
Registered: 2024-09-04
Posts: 7

Re: Plugin is not working after changeing webserver root directory

Not sure if this helps, but here is our configuration for GLPI 10.0.17 running on Apache 2.4 in an internal VM (Debian Bookworm) :

<VirtualHost *:80>
    ServerName glpi.example.local

    DocumentRoot /var/www/glpi/public

    # If you want to place GLPI in a subfolder of your site (e.g. your virtual host is serving multiple applications),
    # you can use an Alias directive. If you do this, the DocumentRoot directive MUST NOT target the GLPI directory itself.
    # Alias "/glpi" "/var/www/glpi/public"

    <Directory /var/www/glpi/public>
        Require all granted

        RewriteEngine On

        # Ensure authorization headers are passed to PHP.
        # Some Apache configurations may filter them and break usage of API, CalDAV, ...
        RewriteCond %{HTTP:Authorization} ^(.+)$
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

        # Redirect all requests to GLPI router, unless file exists.
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php [QSA,L]
    </Directory>

    <IfModule mod_proxy_fcgi.c>
        <FilesMatch "\.php$">
            SetHandler "proxy:unix:/var/run/php/php-fpm-glpi.example.local.sock|fcgi://localhost"
        </FilesMatch>
    </IfModule>

</VirtualHost>

Using DocumentRoot instead of Alias, but maybe this is not possible in your case.

Offline

Board footer

Powered by FluxBB