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).

#26 03-04-2022 10:09:10

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Bonjour à tous smile

Ben... je ne suis pas doué, hein ? C'est pas franchement un forbiden, mais le client owncloud ne peut pas se connecter, et, sur le serveur, j'arrive à une page blanche en tapant l'IP locale dans Firefox.

Le fstab :


# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=4b0c937b-eb1c-46b9-bed9-23932e9c6943 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=4abdeb87-995c-4045-82d5-9a04536a52d6 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
LABEL=DATA  /mnt  ext4  defaults  0 0
#LABEL=DONNEES  /mnt/DONNEES  ext4  defaults  0 0
LABEL=DONNEES /srv  ext4  defaults  0 0  <<== Pas /srv/data : j'ai tenté le coup, mais ça ne change rien.
 




df :


Sys. de fichiers blocs de 1K  Utilisé Disponible Uti% Monté sur
udev                 8009728        0    8009728   0% /dev
tmpfs                1607200     9384    1597816   1% /run
/dev/sda1           98664624  8015392   85594308   9% /
tmpfs                8035996     7864    8028132   1% /dev/shm
tmpfs                   5120        4       5116   1% /run/lock
tmpfs                8035996        0    8035996   0% /sys/fs/cgroup
/dev/sdb3          295941968   278464  280560888   1% /srv
/dev/sdb1          256614804 24506384  219003424  11% /mnt
tmpfs                1607196       16    1607180   1% /run/user/0
 




apache2.conf :



<Directory />
  Options FollowSymLinks
  AllowOverride None
  Require all denied
</Directory>

<Directory /usr/share>
  AllowOverride None
  Require all granted
</Directory>

<Directory /var/www/>
  # ==>> pour éviter le warning de apache2ctl -S
    #Options Indexes FollowSymLinks MultiViews
 
  AllowOverride all
 
  # Require all granted
    Satisfy Any
   
</Directory>

<Directory /srv/data/>
  # ==>> pour éviter le warning de apache2ctl -S
  # Options Indexes FollowSymLinks

  AllowOverride all
  # Require all granted
   
    Satisfy Any
  #AllowOverride None

  # A décommenter peut-être ?
  #Require all granted
   
</Directory>
 






Le config.php :

<?php
$CONFIG = array (
  'instanceid' => 'oc3204klngo7',
  'passwordsalt' => 'lS1yqxqIhEwp7wIIJxrPmpDhJXYMAm',
  'secret' => 'vshQa4xHcoibxnA8i1u0I4UwOWJLsK+TWEaK/Dpu4hAQ/huR',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.168.0.51',
    2 => 'IP publique',
  ),
  #'datadirectory' => '/var/www/owncloud/data',
  'datadirectory' => '/srv/data/',
  'overwrite.cli.url' => 'http://192.168.0.51',
  'dbtype' => 'mysql',
  'version' => '10.9.1.2',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost:3306',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_root',
  'dbpassword' => 'SY4eaUPESfo5lCM0dEt/WUzm22Q1qF',
  'allow_user_to_change_mail_address' => '',
  'logtimezone' => 'UTC',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/owncloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/owncloud/apps-external',
      'url' => '/apps-external',
      'writable' => true,
    ),
  ),
  'installed' => true,
  'forcessl' => true,
 
);

 




Le virtual host de owncloud :


<VirtualHost *:443>
#    DocumentRoot /var/www/owncloud/
    DocumentRoot /srv/data
    # Activation du mode SSL
    SSLEngine On
    SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire

    # On indique ou est le certificat
    SSLCertificateFile /etc/ssl/certs/owncloud.pem
    SSLCertificateKeyFile /etc/ssl/private/owncloud.key

# A désactiver éventuellement
      RewriteEngine on
      RewriteCond %{HTTPS} !on
      RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

</VirtualHost>

# Voir éventuellement fichier owncloud-ssl.txt

 



J'ai vérifié les droits de www-dat : il possède tout le /srv/data

sad

Hors ligne

#27 03-04-2022 10:25:56

raleur
Membre
Inscription : 03-10-2014

Re : [RESOLU]Owncloud : déplacement du dossier data

Il n'y avait pas un répertoire intermédiaire "ocdata" à la racine de DONNEES ?

Il vaut mieux montrer que raconter.

Hors ligne

#28 03-04-2022 12:36:32

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Non. Je l'ai supprimé.
Est-ce une erreur ?

Hors ligne

#29 03-04-2022 13:01:18

raleur
Membre
Inscription : 03-10-2014

Re : [RESOLU]Owncloud : déplacement du dossier data

Je n'en sais rien, je ne connais pas owncloud. Il n'y avait rien dedans ?

Il vaut mieux montrer que raconter.

Hors ligne

#30 03-04-2022 13:18:15

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Il y avait le fameux dossier data de owncloud.
Je suis revenu en arrière, et refait le déplacement.

Mais, tests effectués, ça ne change rien : pas d'accès à owncloud côté serveur. Page blanche.
Ca ressemble à un problème de droits, ça...
Quelque chose dans un fichier de configuration : un path incorrect. Ou des droits mal définis dans le vhost ou apache2.conf.

On m'avait conseillé ceci :


