You are not logged in.
Hello,
Here is my problem,
I have a dedicated online server on debian 9,
I would like to be able to access the GLPI application through my website, so that each user can access the application by typing our website / glpi address.
When I create a glpi directory in my site tree. In the www directory of my site. I put the GLPI files in this directory.
When I try to run the glpi php install script I get a 403 Forbidden You don't have permission to access this resource.
So I have my dedicated server which does not access and does not have write rights, so I checked the rights, I have 755 on the folders and 644 on the files
My linux user of my server is present on www-data
For the web server: my site is already running on this web server,
I am using WinScp with putty to type linux queries
Offline
When I try to run the glpi php install script I get a 403 Forbidden You don't have permission to access this resource.
Are you doing this from a web browser or from the console?
Offline
I run the php script via the web browser for example: example.com/glpi/install/install.php
Offline
Hi
You may want to use "chown" command from the linux console then, so all the GLPI files get the proper ownership (otherwise this symptom may return in very unexpected way...; it is not about just access rights, but files / folders ownership)
Try entering onto GLPI folder and issue the following command:
chown -R www-data:www-data *
and it should do the trick Just beware where You'd run this command, thou (definitely not on root).
Offline
Hello,
I made the order: Chown -R www-data: www-data *
In the GLPI directory
I have this error message :
chown: changing ownership of 'vendor': Operation not permitted (And all other files and directory of glpi)
Offline
I think sudo should also be used there - You must have privileges to adjust ownership of the entire structure, so the GLPI may then use it through "hands" of Apache server...
Offline
By doing : sudo chown -R www-data: www-data *
I have this error message:
Chown: cannot access 'www-data': No such file or directory
Offline
The command should be that one (the one above contains one unnecessary space):
sudo chown -R www-data:www-data *
Offline
Here I made the command sudo chown -R www-data: www-data *
The order went well, I restarted apache2
But the 403 Forbidden You don't have permission to access this resource error. Is always present in the browser
Offline
mikka66, try the following commands, one after the other.
Remember replacing /path/to/glpi with the full path of your GLPI folder.
Also, you can remove sudo from each command if you're running those with root account.
sudo chown -R www-data:www-data /path/to/glpi
sudo find /path/to/glpi -type f -exec chmod 640 {} \;
sudo find /path/to/glpi -type d -exec chmod 2750 {} \;
This should fix all the permissions on files and directories, making sure newly created files and directories inherit the group of their parent directories.
Edit: Moved sudo to the beginning of all of the commands so you won't get permission denied on the find command while descending into directories.
Last edited by fabianoantunes (2020-11-27 17:03:45)
Offline
I ran these 3 commands but unfortunately I still have the 403 error: /
Does anyone have the solution?
Offline
mikka66, please, post the contents/output of the following (remember replacing the file name where required):
/etc/apache2/sites-enabled/<configuration-file-for-the-glpi-url>
/path/to/glpi/.htaccess
Output of the command
sudo ls -ld /path/to/glpi
Also, please, check the output of the command
sudo apache2ctl configtest
returns
Syntax OK
Offline
sudo ls /path/to/glpi return :
ajax config inc marketplace sound
apirest.md CONTRIBUTING.md index.php pics stats
apirest.php COPYING.txt install plugins status.php
apixmlrpc.php css INSTALL.md public SUPPORT.md
bin css_compiled js README.md vendor
caldav.php files lib scripts
CHANGELOG.md front locales SECURITY.md
sudo apache2ctl configtest return : Syntax OK
Offline
sudo ls /path/to/glpi return : This is missing the ld parameter
It should be
ls -ld /path/to/glpisudo ls -ld /path/to/glpi
Also, please post the content of .htaccess from within the glpi path.
Last edited by fabianoantunes (2020-12-03 21:09:43)
Offline
sudo ls -ld /path/to/glpi return :
drwxr-s--- 22 www-data www-data 4096 Dec 3 15:17 /path/to/glpi
Here is the htaccess content from the glpi path :
# If you have problem with session.auto_start or session.use_trans_sid on install
# you need to set thse configurations values to 0 in php.ini or uncomment this line
#php_value session.auto_start 0
#php_value session.use_trans_sid 0
# The following lines enable the apache rewriting for the api. You can use url like http://glpi/api/.
#<IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule api/(.*)$ apirest.php/$1
#</IfModule>
# You can uncomment following lines to enable caching of web assets (pictures, javascript files, etc)
#<IfModule mod_expires.c>
# ExpiresActive On
# ExpiresByType image/jpg "access 1 year"
# ExpiresByType image/jpeg "access 1 year"
# ExpiresByType image/gif "access 1 year"
# ExpiresByType image/png "access 1 year"
# ExpiresByType text/css "access 1 year"
# ExpiresByType text/x-javascript "access 1 year"
# ExpiresByType text/javascript "access 1 year"
# ExpiresByType application/javascript "access 1 year"
#</IfModule>
Offline
Here are the errors in the logs:
€‹[Thu Dec 03 19:21:03.417771 2020] [authz_core:error] [pid 24300] [client "ip"] AH01630: client denied by server configuration: /path/to/glpi/install/install.php
€‹[Fri Dec 04 20:11:45.701181 2020] [proxy_fcgi:error] [pid 26005] [client "ip"] AH01071: Got error 'Primary script unknown'
Fabiano do you have a lead?
Offline
OK, another thought - have You checked if all necessary modules are installed?
Offline
Here are the errors in the logs:
€‹[Thu Dec 03 19:21:03.417771 2020] [authz_core:error] [pid 24300] [client "ip"] AH01630: client denied by server configuration: /path/to/glpi/install/install.php
€‹[Fri Dec 04 20:11:45.701181 2020] [proxy_fcgi:error] [pid 26005] [client "ip"] AH01071: Got error 'Primary script unknown'
Fabiano do you have a lead?
Hi mikka66.
According to the messages you posted above, without further information, it seems the problem comes from your Apache configuration file.
All lines from your .htaccess file are commented (#), so they're definitely not interfering.
Please, post your /etc/apache2/sites-enabled/<configuration-file-for-the-glpi-url> file content, as the problem seems to come from that.
Best,
Fabiano.
P.S.: Sorry for the delay responding. I have been really busy in the past few days.
Offline