Même topo. Index Of :
https://cjoint.com/c/LDfrLUydGFjJe 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/17170J'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)