<VirtualHost *:443>
#    DocumentRoot /var/www/owncloud/
    DocumentRoot /srv/ocdata/data
    # Activation du mode SSL
    SSLEngine On
    SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire

    # On indique ou est le certificat
    SSLCertificateFile /etc/ssl/certs/owncloud.pem
    SSLCertificateKeyFile /etc/ssl/private/owncloud.key


# [b]A désactiver éventuellement[/b]
      RewriteEngine on
      RewriteCond %{HTTPS} !on
      RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

</VirtualHost>


 




Là, je vais refaire le montage sitôt revenu chez moi.
C'est très bizarre...

Dernière modification par Lupa (03-04-2022 13:18:52)

Hors ligne

#31 03-04-2022 13:49:03

dejieres
Membre
Lieu : Moselle
Distrib. : Bookworm 64 bits
(G)UI : GNOME
Inscription : 07-02-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Lupa a écrit :

# DocumentRoot /var/www/owncloud/
    DocumentRoot /srv/ocdata/data


Je pense que là, ça ne va pas... Le DocumentRoot doit pointer sur le dossier d'installation de OC, donc probablement /var/www/owncloud. Ce qui pourrait expliquer la page blanche, puisqu'apache ne trouve rien à afficher dans /srv/ocdata/data

Le répertoire data d'OC, comme son nom l'indique, ne contient que les fichiers des utilisateurs. Il n'est jamais mentionné dans les fichiers d'apache, il n'y a que le fichier config.php qui y fait référence par l'intermédiaire de la variable datadirectory.

À moins que toute ton installation OC ne se trouve sur sdb3 ?

Hors ligne

#32 03-04-2022 17:51:23

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Salut !

Non, non : il est bien dans /var/www/owncloud

Mais tu m'éclaires... Je vais tester ça. Là, je rentre.
Je donne le retour, après le nouveau déplacement, ET avec tes conseils.

Hors ligne

#33 03-04-2022 18:19:39

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Forbidden sad

J'ai activé a2enmod rewrite, ainsi que conseillé dans le tuto que j'ai suivi.
Je n'ai plus mentionné le répertoire data de owncloud dans apache2.conf . C'est pourtant ce que j'avais fait sur l'ancien serveur, et ça marchait. Enfin : sur lke /media.

Ca devient dur, là wink

Le fstab :




# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=4b0c937b-eb1c-46b9-bed9-23932e9c6943 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=4abdeb87-995c-4045-82d5-9a04536a52d6 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
LABEL=DATA  /mnt  ext4  defaults  0 0
#LABEL=DONNEES  /mnt/DONNEES  ext4  defaults  0 0
LABEL=DONNEES /srv/ocdata ext4  resuid=33 0 0

 



df :


Sys. de fichiers blocs de 1K  Utilisé Disponible Uti% Monté sur
udev                 8009728        0    8009728   0% /dev
tmpfs                1607200     9380    1597820   1% /run
/dev/sda1           98664624  6854828   86754872   8% /
tmpfs                8035996    21852    8014144   1% /dev/shm
tmpfs                   5120        4       5116   1% /run/lock
tmpfs                8035996        0    8035996   0% /sys/fs/cgroup
/dev/sdb1          256614804 25119128  218390680  11% /mnt
/dev/sdb3          295941968   278456  280560896   1% /srv/ocdata
tmpfs                1607196       16    1607180   1% /run/user/0
 




apache2.conf :



<Directory />
  Options FollowSymLinks
  AllowOverride None
  Require all denied
</Directory>

<Directory /usr/share>
  AllowOverride None
  Require all granted
</Directory>

<Directory /var/www/>
  # ==>> pour éviter le warning de apache2ctl -S
    #Options Indexes FollowSymLinks MultiViews
 
  AllowOverride all
 
  # Require all granted
    Satisfy Any
   
</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess   <<== [b]Pas de path absolu ?[/b]

 





Le config.php :



<?php
$CONFIG = array (
  'instanceid' => 'oc3204klngo7',
  'passwordsalt' => 'lS1yqxqIhEwp7wIIJxrPmpDhJXYMAm',
  'secret' => 'vshQa4xHcoibxnA8i1u0I4UwOWJLsK+TWEaK/Dpu4hAQ/huR',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.168.0.51',
    2 => 'IP publique',
  ),
  'datadirectory' => '/srv/ocdata/data',
  'overwrite.cli.url' => 'http://192.168.0.51',
  'dbtype' => 'mysql',
  'version' => '10.9.1.2',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost:3306',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_root',
  'dbpassword' => 'SY4eaUPESfo5lCM0dEt/WUzm22Q1qF',
  'allow_user_to_change_mail_address' => '',
  'logtimezone' => 'UTC',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/owncloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/owncloud/apps-external',
      'url' => '/apps-external',
      'writable' => true,
    ),
  ),
  'installed' => true,
  'forcessl' => true,
 
);

 




Le virtual host de owncloud :


<VirtualHost *:443>
#    DocumentRoot /var/www/owncloud/
    DocumentRoot /srv/ocdata/data/
    # Activation du mode SSL
    SSLEngine On
    SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire

    # On indique ou est le certificat
    SSLCertificateFile /etc/ssl/certs/owncloud.pem
    SSLCertificateKeyFile /etc/ssl/private/owncloud.key

# A désactiver éventuellement
      RewriteEngine on
      RewriteCond %{HTTPS} !on
      RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

