logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).

#1 21-10-2018 09:39:04

lagrenouille
CA Debian-Facile
Lieu : Toulouse
Distrib. : bookworm
Noyau : d'olive
(G)UI : xfce4 et awesome
Inscription : 28-03-2012
Site Web

résolu par rm -rf :problème CMS Spip en local

bonjour

je n'arrive pas à régler un c'htiot problème, c'est pourquoi je mets toute ma configuration, (concernant ce site en local) sur ce post

== je pense que j'ai tout mis==========même un faux password big_smilelol
.
.
suite à une installation  du cms "spip" en local:

message, que j'ai parfois (et pas tout le temps puisque je continue à me servir du site)

forbiden
> You don't have permission to access /spipounet/ecrire/ on this server.
> Apache/2.4.25 (Debian) Server at localhost Port 80qand les fichiers sont crées
>



donc spip ne peut pas écrire ses fichiers (du moins apache)

-* {{je  verifie}}

-# Que j'appartient bien au groupe www-data

momo@agamemnon:~$ groups


momo cdrom floppy audio dip www-data video plugdev netdev lpadmin scanner



-# J'ouvre phpmyadmin et dans la table user, j'ai bien

Nom d'utilisateur     Nom d'hôte     Type Privilèges «Grant»     Action
    root     localhost     global     |ALL PRIVILEGES| Oui     Changer les privilèges Changer les privilèges <http://localhost/phpmyadmin/server_privileges.php?username=root&hostname=localhost&dbname=&tablename=&routinename=&token=07dc8ec399fxxxxxxxxxxxxxxxxxxxa5ddce9a>




-# en console, je tape

msql -u root -p -e "show databases;"


+--------------------+
| Database           |
+--------------------+
| galette            |
| information_schema |
| mysql              |
| performance_schema |
| phpmyadmin         |
| spipounet          |
+--------------------+


~
-# les droits

# chown -R momo:www-data spipounet
# chown -R momo:www-data spipounet/
# chmod -R 770 spipounet/



si ça merde  j'essaie 755 mais c'est pas normal ( j'essaie même tous les droits puisque c'est en local, mais je sais, faut pas le faire)



-* le problème ne vient pas de mysql, voir et mettre le mode de réécriture  pour apache, que le  mod_rewrite de apache2 soit bien activé pour le vhost .

-* En effet apache fonctionne en tant que www-data. Il faut donc que www-data puisse lire les fichiers et répertoires du site web, et il faut que www-data puisse les modifier s'il y a des trucs à écrire (tmp de spip par exemple, ou local).
Ces fichiers sont créés dynamiquement et si c'est pas possible d'écrire ça coince forcemenvt
~
-* je cherche le module avec locate  (je mets a jour la base avant, en root)
~

updatedb


# locate mod_rewrite.so
> /usr/lib/apache2/modules/mod_rewrite.so




a2enmod rewrite


Enabling module rewrite.
To activate the new configuration, you need to run:
  systemctl restart apache2



systemctl restart apache2



-* PS: Si le fichier /etc/apache2/mods-available/rewrite.load n'existe pas, il vous suffit d'utiliser la commande suivante.
<code>
command

 echo "LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so" > /etc/apache2/mods-available/rewrite.load
a2enmod rewrite
</code>
~



le module se trouve bien maintenant dans  /etc/apache2/mods-available/

extrait:
-rw-r--r-- 1 root root   68 mars  30  2018 remoteip.load
-rw-r--r-- 1 root root 1,2K mars  30  2018 reqtimeout.conf
-rw-r--r-- 1 root root   72 mars  30  2018 reqtimeout.load
-rw-r--r-- 1 root root   66 mars  30  2018 request.load
-rw-r--r-- 1 root root   66 mars  30  2018 rewrite.load
-rw-r--r-- 1 root root   58 mars  30  2018 sed.load
-rw-r--r-- 1 root root   99 mars  30  2018 session_cookie.load
-rw-r--r-- 1 root root   99 mars  30  2018 session_crypto.load
-rw-r--r-- 1 root root   93 mars  30  2018 session_dbd.load
-rw-r--r-- 1 root root   66 mars  30  2018 session.load

-Je me rajoute  utilisateur mysql(comme root)


root@agamemnon:/home/momo/WEB# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 729
Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE USER 'momo'@'localhost' IDENTIFIED BY 'fstcoincoinifi';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON * . * TO 'momo'@'localhost';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye






root@agamemnon:/home/momo/WEB# sync

root@agamemnon:/home/momo/WEB# /etc/init.d/apache2 restart
[ ok ] Restarting apache2 (via systemctl): apache2.service.

