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
.
.
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 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)
~
# locate mod_rewrite.so
> /usr/lib/apache2/modules/mod_rewrite.so
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
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)