</VirtualHost>

# Voir éventuellement fichier owncloud-ssl.txt

 

Hors ligne

#34 03-04-2022 18:25:31

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Mais Oh ! là ! là!!
Regardez-moi ces logs d'apache :


[Sun Apr 03 19:07:54.124679 2022] [mpm_prefork:notice] [pid 1575] AH00169: caught SIGTERM, shutting down
[Sun Apr 03 19:20:46.318172 2022] [ssl:warn] [pid 2823] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 03 19:20:46.340807 2022] [ssl:warn] [pid 2824] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 03 19:20:46.344919 2022] [mpm_prefork:notice] [pid 2824] AH00163: Apache/2.4.38 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Sun Apr 03 19:20:46.344953 2022] [core:notice] [pid 2824] AH00094: Command line: '/usr/sbin/apache2'
[Sun Apr 03 19:21:01.823369 2022] [mpm_prefork:notice] [pid 2824] AH00169: caught SIGTERM, shutting down
[Sun Apr 03 19:21:28.275177 2022] [ssl:warn] [pid 791] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 03 19:21:28.400872 2022] [ssl:warn] [pid 807] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 03 19:21:28.404708 2022] [mpm_prefork:notice] [pid 807] AH00163: Apache/2.4.38 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Sun Apr 03 19:21:28.404736 2022] [core:notice] [pid 807] AH00094: Command line: '/usr/sbin/apache2'
[Sun Apr 03 19:22:05.773421 2022] [authz_core:error] [pid 811] [client 192.168.0.51:47652] AH01630: client denied by server configuration: /srv/ocdata/data/
[Sun Apr 03 19:22:05.847851 2022] [authz_core:error] [pid 811] [client 192.168.0.51:47652] AH01630: client denied by server configuration: /srv/ocdata/data/favicon.ico, referer: https://192.168.0.51/

 



Je vais chercher ce qu'est cette erreur AH01630.

Hors ligne

#35 03-04-2022 18:27:59

dejieres
Membre
Lieu : Moselle
Distrib. : Bookworm 64 bits
(G)UI : GNOME
Inscription : 07-02-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Lupa a écrit :

<VirtualHost *:443>
#    DocumentRoot /var/www/owncloud/
    DocumentRoot /srv/ocdata/data/


À priori, c'est là que ça coince... Décommente la première ligne, et supprime la seconde. Le DocumentRoot doit pointer sur le dossier d'installation, pas sur les données.

Hors ligne

#36 03-04-2022 19:14:01

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Je prends note wink

Et puis j'ai saisi ceci:


root@1150-SRV:~# apache2 --help
[Sun Apr 03 19:31:30.111388 2022] [core:warn] [pid 2435] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 97 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
 



Pour connaître ma version d'Apache. Je questionne apache. Et il m'a retourné ça ! Malgré un


root@1150-SRV:~# apache2ctl configtest
Syntax OK
 



En fait, c'est ET le owncloud.conf ET apache2.conf que je dois modifier.

Ici : https://httpd.apache.org/docs/2.4/upgrading.html

Beaucoup d'explications !!

Ce qui marchait avec une version plus ancienne d'Apache ne fonctionne plus maintenant !

La voici, ma version d'Apache :


root@1150-SRV:~# apache2ctl -v
Server version: Apache/2.4.38 (Debian)
Server built:   2021-12-21T16:50:43
 



Je vais potasser ça.

Je suis un peu fatigué, là, mais je sens que je ne suis pas loin du but...

Hors ligne

#37 04-04-2022 09:36:56

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Bonjour à tous.

@dejieres : j'ai modifié le owncloud.conf selon test conseils :


<VirtualHost *:443>
    DocumentRoot /var/www/owncloud/
#    DocumentRoot /srv/ocdata/
    # Activation du mode SSL
    SSLEngine On
    SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire

    # On indique ou est le certificat
    SSLCertificateFile /etc/ssl/certs/owncloud.pem
    SSLCertificateKeyFile /etc/ssl/private/owncloud.key

# Conseillé par Allan :
# A désactiver éventuellement
      RewriteEngine on
      RewriteCond %{HTTPS} !on
      RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

</VirtualHost>


 



Si je mets : DocumentRoot /srv/ocdata/  ==>> j'arrive sur un indexoff, côté serveur, et pas d'accès du tout côté client.


Plus de forbidden mais... les données envoyées sur le serveur par le client arrivent... sur l'ancien /var/www/owncloud/data sad
Et pas sur le /srv/ocdata/data ! Comme si je n'avais pas déplacé de dossier data...

Mon apache2.conf :


# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `--  ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf-enabled
# | `-- *.conf
#   `-- sites-enabled
#   `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.


# Global configuration

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.

# TRADUCTION :
# ServerRoot : le sommet de l'arborescence de répertoires sous lequel le serveur
# les fichiers de configuration, d'erreur et de journal sont conservés.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
# ServerRoot : le sommet de l'arborescence de répertoires sous lequel le serveur
# les fichiers de configuration, d'erreur et de journal sont conservés.

# TRADUCTION :

# REMARQUE! Si vous avez l'intention de le placer sur un NFS (ou autre réseau)
# système de fichiers monté, veuillez lire la documentation Mutex (disponible
# à <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# vous vous épargnerez bien des ennuis.
#
# N'ajoutez PAS de barre oblique à la fin du chemin du répertoire.#