root@agamemnon:/home/momo/WEB# /etc/init.d/mysql restart
[ ok ] Restarting mysql (via systemctl): mysql.service.
~




-* je desactive escal pour voir et vlan
-* -* page blanche, "vous n'avez pas les droits pour ecrire sur ce serveur"
-*  je rêve
~
Forbidden
You don't have permission to access /spipounet/spip.php on this server.
Apache/2.4.25 (Debian) Server at localhost Port 80
~
-* et pourtant dans phpinfo

    Configuration
    apache2handler

Apache Version     Apache/2.4.25 (Debian)
Apache API Version     20120211
Server Administrator     webmaster@localhost
Hostname:Port     localhost:80
User/Group     www-data(33)/33
Max Requests     Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts     Connection: 300 - Keep-Alive: 5
Virtual Server     Yes
Server Root     /etc/apache2
Loaded Modules     core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_alias mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_host mod_authz_user mod_autoindex mod_deflate mod_dir mod_env mod_evasive20 mod_filter mod_mime prefork mod_negotiation mod_php7 mod_reqtimeout mod_rewrite mod_setenvif mod_status


    Apache Environment
SERVER_NAME     localhost
SERVER_ADDR     ::1
SERVER_PORT     80
REMOTE_ADDR     ::1
DOCUMENT_ROOT     /var/www/html
REQUEST_SCHEME     http
CONTEXT_PREFIX     no value
CONTEXT_DOCUMENT_ROOT     /var/www/html
SERVER_ADMIN     webmaster@localhost
SCRIPT_FILENAME     /var/www/html/phpinfo.php
REMOTE_PORT     33776
GATEWAY_INTERFACE     CGI/1.1
SERVER_PROTOCOL     HTTP/1.1
REQUEST_METHOD     GET
QUERY_STRING     no value
REQUEST_URI     /phpinfo.php
SCRIPT_NAME     /phpinfo.php
~
~
et enfin

momo@agamemnon:~$ ls -lha /var/www/html/


total 20K
drwxr-xr-x  4 root root     4,0K oct.  21 01:46 .
drwxr-xr-x  3 root root     4,0K avril 20  2018 ..
drwxrwxr-x  4 momo      500 4,0K sept. 25 01:02 galette
-rw-r--r--  1 momo www-data   23 oct.  21 01:46 phpinfo.php
drwxrwxrwx 13 momo www-data 4,0K oct.   6 16:46 spipounet



ls -lha spipounet/


total 116K
drwxrwxrwx 13 momo www-data 4,0K oct.   6 16:46 .
drwxr-xr-x  4 root root     4,0K oct.  21 01:46 ..
drwxrwxrwx  2 momo www-data 4,0K oct.   6 17:24 config
-rwxrwxrwx  1 momo www-data  35K oct.   6 16:40 COPYING.txt
drwxrwxrwx 21 momo www-data 4,0K oct.   6 21:20 ecrire
-rwxrwxrwx  1 momo www-data 5,2K oct.   6 16:40 htaccess.txt
drwxrwxrwx  4 momo www-data 4,0K oct.  11 23:00 IMG
-rwxrwxrwx  1 momo www-data   42 oct.   6 16:40 index.php
-rwxrwxrwx  1 momo www-data  425 oct.   6 16:40 INSTALL.txt
drwxrwxrwx  3 momo www-data 4,0K oct.   6 17:39 lib
drwxrwxrwx  8 momo www-data 4,0K oct.  20 18:22 local
drwxrwxrwx  3 momo www-data 4,0K oct.   6 17:26 plugins
drwxrwxrwx 27 momo www-data 4,0K oct.   6 16:40 plugins-dist
drwxrwxrwx 12 momo www-data 4,0K oct.   6 16:40 prive
-rwxrwxrwx  1 momo www-data 1,1K oct.   6 16:40 spip.php
-rwxrwxrwx  1 momo www-data 1,2K oct.   6 16:40 spip.png
drwxrwxrwx  6 momo www-data 4,0K oct.   7 08:37 squelettes
drwxrwxrwx 10 momo www-data 4,0K oct.   6 16:40 squelettes-dist
-rwxrwxrwx  1 momo www-data  301 oct.   6 16:40 svn.revision
drwxrwxrwx  7 momo www-data 4,0K oct.  21 01:31 tmp


ls -lha spipounet/ecrire/


