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 2020-11-26 02:04:33

mikka66
Member
Registered: 2020-11-24
Posts: 10

My server does not have write access to my glpi folder

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

#2 2020-11-26 19:29:14

fabianoantunes
Member
Registered: 2013-05-29
Posts: 16

Re: My server does not have write access to my glpi folder

mikka66 wrote:

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

#3 2020-11-26 22:50:30

mikka66
Member
Registered: 2020-11-24
Posts: 10

Re: My server does not have write access to my glpi folder

I run the php script via the web browser for example:    example.com/glpi/install/install.php

Offline

#4 2020-11-27 10:19:05

mklimasz
Member
Registered: 2017-12-14
Posts: 82

Re: My server does not have write access to my glpi folder

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 smile Just beware where You'd run this command, thou (definitely not on root).

Offline

#5 2020-11-27 14:38:15

mikka66
Member
Registered: 2020-11-24
Posts: 10

Re: My server does not have write access to my glpi folder

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

#6 2020-11-27 15:54:51

mklimasz
Member
Registered: 2017-12-14
Posts: 82

Re: My server does not have write access to my glpi folder

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

#7 2020-11-27 16:45:15

mikka66
Member
Registered: 2020-11-24
Posts: 10

Re: My server does not have write access to my glpi folder

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

#8 2020-11-27 16:48:05

mklimasz
Member
Registered: 2017-12-14
Posts: 82

Re: My server does not have write access to my glpi folder

The command should be that one (the one above contains one unnecessary space):
sudo chown -R www-data:www-data *

Offline

#9 2020-11-27 16:57:49

mikka66
Member
Registered: 2020-11-24
Posts: 10

Re: My server does not have write access to my glpi folder

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  hmm

Offline

#10 2020-11-27 17:00:18

fabianoantunes
Member
Registered: 2013-05-29
Posts: 16

Re: My server does not have write access to my glpi folder

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

#11 2020-12-02 20:20:59

mikka66
Member
Registered: 2020-11-24
Posts: 10

Re: My server does not have write access to my glpi folder

I ran these 3 commands but unfortunately I still have the 403 error: /

Does anyone have the solution?

Offline

#12 2020-12-03 17:14:13

fabianoantunes
Member
Registered: 2013-05-29
Posts: 16

Re: My server does not have write access to my glpi folder

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

#13 2020-12-03 20:28:48

mikka66
Member
Registered: 2020-11-24
Posts: 10

Re: My server does not have write access to my glpi folder

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

#14 2020-12-03 21:09:29

fabianoantunes
Member
Registered: 2013-05-29
Posts: 16

Re: My server does not have write access to my glpi folder

mikka66 wrote:

sudo ls /path/to/glpi   return   :  This is missing the ld parameter
It should be
ls -ld /path/to/glpi

sudo 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

#15 2020-12-03 21:32:22

mikka66
Member
Registered: 2020-11-24
Posts: 10

Re: My server does not have write access to my glpi folder

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

#16 2020-12-04 21:15:43

mikka66
Member
Registered: 2020-11-24
Posts: 10

Re: My server does not have write access to my glpi folder

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

#17 2020-12-08 00:41:40

mklimasz
Member
Registered: 2017-12-14
Posts: 82

Re: My server does not have write access to my glpi folder

OK, another thought - have You checked if all necessary modules are installed?

https://glpi-install.readthedocs.io/en/ … sites.html

Offline

#18 2020-12-14 20:30:38

fabianoantunes
Member
Registered: 2013-05-29
Posts: 16

Re: My server does not have write access to my glpi folder

mikka66 wrote:

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

Board footer

Powered by FluxBB