# TEST du 28 mars : décommenté la ligne suivante :
# TEST du 29 mars : re-commenté la ligne suivante :
ServerRoot "/etc/apache2"
ServerName localhost

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default

#
# The directory where shm and other runtime files will be stored.
#
DefaultRuntimeDir ${APACHE_RUN_DIR}

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
#TRADUCTION
# HostnameLookups : enregistrez les noms des clients ou uniquement leurs adresses IP
# par exemple, www.apache.org (activé) ou 204.62.129.132 (désactivé).
# La valeur par défaut est off car ce serait globalement mieux pour le net si les gens
# devait sciemment activer cette fonctionnalité, car l'activer signifie que
# chaque requête client entraînera AU MOINS une requête de recherche vers le
# nom du serveur.

#HostnameLookups Off
#HostnameLookups On
# Rajouté ceci :
#HostnameLookups 82.66.155.194
HostnameLookups On

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf


# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.

<Directory />
  Options FollowSymLinks
  AllowOverride None
  Require all denied
</Directory>

<Directory /usr/share>
  AllowOverride None
  Require all granted
</Directory>

<Directory /var/www/>
  Options Indexes FollowSymLinks
  AllowOverride None
  Require all granted
 
  # ==>> pour éviter le warning de apache2ctl -S
        #Options Indexes FollowSymLinks MultiViews
# AllowOverride all
  # Require all granted
        #Satisfy Any
</Directory>

<Directory /srv/>
  Options Indexes FollowSymLinks
  AllowOverride None
  Require all granted
</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
  Require all denied
</FilesMatch>


#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

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

 



Comprends pas...

Dernière modification par Lupa (04-04-2022 09:40:23)

Hors ligne

#38 04-04-2022 11:43:05

dejieres
Membre
Lieu : Moselle
Distrib. : Bookworm 64 bits
(G)UI : GNOME
Inscription : 07-02-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Dans /var/www/owncloud/config/config.php, le datadirectory pointe sur quoi ?

Hors ligne

#39 04-04-2022 11:47:11

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Attends ! Je corrige !
Si et seulement si le vhost est le suivant ça marche. Mais les données arrivent dans /var/www/owncloud/data


<VirtualHost *:443>
    DocumentRoot /var/www/owncloud/
#    DocumentRoot /srv/ocdata/
    # Activation du mode SSL
    SSLEngine On
    SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire

    # On indique ou est le certificat
    SSLCertificateFile /etc/ssl/certs/owncloud.pem
    SSLCertificateKeyFile /etc/ssl/private/owncloud.key

# Conseillé par Allan :
# A désactiver éventuellement
      RewriteEngine on
      RewriteCond %{HTTPS} !on
      RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

</VirtualHost>

# Voir éventuellement fichier owncloud-ssl.txt


 



MAIS si je le fais pointer sur /srv/ocdata/data, le serveur ne fonctionne plus et j'ai ça, côté serveur :

https://cjoint.com/c/LDekYC04Lrj

Dernière modification par Lupa (04-04-2022 11:54:44)

Hors ligne

#40 04-04-2022 11:52:00

dejieres
Membre
Lieu : Moselle
Distrib. : Bookworm 64 bits
(G)UI : GNOME
Inscription : 07-02-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Et df ?

Tu as bien redémarré apache après chaque modification d'un de ses fichiers de configuration ?

Hors ligne

#41 04-04-2022 11:55:47

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data


root@1150-SRV:~# df
Sys. de fichiers blocs de 1K  Utilisé Disponible Uti% Monté sur
udev                 8009728        0    8009728   0% /dev
tmpfs                1607200     9828    1597372   1% /run
/dev/sda1           98664624  7396720   86212980   8% /
tmpfs                8035996     7284    8028712   1% /dev/shm
tmpfs                   5120        4       5116   1% /run/lock
tmpfs                8035996        0    8035996   0% /sys/fs/cgroup
/dev/sdb1          256614804 26555972  216953836  11% /mnt
tmpfs                1607196       40    1607156   1% /run/user/0
/dev/sdb3          295941968    64872  280774480   1% /srv/ocdata

 



Oui. J'ai arrêté Apache, puis l'ai redémarré.

J'oubliais : le apache2.conf : (modifié)


# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `--  ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf-enabled
# | `-- *.conf
#   `-- sites-enabled
#   `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.


# Global configuration

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.

# TRADUCTION :
# ServerRoot : le sommet de l'arborescence de répertoires sous lequel le serveur
# les fichiers de configuration, d'erreur et de journal sont conservés.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
# ServerRoot : le sommet de l'arborescence de répertoires sous lequel le serveur
# les fichiers de configuration, d'erreur et de journal sont conservés.

# TRADUCTION :

# REMARQUE! Si vous avez l'intention de le placer sur un NFS (ou autre réseau)
# système de fichiers monté, veuillez lire la documentation Mutex (disponible
# à <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# vous vous épargnerez bien des ennuis.
#
# N'ajoutez PAS de barre oblique à la fin du chemin du répertoire.#

# TEST du 28 mars : décommenté la ligne suivante :
# TEST du 29 mars : re-commenté la ligne suivante :
ServerRoot "/etc/apache2"
ServerName localhost

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default