total 208K
drwxrwxrwx 21 momo www-data 4,0K oct.   6 21:20 .
drwxrwxrwx 13 momo www-data 4,0K oct.   6 16:46 ..
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 action
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 auth
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 balise
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 base
-rwxrwxrwx  1 momo www-data  11K oct.   6 16:40 CHANGELOG.txt
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 charsets
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 exec
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 genie
-rwxrwxrwx  1 momo www-data  26K oct.   6 16:40 gnu_lgpl_fr.txt
-rwxrwxrwx  1 momo www-data  25K oct.   6 16:40 gpl_fr.txt
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 inc
-rwxrwxrwx  1 momo www-data  18K oct.   6 16:40 inc_version.php
-rwxrwxrwx  1 momo www-data 5,8K oct.   6 16:40 index.php
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 install
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 iterateur
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 lang
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 maj
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 notifications
-rwxrwxrwx  1 momo www-data  12K oct.   6 16:40 paquet.xml
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 plugins
-rwxrwxrwx  1 momo www-data 1,5K oct.   6 16:40 prive.php
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 public
-rwxrwxrwx  1 momo www-data 6,7K oct.   6 16:40 public.php
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 req
-rwxrwxrwx  1 momo www-data   63 oct.   6 16:40 rien.gif
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 typographie
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 urls
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 xml
 



cat /etc/apache2/sites-enabled/000-default.conf
<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

  # 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

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

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






.
Là je crois que tout est dis, reste à trouver l'erreur

manque it un paquet deb ??? je sais pas

Dernière modification par lagrenouille (24-10-2018 16:23:53)


Ce à quoi l'on a pas accès par l'expérience vécue, on a pas d'oreilles pour l'entendre ..Nietzsche
Cela dit, bien que toute notre connaissance s’amorce avec l’expérience, il n’en résulte pas pour autant qu’elle découle dans sa totalité de l’expérience.  E.Kant
une compréhension insane est elle forcément irrationnel ? ..lagrenouille

En ligne

#2 21-10-2018 13:07:31

Freemaster
Membre
Lieu : Nord
Distrib. : Debian amd64
Inscription : 31-07-2018
Site Web

Re : résolu par rm -rf :problème CMS Spip en local

alors je vois un mod_php7 dans load_modules...

donc

chown -R www-data: /var/www/html/spipounet/ecrire


est suffisant pour régler le problème de droit


o_O

Hors ligne

#3 21-10-2018 13:13:42

lagrenouille
CA Debian-Facile
Lieu : Toulouse
Distrib. : bookworm
Noyau : d'olive
(G)UI : xfce4 et awesome
Inscription : 28-03-2012
Site Web

Re : résolu par rm -rf :problème CMS Spip en local

ben, et ça


ls -lha /var/www/html/spipounet/ecrire


total 208K
drwxrwxrwx 21 momo www-data 4,0K oct.   6 21:20 .
drwxrwxrwx 13 momo www-data 4,0K oct.   6 16:46 ..
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 action
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 auth
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 balise
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 base
-rwxrwxrwx  1 momo www-data  11K oct.   6 16:40 CHANGELOG.txt
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 charsets
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 exec
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 genie
-rwxrwxrwx  1 momo www-data  26K oct.   6 16:40 gnu_lgpl_fr.txt
-rwxrwxrwx  1 momo www-data  25K oct.   6 16:40 gpl_fr.txt
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 inc
-rwxrwxrwx  1 momo www-data  18K oct.   6 16:40 inc_version.php
-rwxrwxrwx  1 momo www-data 5,8K oct.   6 16:40 index.php
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 install
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 iterateur
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 lang
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 maj
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 notifications
-rwxrwxrwx  1 momo www-data  12K oct.   6 16:40 paquet.xml
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 plugins
-rwxrwxrwx  1 momo www-data 1,5K oct.   6 16:40 prive.php
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 public
-rwxrwxrwx  1 momo www-data 6,7K oct.   6 16:40 public.php
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 req
-rwxrwxrwx  1 momo www-data   63 oct.   6 16:40 rien.gif
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 typographie
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 urls
drwxrwxrwx  2 momo www-data 4,0K oct.   6 16:40 xml
 



Edit à toto : Séparer la commande de son retour est plus lisible par les débutants.


Ce à quoi l'on a pas accès par l'expérience vécue, on a pas d'oreilles pour l'entendre ..Nietzsche
Cela dit, bien que toute notre connaissance s’amorce avec l’expérience, il n’en résulte pas pour autant qu’elle découle dans sa totalité de l’expérience.  E.Kant
une compréhension insane est elle forcément irrationnel ? ..lagrenouille

En ligne

#4 21-10-2018 14:02:45