#
# The directory where shm and other runtime files will be stored.
#
DefaultRuntimeDir ${APACHE_RUN_DIR}

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
#TRADUCTION
# HostnameLookups : enregistrez les noms des clients ou uniquement leurs adresses IP
# par exemple, www.apache.org (activé) ou 204.62.129.132 (désactivé).
# La valeur par défaut est off car ce serait globalement mieux pour le net si les gens
# devait sciemment activer cette fonctionnalité, car l'activer signifie que
# chaque requête client entraînera AU MOINS une requête de recherche vers le
# nom du serveur.

#HostnameLookups Off
#HostnameLookups On
# Rajouté ceci :
#HostnameLookups 82.66.155.194
HostnameLookups On

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf


# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.

<Directory />
  Options FollowSymLinks
  AllowOverride None
  Require all denied
</Directory>

<Directory /usr/share>
  AllowOverride None
  Require all granted
</Directory>

<Directory /var/www/>
  Options Indexes FollowSymLinks
  AllowOverride None
  Require all granted
 
  # ==>> pour éviter le warning de apache2ctl -S
        #Options Indexes FollowSymLinks MultiViews
# AllowOverride all
  # Require all granted
        #Satisfy Any
</Directory>

<Directory /srv/>
  Options Indexes FollowSymLinks
  AllowOverride None
  Require all granted
</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
  Require all denied
</FilesMatch>


#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

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

 

Dernière modification par Lupa (04-04-2022 11:59:32)

Hors ligne

#42 04-04-2022 12:55:28

raleur
Membre
Inscription : 03-10-2014

Re : [RESOLU]Owncloud : déplacement du dossier data

Lupa a écrit :

Mais les données arrivent dans /var/www/owncloud/data


Tu n'as qu'à monter le disque qui contient les données à cet endroit.

Lupa a écrit :

MAIS si je le fais pointer sur /srv/ocdata/data, le serveur ne fonctionne plus et j'ai ça, côté serveur


Si tu fais pointer quoi ? Apparement le DocumentRoot du virtualhost, alors que dejieres parlait du datadirectory dans config.php.


Il vaut mieux montrer que raconter.

Hors ligne

#43 04-04-2022 13:09:21

Croutons
Membre
Distrib. : Debian12
Noyau : Linux 6.1.0-13-amd64
(G)UI : Fluxbox(NakeDeb)
Inscription : 16-12-2016

Re : [RESOLU]Owncloud : déplacement du dossier data

Hello
s'assurer que les répertoires qui servent de point de montage soit bien vide , sinon les données qu'il contient éventuellement ne seront plus accessible tant que le montage sera actif

-->les cahiers du debutant<--      WikiDF-->Découvrir les principales commandes Linux<-- 
L' expérience, c'est le nom que chacun donne à ses erreurs. Oscar Wilde

Hors ligne

#44 04-04-2022 13:27:08

dejieres
Membre
Lieu : Moselle
Distrib. : Bookworm 64 bits
(G)UI : GNOME
Inscription : 07-02-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Alors, il y a une procédure qui décrit ça ici : https://help.nextcloud.com/t/howto-chan … tion/17170

Une fois le point de montage créé, la partition montée, et le fichier config.php ajusté en conséquence, il faut encore passer une moulinette sur la table oc_storages pour actualiser les chemins.

Si tu n'as pas trop de fichiers, il est aussi possible de passer par la réindexation, mais c'est très long parce que tous les fichiers sont scannés autant de fois qu'il y a d'utilisateurs.

Hors ligne

#45 04-04-2022 20:25:56

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Bonsoir à tous smile
@dejieres : je vois. Il y a plusieurs solutions.

Dont l'une m'est interdite : c'est la commande /var/www/owncloud/occ
Elle exige d'être exécutée par www-data. Or, je ne peux pas. J'ai bien tenté le coup !
Ca marchait sous Jesssie, plus sous Buster. Mystère...


root@1150-SRV:~# su www-data
This account is currently not available.
 



Même en user et du groupe sudo,


1150-SRV:~# su - install
install@1150-SRV:~$ su www-data
Mot de passe :
 



Mais lequel ?
Dois-je lui en attribuer un ? Pour un user système ?

Il y a aussi mention du lien symbolique vers le /srv... Ouais ! Je vais tenter ça aussi. Apparemment, je ne suis pas le seul à rencontrer ce pépin. Confer les forums dans toutes les langues imaginables.

"Passer par la réindexation" : c'est-à-dire ? Quant au temps, il n'y a presque rien dedans, lorsque j'effectue le déplacement, alors... Mais "réindexer", ça, je ne comprends pas bien.

@raleur : Si j'effectue le montage sur le /war.www/owncloud/data  -> les données de mes users arrivaient sur le  sur le SSD système de 120 Go, au lieu d'être sur le /srv/ocdata/data de la partition DONNEES : elle, elle restait vierge hmm Mais je peux bien réessayer.

@Croutons : oui. le /srv/ocdata/data était inexistant. La commande mv a peut-être bien déplacé le dossier data, sur une partition vierge, mais... il fallait peutêtre déjà créer ce /srv/ocdata/data : j'ai peut-re fait une c*** , là...

root@@raleur : j'ai tenté ça, bien sûr, puis que dejieres me l'avait dit. Le serveur fonctionnait... mais il remettait tout dans ce fichu dossier /var/www/owncloud/data. Et rien dans le montage.

Je recommence demain.
Et je donne le retour.

Merci pour votre soutien ! Je ne m'attendais pas du tout à une telle difficulté sur le déplacement du dossier data...

Hors ligne

#46 05-04-2022 07:16:58

dejieres
Membre
Lieu : Moselle
Distrib. : Bookworm 64 bits
(G)UI : GNOME
Inscription : 07-02-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Lupa a écrit :

Elle exige d'être exécutée par www-data

www-data n'est pas un compte interactif (il n'a ni shell, ni home). Tu ne peux donc pas ouvrir de session en tant que www-data.

Par contre, tu peux parfaitement exécuter une commande en son nom

sudo -u www-data php occ...


Lupa a écrit :

Passer par la réindexation

L'élément central dans OC, c'est la base de données. Tu peux mettre autant de fichiers que tu veux dans les dossiers sous data, OC ne les verra pas tant qu'il n'y aura pas un enregistrement correspondant dans la tables oc_storages. Cette opération est bien entendu automatique lorsqu'on dépose par l'interface Web ou par Webdav.

Comme ta manip va consister à déplacer les fichiers, le chemin stocké dans la table ne sera plus valide. Il y a essentiellement deux manières de corriger le truc, citées dans l'article :
- la réindexation des fichiers, qui va parcourir toute l'arborescence sous data et réinscrire les fichiers dans la table ;
- passer une requête sur la table oc_storages pour corriger le contenu du champs de la table.

Hors ligne

#47 05-04-2022 18:45:48

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Même topo. Index Of :
https://cjoint.com/c/LDfrLUydGFj

Je ne me décourage jamais. (Heureusement !)

J'ai appliqué la solution 2 référencée par le lien de dejieres. https://help.nextcloud.com/t/howto-chan … tion/17170
J'ai fait ce qui suit :

COMMANDES DECOMPOSEES :
su -u www-data php /var/www/owncloud occ maintenance:mode --on
su -u www-data && php /var/www/owncloud occ maintenance:mode --on
Marche pas !! Je ne peux pas devenir www-data !

Parce que leur commande à eux non plus, ne passe pas :
sudo -u www-data php /path/to/nextcloud/occ maintenance:mode --on

J'ai essayé d'autres trucs :

Réponses de l'OS :


root@1150-SRV:/var/www/owncloud# su -u www-data && php /var/www/owncloud occ maintenance:mode --on
Exécutez « su --help » pour obtenir des renseignements complémentaires.

root@1150-SRV:/var/www/owncloud# su www-data && php /var/www/owncloud occ maintenance:mode --on
This account is currently not available.

 



"not available" !! Faut le faire !

Puis :

cp -ra /var/www/owncloud/data/ /srv/ocdata
cp -ra /var/www/owncloud/data/ /srv/ocdata/data/dataBackup
chown -R www-data:www-data /var/www/owncloud/data/


Depuis le /var/www/owncloud : je vire le dossier data. Parce que j'avais créé un lien 'data' pointant bien vers le dossier /srv/ocdata/data... mais ça ne marchait pas.
rm -rf ./data

Depuis le /srv/ocdata :
ln -s /srv/ocdata/data /var/www/owncloud/data
chown -R www-data:www-data /var/www/owncloud/

Ca crée le "data" lien vers le vrai dossier data. Il n'y a plus de dossier data dans /var/www/owncloud mais un lien à la place.

service apache2 restart
apache2ctl configtest
root@1150-SRV:~# apache2ctl configtest
Syntax OK