lagrenouille
CA Debian-Facile
Lieu : Toulouse
Distrib. : bookworm
Noyau : d'olive
(G)UI : xfce4 et awesome
Inscription : 28-03-2012
Site Web

Re : résolu par rm -rf :problème CMS Spip en local

j'ai essayé de passer le répertoire écrire en www-data,  puis en root.....
ça merde toujours
je vais réduire les droits à 770 pour voir à nouveau ... et...et

je vais tout désinstaller et je réinstallerai plus tard, ça me gonfle trop


je viens d'avoir un email d'une personne qui me dit avoir le même problème sous linux

je commence à penser à un bug

je modifie les droits car à 770  spip bloque

chmod -R 755  spipounet
chmod -R 755  spipounet/
chmod -R 777  spipounet/tmp/
chmod -R 777  spipounet/local/


bloc à supprimer si la commande n’affiche rien



et la spip ne peut plus charger de plugin
repertoire plugins/auto innaccessible

je rêve' encore

ls -lha spipounet/plugins/auto/
total 72K
drwxr-xr-x 18 momo     www-data 4,0K oct.  21 14:55 .
drwxr-xr-x  3 momo     www-data 4,0K oct.   6 17:26 ..
drwxr-xr-x  3 momo     www-data 4,0K oct.   6 17:30 adminer
drwxr-xr-x  3 momo     www-data 4,0K oct.   6 17:28 agenda
drwxr-xr-x  3 momo     www-data 4,0K oct.   6 17:28 calendriermini
drwxr-xr-x 12 momo     www-data 4,0K oct.  10 09:42 cibloc
drwxr-xr-x  3 momo     www-data 4,0K oct.   6 21:59 corbeille
drwxr-xr-x  3 momo     www-data 4,0K oct.   6 22:01 couleurs_spip
drwxr-xr-x  4 www-data www-data 4,0K oct.  21 14:59 escal
drwxr-xr-x  3 momo     www-data 4,0K oct.   6 22:02 galleria
drwxr-xr-x  3 momo     www-data 4,0K oct.   6 17:39 mediaspip_player
drwxr-xr-x  3 www-data www-data 4,0K oct.  21 11:21 modelexergue
drwxr-xr-x  3 www-data www-data 4,0K oct.  11 23:24 pdfjs
drwxr-xr-x  3 www-data www-data 4,0K oct.  12 17:13 sjcycle
drwxr-xr-x  3 momo     www-data 4,0K oct.   7 08:37 skeleditor
drwxr-xr-x  3 www-data www-data 4,0K oct.  20 18:22 supersized
drwxr-xr-x  3 momo     www-data 4,0K oct.   6 21:59 typoenluminee
drwxr-xr-x  3 www-data www-data 4,0K oct.  21 11:21 videos


bloc à supprimer si la commande n’affiche rien




ça reclame du 777 comme tmp et locale
et c'est pas normal


je remets tout a:

chown -R www-data:www-data spipounet
chown -R www-data:www-data spipounet/
 

Dernière modification par lagrenouille (21-10-2018 14:24:37)


Ce à quoi l'on a pas accès par l'expérience vécue, on a pas d'oreilles pour l'entendre ..Nietzsche
Cela dit, bien que toute notre connaissance s’amorce avec l’expérience, il n’en résulte pas pour autant qu’elle découle dans sa totalité de l’expérience.  E.Kant
une compréhension insane est elle forcément irrationnel ? ..lagrenouille

En ligne

#5 21-10-2018 15:51:37

Freemaster
Membre
Lieu : Nord
Distrib. : Debian amd64
Inscription : 31-07-2018
Site Web

Re : résolu par rm -rf :problème CMS Spip en local

chown -R www-data:www-data spipounet


équivaut à

chown -R www-data: spipounet


o_O

Hors ligne

#6 21-10-2018 15:51:55

lagrenouille
CA Debian-Facile
Lieu : Toulouse
Distrib. : bookworm
Noyau : d'olive
(G)UI : xfce4 et awesome
Inscription : 28-03-2012
Site Web

Re : résolu par rm -rf :problème CMS Spip en local

cool

Dernière modification par lagrenouille (24-10-2018 16:22:40)


Ce à quoi l'on a pas accès par l'expérience vécue, on a pas d'oreilles pour l'entendre ..Nietzsche
Cela dit, bien que toute notre connaissance s’amorce avec l’expérience, il n’en résulte pas pour autant qu’elle découle dans sa totalité de l’expérience.  E.Kant
une compréhension insane est elle forcément irrationnel ? ..lagrenouille

En ligne

Pied de page des forums