root@1150-SRV:~# apache2ctl -S
VirtualHost configuration:
*:443                  localhost (/etc/apache2/sites-enabled/owncloud.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33


Dernières lignes du log dd'Apache :



[Tue Apr 05 19:00:14.476143 2022] [mpm_prefork:notice] [pid 859] AH00163: Apache/2.4.38 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Tue Apr 05 19:00:14.476163 2022] [core:notice] [pid 859] AH00094: Command line: '/usr/sbin/apache2'
[Tue Apr 05 19:01:00.292635 2022] [authz_core:error] [pid 863] [client 192.168.0.51:35502] AH01630: client denied by server configuration: /srv/ocdata/data/
[Tue Apr 05 19:02:20.440753 2022] [mpm_prefork:notice] [pid 859] AH00169: caught SIGTERM, shutting down
[Tue Apr 05 19:02:32.600424 2022] [ssl:warn] [pid 1638] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 05 19:02:32.624795 2022] [ssl:warn] [pid 1639] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 05 19:02:32.628771 2022] [mpm_prefork:notice] [pid 1639] AH00163: Apache/2.4.38 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Tue Apr 05 19:02:32.628792 2022] [core:notice] [pid 1639] AH00094: Command line: '/usr/sbin/apache2'
[Tue Apr 05 19:03:23.889014 2022] [authz_core:error] [pid 1641] [client 192.168.0.51:35522] AH01630: client denied by server configuration: /srv/ocdata/data/
[Tue Apr 05 19:03:23.950759 2022] [authz_core:error] [pid 1641] [client 192.168.0.51:35522] AH01630: client denied by server configuration: /srv/ocdata/data/favicon.ico, referer: https://192.168.0.51/
[Tue Apr 05 19:05:48.665841 2022] [authz_core:error] [pid 1643] [client 192.168.0.51:35540] AH01630: client denied by server configuration: /srv/ocdata/data/
[Tue Apr 05 19:05:48.730830 2022] [authz_core:error] [pid 1643] [client 192.168.0.51:35540] AH01630: client denied by server configuration: /srv/ocdata/data/favicon.ico, referer: https://192.168.0.51/
[Tue Apr 05 19:06:37.481421 2022] [mpm_prefork:notice] [pid 1639] AH00169: caught SIGTERM, shutting down
[Tue Apr 05 19:06:59.368305 2022] [ssl:warn] [pid 2369] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 05 19:06:59.391197 2022] [ssl:warn] [pid 2370] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 05 19:06:59.395190 2022] [mpm_prefork:notice] [pid 2370] AH00163: Apache/2.4.38 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Tue Apr 05 19:06:59.395211 2022] [core:notice] [pid 2370] AH00094: Command line: '/usr/sbin/apache2'
[Tue Apr 05 19:07:36.840143 2022] [authz_core:error] [pid 2373] [client 192.168.0.51:35560] AH01630: client denied by server configuration: /srv/ocdata/data/
[Tue Apr 05 19:09:02.040964 2022] [mpm_prefork:notice] [pid 2370] AH00169: caught SIGTERM, shutting down
[Tue Apr 05 19:19:03.153873 2022] [ssl:warn] [pid 4239] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 05 19:19:03.175851 2022] [ssl:warn] [pid 4240] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 05 19:19:03.179494 2022] [mpm_prefork:notice] [pid 4240] AH00163: Apache/2.4.38 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Tue Apr 05 19:19:03.179513 2022] [core:notice] [pid 4240] AH00094: Command line: '/usr/sbin/apache2'
[Tue Apr 05 19:19:43.770335 2022] [authz_core:error] [pid 4242] [client 192.168.0.51:35610] AH01630: client denied by server configuration: /srv/ocdata/data/

 





Le fstab :



# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=4b0c937b-eb1c-46b9-bed9-23932e9c6943 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=4abdeb87-995c-4045-82d5-9a04536a52d6 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
LABEL=DATA  /mnt  ext4  defaults  0 0
LABEL=DONNEES /srv/ocdata ext4  resuid=33,resgid=33 0 0

 



df :


root@1150-SRV:~# df
Sys. de fichiers blocs de 1K  Utilisé Disponible Uti% Monté sur
udev                 8009732        0    8009732   0% /dev
tmpfs                1607200     9840    1597360   1% /run
/dev/sda1           98664624  6821404   86788296   8% /
tmpfs                8035996    14608    8021388   1% /dev/shm
tmpfs                   5120        4       5116   1% /run/lock
tmpfs                8035996        0    8035996   0% /sys/fs/cgroup
/dev/sdb1          256614804 27993136  215516672  12% /mnt
/dev/sdb3          295941968   455804  280383548   1% /srv/ocdata
tmpfs                1607196       12    1607184   1% /run/user/0
 




apache2.conf :



# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `--  ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf-enabled
# | `-- *.conf
#   `-- sites-enabled
#   `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.


# Global configuration

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.

# TRADUCTION :
# ServerRoot : le sommet de l'arborescence de répertoires sous lequel le serveur
# les fichiers de configuration, d'erreur et de journal sont conservés.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
# ServerRoot : le sommet de l'arborescence de répertoires sous lequel le serveur
# les fichiers de configuration, d'erreur et de journal sont conservés.

# TRADUCTION :

# REMARQUE! Si vous avez l'intention de le placer sur un NFS (ou autre réseau)
# système de fichiers monté, veuillez lire la documentation Mutex (disponible
# à <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# vous vous épargnerez bien des ennuis.
#
# N'ajoutez PAS de barre oblique à la fin du chemin du répertoire.#

# TEST du 28 mars : décommenté la ligne suivante :
# TEST du 29 mars : re-commenté la ligne suivante :
ServerRoot "/etc/apache2"
ServerName localhost

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default

#
# The directory where shm and other runtime files will be stored.
#
DefaultRuntimeDir ${APACHE_RUN_DIR}

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
#TRADUCTION
# HostnameLookups : enregistrez les noms des clients ou uniquement leurs adresses IP
# par exemple, www.apache.org (activé) ou 204.62.129.132 (désactivé).
# La valeur par défaut est off car ce serait globalement mieux pour le net si les gens
# devait sciemment activer cette fonctionnalité, car l'activer signifie que
# chaque requête client entraînera AU MOINS une requête de recherche vers le
# nom du serveur.

#HostnameLookups Off
#HostnameLookups On
# Rajouté ceci :
#HostnameLookups 82.66.155.194
HostnameLookups On

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf


# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.

<Directory />
  Options FollowSymLinks
  AllowOverride None
  Require all denied
</Directory>

<Directory /usr/share>
  AllowOverride None
  Require all granted
</Directory>

<Directory /var/www/>
  Options Indexes FollowSymLinks
  AllowOverride None
  Require all granted
 
  # ==>> pour éviter le warning de apache2ctl -S
        #Options Indexes FollowSymLinks MultiViews
# AllowOverride all
  # Require all granted
        #Satisfy Any
</Directory>

<Directory /srv/>
  Options Indexes FollowSymLinks
  AllowOverride all
# AllowOverride None
  Require all granted
#   Satisfy Any
</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
  Require all denied
</FilesMatch>


#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

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


 





Le config.php :




<?php
$CONFIG = array (
  'instanceid' => 'oc3204klngo7',
  'passwordsalt' => 'lS1yqxqIhEwp7wIIJxrPmpDhJXYMAm',
  'secret' => 'vshQa4xHcoibxnA8i1u0I4UwOWJLsK+TWEaK/Dpu4hAQ/huR',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.168.0.51',
    2 => '82.66.155.194',
  ),
#  'datadirectory' => '/var/www/owncloud/data',
  'datadirectory' => '/srv/ocdata/data',
  'overwrite.cli.url' => 'http://192.168.0.51',
  'dbtype' => 'mysql',
  'version' => '10.9.1.2',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost:3306',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_root',
  'dbpassword' => 'SY4eaUPESfo5lCM0dEt/WUzm22Q1qF',
  'allow_user_to_change_mail_address' => '',
  'logtimezone' => 'UTC',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/owncloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/owncloud/apps-external',
      'url' => '/apps-external',
      'writable' => true,
    ),
  ),
  'installed' => true,
  'forcessl' => true,
 
);

 




Le virtual host de owncloud :


<VirtualHost *:443>
#    DocumentRoot /var/www/owncloud/
#    DocumentRoot /srv/ocdata/data
     DocumentRoot /srv/ocdata/
    # Activation du mode SSL
    SSLEngine On
    SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire

    # On indique ou est le certificat
    SSLCertificateFile /etc/ssl/certs/owncloud.pem
    SSLCertificateKeyFile /etc/ssl/private/owncloud.key

# Conseillé par Allan :
# A désactiver éventuellement
      RewriteEngine on
      RewriteCond %{HTTPS} !on
      RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

</VirtualHost>

# Voir éventuellement fichier owncloud-ssl.txt

 

Dernière modification par Lupa (05-04-2022 18:48:56)

Hors ligne

#48 06-04-2022 07:52:04

dejieres
Membre
Lieu : Moselle
Distrib. : Bookworm 64 bits
(G)UI : GNOME
Inscription : 07-02-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Lupa a écrit :

Je ne peux pas devenir www-data

Non, puisque ce n'est pas un compte interactif. Par contre, tu peux exécuter une commande en tant que www-data

sudo -u www-data php /var/www/owncloud occ maintenance:mode --on

sudo, pas su. Et si tu veux enchaîner plusieurs commandes sur une même ligne physique, avec && ou autres, il faut répéter sudo -u www-data pour chaque commande.

Lupa a écrit :

Parce que leur commande à eux non plus, ne passe pas :
sudo -u www-data php /path/to/nextcloud/occ maintenance:mode --on

Quel est le retour de cette commande ?

Lupa a écrit :

<VirtualHost *:443>
#    DocumentRoot /var/www/owncloud/
#    DocumentRoot /srv/ocdata/data
     DocumentRoot /srv/ocdata/

Le DocumentRoot doit être le dossier où apache va trouver les fichiers du site, c'est-à-dire /var/www/owncloud/. Apache n'a cure du dossier data, il n'a de sens que pour OC lui-même. C'est pour ça que ton site apparaît vide, avec au mieux une arborescence de fichiers.
Donc, on dégage d'ici tout ce qui contient le mot data smile

Hors ligne

#49 06-04-2022 09:31:54

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Bonjour.
Je vais tenter ça.
Cette nuit, j'ai pu utiliser la commande occ en tant que ww-data.

La prochaine fois, et je n'exclue pas de recommencer aujourd'hui-même, pourquoi ne pas effectuer le montage sur /srv AVANT de lancer le setup de Owncloud ? Ce doit être faisable, si je modifie correctement le owncloud.conf et le apache2.conf .

A ton avis ?

Le manuel de Owncloud y réfère lui-même. Je cite (de mémoire) qu'il est plus aisé de le faire à l'installation plutôt qu'après.

Hors ligne

#50 06-04-2022 09:46:58

Lupa
Membre
Distrib. : Debian Stretch 4.9.110-3+deb9u6 / Buster
Noyau : 4.9.0-8-amd64 (Stretch) Buster : 5.4.0-0.bpo.2-amd
(G)UI : xfce
Inscription : 28-06-2017

Re : [RESOLU]Owncloud : déplacement du dossier data

Gagné !
Ca fonctionne.


<VirtualHost *:443>
    DocumentRoot /var/www/owncloud/
    ServerAdmin webmaster@localhost

    # Activation du mode SSL
    SSLEngine On
    SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire

    # On indique ou est le certificat
    SSLCertificateFile /etc/ssl/certs/owncloud.pem
    SSLCertificateKeyFile /etc/ssl/private/owncloud.key

# Conseillé par Allan :
# A désactiver éventuellement
      RewriteEngine on
      RewriteCond %{HTTPS} !on
      RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

</VirtualHost>

# Voir éventuellement fichier owncloud-ssl.txt

 



Merci les amis !! :hello:

Hors ligne

Pied de page des forums