「Nextcloud」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(同期)
(Pkg/AUR テンプレートの更新)
(2人の利用者による、間の15版が非表示)
1行目: 1行目:
  +
[[Category:ファイル共有]]
{{lowercase title}}
 
[[Category:ウェブサーバー]]
+
[[Category:ウェブアプリケション]]
[[en:Owncloud]]
+
[[en:Nextcloud]]
 
[[fr:Owncloud]]
 
[[fr:Owncloud]]
 
{{Related articles start}}
 
{{Related articles start}}
{{Related|LAMP}}
+
{{Related|Apache HTTP Server}}
 
{{Related|Nginx}}
 
{{Related|Nginx}}
 
{{Related|OpenSSL}}
 
{{Related|OpenSSL}}
 
{{Related|WebDAV}}
 
{{Related|WebDAV}}
 
{{Related articles end}}
 
{{Related articles end}}
  +
[[Wikipedia:ownCloud|Wikipedia]] より:
[[Wikipedia:OwnCloud|ownCloud]] はクラウドストレージを提供するためのソフトウェア群です。
 
   
  +
:Nextcloud はファイルホストサービスを作成して使用するためのクライアントサーバーソフトウェアスイートである。広く使われている Dropbox と同じような機能を持ち、フリーでオープンソースであるため、誰でもプライベートサーバーにインストール・使用することができる。Dropbox などのプロプライエタリサービスと異なり、オープンなアーキテクチャを活用してサーバーに機能 (アプリケーション) を簡単に追加することが可能。
ownCloud のインストールと設定はどのウェブサーバーとデータベースを動かすかによって異なってきます。現在のところ wiki には [[#Apache の設定]] と [[#Nginx + uwsgi_php の設定]] が載っています。
 
   
  +
Nextcloud は ownCloud のフォークです。Nextcloud と ownCloud の違いについては [https://en.wikipedia.org/wiki/Nextcloud#Differences_from_ownCloud] を見てください。
== 必要環境 ==
 
   
  +
== 要件 ==
''ownCloud'' は[[:Category:ウェブサーバー|ウェブサーバー]]と [[PHP]]、[[:Category:データベース管理システム|データベース]]を必要とします。古典的な [[LAMP]] の組み合わせで問題なく動作し、[https://doc.owncloud.org/server/8.1/admin_manual/release_notes.html#recommended-setup-for-running-owncloud 推奨] されています。
 
  +
Nextcloud は以下のコンポーネントを必要とします:
  +
* ウェブサーバー: [[Apache]] または [[nginx]]。
  +
* データベース: [[MariaDB]]/MySQL または [[PostgreSQL]]。
  +
* [[PHP]] と[[#PHP|追加モジュール]]。
  +
  +
先に進む前にまずは必要なコンポーネントをインストールしてください。
   
 
== インストール ==
 
== インストール ==
   
[[公式リポジトリ]]から {{Pkg|owncloud}} を[[インストール]]してください。
+
{{Pkg|nextcloud}} パッケージを[[インストール]]してください。
   
  +
== セットアップ ==
{{ic|/etc/php/php.ini}} で'''必要な'''以下のエクステンションをアンコメントします [https://doc.owncloud.org/server/8.2/admin_manual/installation/source_installation.html#prerequisites]:
 
gd.so
 
iconv.so
 
xmlrpc.so
 
zip.so
 
   
  +
Nextcloud をセットアップするには PHP が動作するウェブサーバー・データベースサーバーが必要です。
また、{{Pkg|php-intl}} と {{Pkg|php-mcrypt}} をインストールして以下のエクステンションをアンコメントすることが [https://doc.owncloud.org/server/8.2/admin_manual/installation/source_installation.html#prerequisites 推奨] されています:
 
bz2.so
 
curl.so
 
intl.so
 
mcrypt.so
 
   
=== キャシュ ===
+
=== Pacman フ ===
   
  +
nextcloud のデータベースのアップグレードを自動化するには、以下のように pacman でアップグレードした後のフックを設定します:
パフォーマンスを向上させるために、APCu による PHP キャッシュを使うことを推奨します。[[PHP#APCu]] を見てください。同じく OPCache も有効にすると有益です。[[PHP#OPCache]] を参照。
 
   
  +
{{hc|/etc/pacman.d/hooks/nextcloud.hook|2=
APCu を有効にした後、以下のディレクティブを {{ic|/etc/webapps/owncloud/config/config.php}} に追加してください:
 
  +
[Trigger]
'memcache.local' => '\OC\Memcache\APCu',
 
  +
Operation = Install
  +
Operation = Upgrade
  +
Type = Package
  +
Target = nextcloud
  +
Target = nextcloud-app-*
  +
  +
[Action]
  +
Description = Update Nextcloud installation
  +
When = PostTransaction
  +
Exec = /usr/bin/runuser -u http -- /usr/bin/php /usr/share/webapps/nextcloud/occ upgrade
  +
}}
   
  +
{{ic|pacman.conf}} の {{ic|HookDir}} をカスタマイズしている場合はフックを適切な場所に配置してください。
{{Note|
 
* [[PHP#設定|PHP 設定]]の {{ic|[apc]}} の下に {{ic|1=apc.enable_cli=1}} を追加してください。また、{{ic|/etc/php/conf.d/apcu.ini}} の {{ic|1=extension=apcu.so}} をアンコメントしてください。2015年7月12日現在、これらの設定をしないと [https://github.com/owncloud/core/issues/17329#issuecomment-119248944 複数] の [https://github.com/owncloud/documentation/issues/1233#issuecomment-120664134 問題] が発生します。
 
* 2016年1月4日現在、OwnCloud 8.2.2 では {{Pkg|php-apcu-bc}} パッケージに含まれている "APCu Backwards Compatibility Module" が必要です。パッケージをインストールしたら {{ic|/etc/php/conf.d/apcu.ini}} の {{ic|1=extension=apcu.so}} の後に {{ic|1=extension=apc.so}} を追加してください。}}
 
   
  +
[[Pacman#フック]]も参照。
詳しくは [https://doc.owncloud.org/server/8.1/admin_manual/configuration_server/config_sample_php_parameters.html#memory-caching-backend-configuration 公式ドキュメント] を参照。
 
   
=== /dev/urandomアクセス ===
+
=== PHP設定 ===
   
  +
{{Tip|必要な全ての PHP モジュールについては、上流のドキュメントを参照してください: [https://docs.nextcloud.com/server/13/admin_manual/installation/source_installation.html#prerequisites-label Nextcloud 13.0]。}}
ownCloud 8.1.0-1 は {{ic|/dev/urandom}} にアクセスする必要があります。{{ic|php.ini}} で有効にしてください。
 
   
  +
[[PHP#gd]] と {{pkg|php-intl}} を追加モジュールとしてインストールしてください。また、[[PHP#OPCache|OPcache]] を設定してください [https://docs.nextcloud.com/server/13/go.php?to=admin-php-opcache].
{{ic|php.ini}} の {{ic|open_basedir}} に {{ic|:/dev/urandom}} を追加します (末尾にスラッシュは付きません)。例:
 
   
  +
一部のアプリ (News など) は iconv 拡張を必要とします。アプリを使いたい場合は {{ic|/etc/php/php.ini}} で拡張をアンコメントしてください。
open_basedir = /srv/http/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/dev/urandom
 
   
  +
使用するデータベースバックエンドに応じて設定が必要です:
もしくは、{{ic|/etc/httpd/conf/extra/owncloud.conf}} の {{ic|php_admin_value open_basedir}} に {{ic|:/dev/urandom}} を追加するほうが良い結果が得られるかもしれません。
 
  +
* [[MySQL]] の場合、[[PHP#MySQL/MariaDB]] を見てください。
  +
* [[PostgreSQL]] の場合、[[PHP#PostgreSQL]] を見てください。
  +
* [[SQLite]] の場合、[[PHP#Sqlite]] を見てください。
   
  +
[[PHP#キャッシュ|キャッシュ]]を活用することでパフォーマンスを改善することができます。詳しくは公式ドキュメントの [https://docs.nextcloud.com/server/13/admin_manual/configuration_server/caching_configuration.html メモリキャッシュの設定] を見てください。
Nginx + uwsgi_php では上記の設定は反映されません。uwsgi_php の設定ファイルに {{ic|:/dev/urandom}} を指定してください:
 
   
  +
=== データベースの設定 ===
{{hc|/etc/uwsgi/owncloud.ini|<nowiki>php-set = open_basedir=%(owncloud_data_dir):/tmp/:/usr/share/pear/:/usr/share/webapps/owncloud:/etc/webapps/owncloud:/dev/urandom</nowiki>}}
 
   
  +
Nextcloud を動かすには SQL データベースをセットアップする必要があります。データベースを設定したら、まずは管理者アカウントを作成する必要があります。
=== データベースのサポート ===
 
使用するデータベースバックエンドにあわせて、{{ic|/etc/php/php.ini}} の以下の拡張をアンコメントしてください:
 
* [[MySQL]] の場合、{{ic|pdo_mysql.so}} をアンコメントしてください。
 
* [[PostgreSQL]] の場合、{{ic|pdo_pgsql.so}} と {{ic|pgsql.so}} をアンコメントして {{Pkg|php-pgsql}} をインストールしてください。
 
* [[Sqlite|SQLite]] の場合、{{ic|pdo_sqlite.so}} と {{ic|sqlite3.so}} をアンコメントして {{Pkg|php-sqlite}} をインストールしてください。
 
   
=== Exif のサポート ===
+
==== MariaDB ====
[[公式リポジトリ]]から {{Pkg|exiv2}} をインストールして {{ic|php.ini}} で {{ic|exif.so}} エクステンションをアンコメントすることで exif サポートを有効化できます。
 
   
  +
以下は [[MariaDB]] のデータベースとユーザーを設定する例です:
=== オールインワンの Docker を使う ===
 
  +
{{hc|$ mysql -u root -p|2=
  +
mysql> CREATE DATABASE `'''nextcloud'''` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
  +
mysql> CREATE USER `'''nextcloud'''`@'localhost' IDENTIFIED BY ''''password'''';
  +
mysql> GRANT ALL PRIVILEGES ON `'''nextcloud'''`.* TO `'''nextcloud'''`@`localhost`;
  +
mysql> \q
  +
}}
   
  +
{{Note|Nextcloud サーバーで絵文字を使えるようにするためデータベースの4バイト文字のサポートを有効にしてください [https://docs.nextcloud.com/server/13/admin_manual/configuration_database/mysql_4byte_support.html]。}}
''ownCloud'' のインストールと設定を素早く安全に行う方法として [[Docker]] を使うことができます。[https://index.docker.io/search?q=ownCloud Docker のリポジトリ] には始めから ''ownCloud'' がインストールされている完全な LAMP スタックのイメージが複数存在します。''Docker'' コンテナは基本的に [[chroot]] 環境よりも安全でありオーバーヘッドも少なくなります。Docker 上の ''ownCloud'' はかなり古いマシンでもスムーズに動作するでしょう。普通に ''ownCloud'' をインストールするよりも大抵は ''Docker'' をインストールしてから ''ownCloud'' イメージをインストールする方が簡単で時間がかかりません。
 
   
  +
==== PostgreSQL ====
{{Note|Docker イメージは ownCloud の公式サポートがありません。}}
 
  +
以下は [[PostgreSQL]] のデータベースとユーザーを設定する例です:
  +
{{hc|1=$ sudo -u postgres createuser -h localhost -P nextcloud|2=
  +
Enter password for new role:
  +
Enter it again:
  +
}}
  +
$ sudo -u postgres createdb -O nextcloud nextcloud
   
== Apache の設定 ==
+
=== ウェブサーバーの設定 ===
  +
{{Warning|平文の HTTP ではなく TLS/SSL (HTTPS) を使用することが推奨されます。詳しくは [[Apache#TLS/SSL]] や [[Nginx#TLS/SSL]] を参照してください。}}
   
  +
使用する[[ウェブサーバー]]によって、必要な設定は変わります。
{{Note|[[Apache HTTP Server#PHP]] に書かれているようにして PHP を有効化してください。}}
 
   
  +
==== Apache ====
Apache の設定ファイルを ownCloud の設定ディレクトリにコピーします:
 
  +
[[Apache]] をインストールしたら [[Apache#PHP|Apache の PHP モジュール]]をインストール・有効化してください。
# cp /etc/webapps/owncloud/apache.example.conf /etc/httpd/conf/extra/owncloud.conf
 
   
そして {{ic|/etc/httpd/conf/httpd.conf}}一番下で設定ファイルをインます:
+
Apache の設定ファイルを設定ディレトリにコピーしてください:
  +
# cp /etc/webapps/nextcloud/apache.example.conf /etc/httpd/conf/extra/nextcloud.conf
Include conf/extra/owncloud.conf
 
   
  +
必要に応じてファイルの設定を変更してください。デフォルトでは {{ic|/nextcloud}} で {{ic|/usr/share/webapps/nextcloud}} が表示されるエイリアスが記述されています。
セキュリティを確保するために、[https://doc.owncloud.org/server/8.0/admin_manual/installation/installation_wizard.html#setting-strong-directory-permissions ownCloud のインストールマニュアル] に書かれているようにディレクトリのパーティションを設定してください:
 
#!/bin/bash
 
ocpath='/usr/share/webapps/owncloud'
 
htuser='http'
 
htgroup='http'
 
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
 
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
 
chown -R root:${htuser} ${ocpath}/
 
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
 
chown -R ${htuser}:${htgroup} ${ocpath}/config/
 
chown -R ${htuser}:${htgroup} ${ocpath}/data/
 
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
 
chown root:${htuser} ${ocpath}/.htaccess
 
chown root:${htuser} ${ocpath}/data/.htaccess
 
chmod 0644 ${ocpath}/.htaccess
 
chmod 0644 ${ocpath}/data/.htaccess
 
   
Apache ({{ic|httpd.service}})再起動ます。
+
設定たら {{ic|/etc/httpd/conf/httpd.conf}} に以下追加てください:
  +
Include conf/extra/nextcloud.conf
   
  +
Nextcloud がインストールされているルートディレクトリ (例: {{ic|/usr/share/webapps/nextcloud}}) にウェブサーバーのユーザー {{ic|http}} からアクセスできることを確認してください。
ウェブブラウザで http://localhost/owncloud を開いて下さい。ユーザーアカウントを作成してインストールウィザードに従う必要があります。
 
   
  +
その後 Apache ({{ic|httpd.service}}) を再起動してください。
=== WebDAV ===
 
   
  +
===== WebDAV =====
OwnCloud には WebDAV の実装が付いておりデフォルトで有効になっていますが、Apache の実装と衝突する可能性があります。OwnCloud は {{ic|/etc/httpd/conf/httpd.conf}} で {{ic|mod_dav}} と {{ic|mod_dav_fs}} を無効化することを [http://forum.owncloud.org/viewtopic.php?f=17&t=7240 推奨] しています。
 
  +
Nextcloud には [[WebDAV]] の実装が付いていますが、Apache の実装と衝突する可能性があります。Apache で WebDAV を有効にしていた場合 (デフォルトでは有効になっていません)、{{ic|/etc/httpd/conf/httpd.conf}} で {{ic|mod_dav}} と {{ic|mod_dav_fs}} モジュールを無効にしてください。詳しくは [https://forum.owncloud.org/viewtopic.php?f=17&t=7240] を参照。
   
  +
==== Nginx ====
=== サブディレクトリで ownCloud を動かす ===
 
  +
[[Nginx#FastCGI]] に書かれているように PHP-FPM を設定してください。また、{{ic|/etc/php/php-fpm.d/www.conf}} の {{ic|1=env[PATH]}} をアンコメントしてください。
   
  +
[[Nginx#サーバーブロック|server ブロック]]を作成して [https://docs.nextcloud.com/server/13/admin_manual/installation/nginx.html Nextcloud のドキュメント] に書かれているように中身を追加してください:
デフォルトの {{ic|owncloud.conf}} を {{ic|httpd.conf}} でインクルードすることで、ownCloud は80番ポートと localhost ドメインをコントロールします。
 
   
  +
{{Note|{{Pkg|nextcloud}} を使用する場合は {{ic|root}} のパスを {{ic|/usr/share/webapps/nextcloud}} としてください。}}
サブディレクトリで ownCloud を動作させたい場合は、{{ic|/etc/httpd/conf/extra/owncloud.conf}} を編集して include ファイルの {{ic|<nowiki><VirtualHost *:80> ... </VirtualHost></nowiki>}} の部分をコメントアウトしてください。
 
  +
{{Tip|[[Let's Encrypt]] を設定する場合は最初の設定として [https://github.com/graysky2/configs/blob/master/nginx/nextcloud-initial.conf テンプレート] を参照してください。}}
   
  +
{{hc|/etc/nginx/sites-available/owncloud.conf|2=
== Nginx + php-fpm の設定 ==
 
  +
<nowiki>
  +
upstream php-handler {
  +
server unix:/run/php-fpm/php-fpm.sock;
  +
}
   
  +
server {
ownCloud の公式ドキュメントでは php-fpm で PHP を使っています。したがってそれが最もサポートされている構成になります。以下は Arch Linux で動作するように、[https://doc.owncloud.org/server/8.1/admin_manual/installation/nginx_configuration.html 推奨されるサーバー設定] から多少変更を加えています。{{pkg|php-fpm}} と SSL 証明書が必要です。
 
  +
listen 443 ssl http2;
  +
listen [::]:443 ssl http2;
  +
server_name cloud.example.com;
   
  +
ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;
{{bc|<nowiki>
 
  +
ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key;
user http;
 
worker_processes auto;
 
   
  +
..
events {
 
worker_connections 1024;
 
}
 
   
  +
# Path to the root of your installation
http {
 
  +
root /usr/share/webapps/nextcloud/;
 
#sendfile on; # Appears to cause problems with webdav.
 
#tcp_nopush on;
 
   
  +
..
server {
 
listen 80;
 
server_name owncloud.example.com;
 
# enforce https
 
return 301 https://$server_name$request_uri;
 
}
 
   
server {
 
include mime.types;
 
default_type application/octet-stream;
 
   
  +
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
listen 443 ssl;
 
  +
fastcgi_split_path_info ^(.+\.php)(/.*)$;
server_name owncloud.example.com;
 
  +
include fastcgi_params;
  +
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  +
fastcgi_param PATH_INFO $fastcgi_path_info;
  +
fastcgi_param HTTPS on;
  +
#Avoid sending the security headers twice
  +
fastcgi_param modHeadersAvailable true;
  +
fastcgi_param front_controller_active true;
  +
fastcgi_pass php-handler;
  +
fastcgi_intercept_errors on;
  +
fastcgi_request_buffering off;
  +
}
  +
}
  +
</nowiki>
  +
}}
   
  +
== 初期化 ==
ssl_certificate /etc/ssl/server.crt;
 
ssl_certificate_key /etc/ssl/server.key;
 
   
  +
ウェブブラウザで Nextcloud をインストールした PC のアドレスを開いてください (例: https://www.example.com/nextcloud )。指示に従って管理者アカウントを追加し先に作成したデータベースを選択します。
# Add headers to serve security related headers
 
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
 
add_header X-Content-Type-Options nosniff;
 
add_header X-Frame-Options "SAMEORIGIN";
 
add_header X-XSS-Protection "1; mode=block";
 
add_header X-Robots-Tag none;
 
   
  +
=== ストレージディレクトリの作成 ===
# Path to the root of your installation
 
root /usr/share/webapps/owncloud;
 
# set max upload size
 
client_max_body_size 10G;
 
fastcgi_buffers 64 4K;
 
   
  +
"Cannot write into "apps" directory" というエラーが表示される場合、Arch の Nextcloud パッケージが ''apps'' フォルダだけ使用していて ''data'' フォルダが存在しないのが原因です。
# Disable gzip to avoid the removal of the ETag header
 
gzip off;
 
   
  +
アプリ用の新しい書き込み可能なフォルダを作成して data フォルダも作成するのが一番簡単な解決方法です (http グループは必要に応じて使用しているウェブサーバーのグループに置き換えてください):
# Uncomment if your server is build with the ngx_pagespeed module
 
# This module is currently not supported.
 
#pagespeed off;
 
   
  +
# mkdir -p /usr/share/webapps/nextcloud/data
rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
 
  +
# chown http:http /usr/share/webapps/nextcloud/data
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
 
  +
# chown http:http /usr/share/webapps/nextcloud/apps
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
 
  +
# chmod 750 /usr/share/webapps/nextcloud/data
  +
# chmod 750 /usr/share/webapps/nextcloud/apps
   
  +
データディレクトリを上書きするために、{{ic|/etc/webapps/nextcloud/config/config.php}} を編集して、ファイルの末尾の {{ic|);}} の前に以下の行を追加してください:
index index.php;
 
error_page 403 /core/templates/403.php;
 
error_page 404 /core/templates/404.php;
 
   
  +
{{hc|/etc/webapps/nextcloud/config/config.php|2=
location = /robots.txt {
 
  +
'datadirectory' => '/usr/share/webapps/nextcloud/data'
allow all;
 
  +
}}
log_not_found off;
 
access_log off;
 
}
 
   
  +
ページを更新すればエラーは消えるはずです。
location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
 
deny all;
 
}
 
   
  +
=== キャッシュの設定 ===
location / {
 
# The following 2 rules are only needed with webfinger
 
rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
 
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
 
   
  +
[https://docs.nextcloud.com/server/13/admin_manual/configuration_server/caching_configuration.html キャッシュを有効化] することが推奨されています。Nextcloud のドキュメントでは [[Redis]], Memcached, [[PHP#APCu|APCu]] の使用方法が書かれています。
rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
 
rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
 
   
  +
== セキュリティの強化 ==
rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
 
   
  +
[https://docs.nextcloud.com/server/13/admin_manual/configuration_server/harden_server.html Nextcloud Hardening and Security] や[[セキュリティ]]の記事に一般的なトピックの説明があります。[https://scan.nextcloud.com/ セキュリティスキャナ] も参照。
try_files $uri $uri/ /index.php;
 
}
 
   
  +
=== Let's Encrypt ===
location ~ \.php(?:$|/) {
 
  +
==== nginx ====
fastcgi_split_path_info ^(.+\.php)(/.+)$;
 
  +
[https://github.com/graysky2/configs/blob/master/nginx/nextcloud-initial.conf こちらのファイル] をテンプレートとして使ってクラウド設定の {{ic|/etc/nginx/conf.d/cloud-initial.conf}} を作成してください。テンプレートファイルの "@@FQDN@@" は実際に使用する [https://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN] に置き換えてください。最初に暗号化されない設定を使うにはサーバーの証明書を生成する必要があります。[[Let’s Encrypt]] に書かれている手順に従ってサーバーの暗号化証明書を作成してください。
include fastcgi_params;
 
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 
fastcgi_param PATH_INFO $fastcgi_path_info;
 
fastcgi_param HTTPS on;
 
fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
 
# Unix domain sockets are faster than TCP sockets
 
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
 
}
 
   
  +
証明書を作成できたら {{ic|/etc/nginx/conf.d/cloud-initial.conf}} を新しいファイル {{ic|/etc/nginx/conf.d/cloud.conf}} に置き換えてください。[https://github.com/graysky2/configs/blob/master/nginx/nextcloud.conf こちらのファイル] をテンプレートとして使うことができます。"@@FQDN@@" は実際に使用する [https://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN] に置き換えてください。その後 {{ic|nginx.service}} を[[起動]]・[[有効化]]してください。
# Optional: set long EXPIRES header on static assets
 
location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
 
expires 30d;
 
# Optional: Don't log access to assets
 
access_log off;
 
}
 
   
  +
=== uWSGI ===
}
 
  +
  +
{{pkg|uwsgi-plugin-php}} による [[uWSGI]] アプリケーションサーバーを使うことで Nextcloud を固有のプロセスで動かすことができます。システム全体の {{ic|php.ini}} を編集しなくても、インスタンスの [[PHP#設定|PHP 設定]]を定義することができるため、ウェブアプリケーションの設定を分離することが可能です。uWSGI 自体にリソースの使用を制限するための機能が豊富に含まれており、アプリケーションのセキュリティを強化したり、専用のユーザーで動くようにプロセスを分けられます。
  +
  +
[[#PHP-FPM の設定|PHP-FPM の設定]]と異なるところは {{ic|<nowiki>location ~ \.php(?:$|/) {}</nowiki>}} ブロックだけです:
  +
{{bc|<nowiki>
  +
location ~ \.php(?:$|/) {
  +
include uwsgi_params;
  +
uwsgi_modifier1 14;
  +
# Avoid duplicate headers confusing OC checks
  +
uwsgi_hide_header X-Frame-Options;
  +
uwsgi_hide_header X-XSS-Protection;
  +
uwsgi_hide_header X-Content-Type-Options;
  +
uwsgi_hide_header X-Robots-Tag;
  +
uwsgi_pass unix:/run/uwsgi/nextcloud.sock;
 
}
 
}
 
</nowiki>}}
 
</nowiki>}}
   
  +
それから ''uWSGI'' の設定ファイルを作成してください:
{{pkg|php-fpm}} を http ユーザーで動作させるように設定して、上記のようにパーミッションを設定すれば、動作するはずです。ownCloud の設定の {{ic|config.example.php}} を手動でコピーするのは推奨されていません。最初の実行時に自動的に生成されます。{{ic|/usr/share/webapps/owncloud/data}} という ownCloud のデータディレクトリを作成して所有者を root:http にすることで自動設定が行われます。
 
   
  +
{{hc|/etc/uwsgi/nextcloud.ini|<nowiki>
== Nginx + uwsgi_php の設定 ==
 
  +
[uwsgi]
  +
; load the required plugins
  +
plugins = php
  +
; force the sapi name to 'apache', this will enable the opcode cache
  +
php-sapi-name = apache
   
  +
; set master process name and socket
Apache を使わずに、{{pkg|uwsgi-plugin-php}} アプリケーションサーバーを使って ownCloud を固有のプロセスで動かすことができます。uWSGI 自体にリソースの使用を制限するための機能が豊富に含まれており、アプリケーションのセキュリティを強化したり、専用のユーザーで動くようにプロセスを分けられます。
 
  +
; '%n' refers to the name of this configuration file without extension
  +
procname-master = uwsgi %n
  +
master = true
  +
socket = /run/uwsgi/%n.sock
   
  +
; drop privileges
=== 設定 ===
 
  +
uid = http
  +
gid = http
  +
umask = 027
   
  +
; run with at least 1 process but increase up to 4 when needed
*まず最初に Nginx サーバーをセットアップしてください。詳しくは [[Nginx]] のページを参照。
 
  +
processes = 4
*{{ic|/etc/nginx/nginx.conf}} ファイルの http セクションに以下の行でサーバーを設定:
 
  +
cheaper = 1
{{bc|<nowiki>
 
# your nginx-server configs
 
# ...
 
   
  +
; reload whenever this config file changes
# uncomment to run as user and group http
 
  +
; %p is the full path of the current config file
#user http;
 
  +
touch-reload = %p
   
  +
; disable uWSGI request logging
http {
 
  +
;disable-logging = true
# more configs
 
# ...
 
server {
 
listen 80;
 
#listen 443 ssl;
 
server_name localhost;
 
   
  +
; enforce a DOCUMENT_ROOT
#ssl_certificate cert.pem;
 
  +
php-docroot = /usr/share/webapps/%n
#ssl_certificate_key key.pem;
 
  +
; limit allowed extensions
  +
php-allowed-ext = .php
  +
; and search for index.php if required
  +
php-index = index.php
   
  +
; set php configuration for this instance of php, no need to edit global php.ini
#ssl_session_cache shared:SSL:1m;
 
  +
php-set = date.timezone=Etc/UTC
#ssl_session_timeout 5m;
 
  +
;php-set = open_basedir=/tmp/:/usr/share/webapps/nextcloud:/etc/webapps/nextcloud:/dev/urandom
  +
php-set = expose_php=false
  +
; avoid security risk of leaving sessions in world-readable /tmp
  +
php-set = session.save_path=/usr/share/webapps/nextcloud/data
   
  +
; port of php directives set upstream in /usr/share/webapps/nextcloud/.user.ini for use with PHP-FPM
#ssl_ciphers HIGH:!aNULL:!MD5;
 
  +
php-set = upload_max_filesize=513M
#ssl_prefer_server_ciphers on;
 
  +
php-set = post_max_size=513M
  +
php-set = memory_limit=512M
  +
php-set = output_buffering=off
   
  +
; load all extensions only in this instance of php, no need to edit global php.ini
#this is to avoid Request Entity Too Large error
 
  +
;; required core modules
client_max_body_size 1000M;
 
  +
php-set = extension=gd
# deny access to some special files
 
  +
php-set = extension=iconv
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
 
  +
;php-set = extension=zip # enabled by default in global php.ini
deny all;
 
}
 
# pass all .php or .php/path urls to uWSGI
 
location ~ ^(.+\.php)(.*)$ {
 
include uwsgi_params;
 
uwsgi_modifier1 14;
 
#Uncomment line below if you get connection refused error. Remember to comment out line with "uwsgi_pass 127.0.0.1:3001;" below
 
#uwsgi_pass unix:/run/uwsgi/owncloud.sock;
 
uwsgi_pass 127.0.0.1:3001;
 
}
 
# everything else goes to the filesystem,
 
# but / will be mapped to index.php and run through uwsgi
 
location / {
 
root /usr/share/webapps/owncloud;
 
index index.php;
 
rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
 
rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
 
}
 
}
 
}
 
</nowiki>}}
 
*次に [[Uwsgi|uWSGI]] の設定ファイルを作成します。{{ic|/etc/uwsgi/owncloud.ini}} を使うと良いでしょう:
 
{{bc|<nowiki>
 
[uwsgi]
 
master = true
 
socket = 127.0.0.1:3001
 
   
  +
;; database connectors
# Change this to where you want ownlcoud data to be stored (maybe /home/owncloud)
 
  +
;; uncomment your selected driver
owncloud_data_dir = /usr/share/webapps/owncloud/data/
 
  +
;php-set = extension=pdo_sqlite
chdir = %(owncloud_data_dir)
 
  +
;php-set = extension=pdo_mysql
  +
;php-set = extension=pdo_pgsql
   
  +
;; recommended extensions
plugins = php
 
  +
;php-set = extension=curl # enabled by default in global php.ini
php-docroot = /usr/share/webapps/owncloud
 
  +
php-set = extension=bz2
php-index = index.php
 
  +
php-set = extension=intl
   
  +
;; required for specific apps
# only allow these php files, I don't want to inadvertently run something else
 
  +
;php-set = extension=ldap # for LDAP integration
php-allowed-ext = /index.php
 
  +
;php-set = extension=ftp # for FTP storage / external user authentication
php-allowed-ext = /public.php
 
  +
;php-set = extension=imap # for external user authentication, requires php-imap
php-allowed-ext = /remote.php
 
php-allowed-ext = /cron.php
 
php-allowed-ext = /status.php
 
php-allowed-ext = /settings/apps.php
 
php-allowed-ext = /core/ajax/update.php
 
php-allowed-ext = /core/ajax/share.php
 
php-allowed-ext = /core/ajax/requesttoken.php
 
php-allowed-ext = /core/ajax/translations.php
 
php-allowed-ext = /search/ajax/search.php
 
php-allowed-ext = /search/templates/part.results.php
 
php-allowed-ext = /settings/admin.php
 
php-allowed-ext = /settings/users.php
 
php-allowed-ext = /settings/personal.php
 
php-allowed-ext = /settings/help.php
 
php-allowed-ext = /settings/ajax/getlog.php
 
php-allowed-ext = /settings/ajax/setlanguage.php
 
php-allowed-ext = /settings/ajax/setquota.php
 
php-allowed-ext = /settings/ajax/userlist.php
 
php-allowed-ext = /settings/ajax/createuser.php
 
php-allowed-ext = /settings/ajax/removeuser.php
 
php-allowed-ext = /settings/ajax/enableapp.php
 
php-allowed-ext = /core/ajax/appconfig.php
 
php-allowed-ext = /settings/ajax/setloglevel.php
 
php-allowed-ext = /ocs/v1.php
 
   
  +
;; recommended for specific apps
# set php configuration for this instance of php, no need to edit global php.ini
 
  +
;php-set = extension=exif # for image rotation in pictures app, requires exiv2
php-set = date.timezone=Etc/UTC
 
  +
;php-set = extension=gmp # for SFTP storage
php-set = open_basedir=%(owncloud_data_dir):/tmp/:/usr/share/pear/:/usr/share/webapps/owncloud:/etc/webapps/owncloud:/dev/urandom
 
php-set = session.save_path=/tmp
 
php-set = post_max_size=1000M
 
php-set = upload_max_filesize=1000M
 
php-set = always_populate_raw_post_data=-1
 
   
  +
;; for preview generation
# load all extensions only in this instance of php, no need to edit global php.ini
 
  +
;; provided by packages in AUR
php-set = extension=bz2.so
 
php-set = extension=curl.so
+
; php-set = extension=imagick
php-set = extension=intl.so
 
php-set = extension=pdo_sqlite.so
 
php-set = extension=exif.so
 
php-set = extension=gd.so
 
php-set = extension=imagick.so
 
php-set = extension=gmp.so
 
php-set = extension=iconv.so
 
php-set = extension=mcrypt.so
 
php-set = extension=sockets.so
 
php-set = extension=sqlite3.so
 
php-set = extension=xmlrpc.so
 
php-set = extension=xsl.so
 
php-set = extension=zip.so
 
# uncomment following line to use mysql-backend
 
#php-set = extension=pdo_mysql.so
 
   
  +
; opcache
processes = 10
 
  +
php-set = zend_extension=opcache
cheaper = 2
 
cron = -3 -1 -1 -1 -1 /usr/bin/php -f /usr/share/webapps/owncloud/cron.php 1>/dev/null
 
   
  +
; user cache
# Uncomment line below and replace http with a specific user/group name which you want uwsgi to run with.
 
  +
; provided by php-acpu, to be enabled **either** here **or** in /etc/php/conf.d/apcu.ini
#uid = http
 
  +
php-set = extension=apcu
#gid = http
 
  +
; per https://github.com/krakjoe/apcu/blob/simplify/INSTALL
  +
php-set = apc.ttl=7200
  +
php-set = apc.enable_cli=1
  +
  +
cron2 = minute=-15,unique=1 /usr/bin/php -f /usr/share/webapps/nextcloud/cron.php 1>/dev/null
 
</nowiki>}}
 
</nowiki>}}
   
  +
{{Note|
=== 有効化 ===
 
  +
* 必ず uWSGI 設定ファイルでタイムゾーンを設定して使用するデータベースコネクタをアンコメントしてください。
  +
* PHP 7 から、[[PHP#設定|open_basedir]] ディレクトリは上流と同じように [https://www.archlinux.jp/news/php-70-packages-released/ デフォルトでは設定されなくなりました]。使用すると [https://github.com/owncloud/core/search?q&#61;open_basedir&type&#61;Issues&utf8&#61;%E2%9C%93 一部の機能が使えなくなる] 可能性があります。
  +
* nextcloud を {{ic|/nextcloud}} サブディレクトリに配置する場合は {{ic|1=php-docroot = /usr/share/webapps}} を使ってください。}}
  +
  +
{{Warning|[https://uwsgi-docs.readthedocs.org/en/latest/Cron.html uWSGI cron] によって設定される [https://docs.nextcloud.com/server/13/admin_manual/configuration_server/background_jobs_configuration.html Nextcloud のバックグラウンドジョブ] は {{ic|/etc/php/php.ini}} のグローバル設定を使用します。必要なモジュールなどのパラメータが有効にならず、[https://github.com/owncloud/core/issues/12678#issuecomment-66114448 様々な問題] が発生します。{{ic|/etc/php/php.ini}} を {{ic|/etc/uwsgi/cron-php.ini}} などにコピーして必要な設定 ({{ic|/etc/uwsgi/nextcloud.ini}} のパラメータ) を行い、cron で ''php'' を実行する箇所に {{ic|-c /etc/uwsgi/cron-php.ini}} オプションを追加することで問題は解決します。}}
  +
  +
==== 有効化 ====
  +
  +
[[uWSGI]] には設定ファイルをインスタンスの識別子として使ってアプリケーションを起動したり有効化できる[[Systemd#ユニットを使う|テンプレートユニット]]が入っています。例えば:
  +
# systemctl start uwsgi@nextcloud.socket
   
  +
上のコマンドは {{ic|/etc/uwsgi/nextcloud.ini}} 設定ファイルを参照して必要に応じて起動します。
[[Uwsgi|uWSGI]] には設定ファイルをインスタンスの識別子として使ってアプリケーションを起動したり有効化できる[[Systemd#ユニットを使う|テンプレートユニット]]が入っています。例えば:
 
# systemctl start uwsgi@owncloud.socket
 
上のコマンドは {{ic|/etc/uwsgi/owncloud.ini}} 設定ファイルを参照して必要に応じて起動します。
 
 
 
 
ブート時にデフォルトで uwsgi サービスを有効化するには、次を実行:
 
ブート時にデフォルトで uwsgi サービスを有効化するには、次を実行:
# systemctl enable uwsgi@owncloud.socket
+
# systemctl enable uwsgi@nextcloud.socket
   
 
{{Note|[http://0pointer.de/blog/projects/socket-activation.html systemd のソケットアクティベーション] を利用することで、インスタンスへの接続がない間は無駄にリソースを消費しないようにしています。すぐに有効化したい場合は、{{ic|.socket}} という部分を削除してサービスを起動・有効化してください。}}
 
{{Note|[http://0pointer.de/blog/projects/socket-activation.html systemd のソケットアクティベーション] を利用することで、インスタンスへの接続がない間は無駄にリソースを消費しないようにしています。すぐに有効化したい場合は、{{ic|.socket}} という部分を削除してサービスを起動・有効化してください。}}
   
[[Uwsgi#サービスの起動]]も参照。
+
[[uWSGI#サービスの起動]]も参照。
  +
  +
=== ファイルシステムのパーティションの設定 ===
  +
  +
{{ic|config/}}, {{ic|data/}}, {{ic|apps/}} のパーミッションはできるかぎり厳しく設定してください。HTTP ユーザー ({{pkg|apache}} であれば ''http'') をディレクトリの所有者として、パーミッションは {{ic|700}} にしてください。以下のスクリプトを使うことで設定できます:
  +
  +
{{hc|oc-perms|2=<nowiki>
  +
#!/bin/bash
  +
ocpath='/usr/share/webapps/nextcloud'
  +
htuser='http'
  +
htgroup='http'
  +
rootuser='root'
  +
  +
printf "Creating possible missing Directories\n"
  +
mkdir -p $ocpath/data
  +
mkdir -p $ocpath/assets
  +
  +
printf "chmod Files and Directories\n"
  +
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
  +
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
  +
  +
printf "chown Directories\n"
  +
chown -R ${rootuser}:${htgroup} ${ocpath}/
  +
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
  +
chown -R ${htuser}:${htgroup} ${ocpath}/assets/
  +
chown -R ${htuser}:${htgroup} ${ocpath}/config/
  +
chown -R ${htuser}:${htgroup} ${ocpath}/data/
  +
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
  +
chown -R ${htuser}:${htgroup} ${ocpath}/updater/
  +
  +
chmod +x ${ocpath}/occ
  +
  +
printf "chmod/chown .htaccess\n"
  +
if [ -f ${ocpath}/.htaccess ]
  +
then
  +
chmod 0644 ${ocpath}/.htaccess
  +
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
  +
fi
  +
if [ -f ${ocpath}/data/.htaccess ]
  +
then
  +
chmod 0644 ${ocpath}/data/.htaccess
  +
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
  +
fi
  +
</nowiki>}}
  +
  +
標準的なインストール場所からファイルパスをカスタマイズしている場合、上記のスクリプトも修正する必要があります。
   
 
== 同期 ==
 
== 同期 ==
377行目: 382行目:
 
=== デスクトップ ===
 
=== デスクトップ ===
   
公式クライアントは {{Pkg|owncloud-client}} パッケージでインストールできます。[[AUR]] には様々なバージョンが存在します: {{AUR|owncloud-client-beta}}{{Broken package link|{{aur-mirror|owncloud-client-beta}}}}, {{AUR|owncloud-client-git}} and {{AUR|owncloud-client-qt5}}{{Broken package link|{{aur-mirror|owncloud-client-qt5}}}}。使用方法はドキュメントの [http://doc.owncloud.org/server/7.0/user_manual/files/sync.html こちらのページ] に書かれています。
+
公式クライアントは {{Pkg|owncloud-client}} または {{Pkg|nextcloud-client}} パッケージでインストールできます。開発版の {{AUR|owncloud-client-git}} パッケージも存在します。
   
 
==== カレンダー ====
 
==== カレンダー ====
   
Mozilla [[Thunderbird]] の [[Thunderbird#Lightning_-_カレンダー|Lightning カレンダー]]を使って ''ownCloud'' のカレンダーにアクセスするには以下の URL を使います:
+
Mozilla [[Thunderbird]] の [[Thunderbird#拡張機能|Lightning カレンダー]]を使って ''Nextcloud'' のカレンダーにアクセスするには以下の URL を使います:
   
 
<nowiki>https://ADDRESS/remote.php/caldav/calendars/USERNAME/CALENDARNAME</nowiki>
 
<nowiki>https://ADDRESS/remote.php/caldav/calendars/USERNAME/CALENDARNAME</nowiki>
   
Kontact や [[Evolution]] など CalDAV に対応するプログラムを使って ''ownCloud'' のカレンダーにアクセスするには、以下の URL を使います:
+
Kontact や [[Evolution]] など CalDAV に対応するプログラムを使って ''Nextcloud'' のカレンダーにアクセスするには、以下の URL を使います:
   
 
<nowiki>https://ADDRESS/remote.php/caldav</nowiki>
 
<nowiki>https://ADDRESS/remote.php/caldav</nowiki>
   
詳しくは [http://doc.owncloud.org/server/7.0/user_manual/pim/calendar.html#synchronizing-calendars-using-caldav 公式ドキュメント] を見てさい。
+
詳しくは [https://docs.nextcloud.com/server/13/user_manual/pim/index.html 公式ドキュメント] を見てください。
   
 
==== 連絡先 ====
 
==== 連絡先 ====
   
[[Thunderbird]] と連絡先を同期するには、[http://www.sogo.nu/downloads/frontends.html SOGo フロントエンド] と [[Thunderbird#Lightning_-_カレンダー|Lightning エクステンション]]をインストールして公式ドキュメントの [http://doc.owncloud.org/server/7.0/user_manual/pim/sync_thunderbird.html 手順] に従う必要があります。
+
[[Thunderbird]] と連絡先を同期するには、[[SOGo|SOGo フロントエンド]]と [[Thunderbird#拡張機能|Lightning エクステンション]]をインストールして公式ドキュメントの [https://docs.nextcloud.com/server/13/user_manual/pim/sync_thunderbird.html 手順] に従う必要があります。
   
 
==== davfs2 でファイルをマウントする ====
 
==== davfs2 でファイルをマウントする ====
   
ownCloud を永続的にマウントしたい場合、まず {{Pkg|davfs2}} をインストールしてください ([[Davfs]] に説明があります)。
+
ownCloud を永続的にマウントしたい場合、まず {{Pkg|davfs2}} をインストールしてください ([[Davfs2]] に説明があります)。
   
 
もし ownCloud が {{ic|https://own.example.com}} にある場合、WebDAV の URL は {{ic|https://own.example.com/remote.php/webdav}} になります (ownCloud 6.0 現在)。
 
もし ownCloud が {{ic|https://own.example.com}} にある場合、WebDAV の URL は {{ic|https://own.example.com/remote.php/webdav}} になります (ownCloud 6.0 現在)。
403行目: 408行目:
 
ownCloud をマウントするには、次のコマンドを使います:
 
ownCloud をマウントするには、次のコマンドを使います:
   
# mount https://own.example.com/remote.php/webdav /path/to/mount
+
# mount -t davfs https://own.example.com/remote.php/webdav /path/to/mount
   
 
{{ic|/etc/fstab}} にエントリを作成することもできます:
 
{{ic|/etc/fstab}} にエントリを作成することもできます:
   
  +
{{hc|/etc/fstab|https://own.example.com/remote.php/webdav /path/to/mount davfs rw,user,noauto 0 0}}
{{hc|/etc/fstab|
 
  +
https://own.example.com/remote.php/webdav /path/to/mount davfs rw,user,noauto 0 0
 
  +
{{Tip|自動でマウントしたい場合、[[Davfs2#接続情報の保存]]で説明されているようにファイルにユーザー名 (と必要であればパスワード) を保存できます。}}
}}
 
  +
{{Tip|自動でマウントできるように [[Davfs#通常ユーザーでマウント]] で説明されているようにファイルにユーザー名 (と必要であればパスワード) を保存できます。}}
 
{{Note|ディレクトリは作成・コピーできるのに、ファイルの作成やコピーができない場合、[[Davfs#ファイルの作成やコピーができない]] を見てください。}}
+
{{Note|ディレクトリは作成・コピーできるのに、ファイルの作成やコピーができない場合、[[Davfs2#ファイルの作成やコピーができない]]を見てください。}}
  +
  +
=== GNOME Files (Nautilus) でファイルをマウントする ===
  +
  +
Nautilus ('+ Other Locations') では WebDAV プロトコルを使ってファイルに直接アクセスできます。Nextcloud のインストール Web GUI で表示されるリンクを使ってください (通常は https://example.org/remote.php/webdav/)。ただしプロトコルの名前は 'https' から 'davs' に置き換えてください。Nautilus は接続時にユーザー名とパスワードを要求します。
   
 
=== Android ===
 
=== Android ===
   
小額で使うことができる公式 Android アプリ [https://play.google.com/store/apps/details?id=at.bitfire.davdroid Play ストア] にあり、無料で使えるアプリが [https://f-droid.org/app/at.bitfire.davdroid F-Droid] にあります。
+
Nextcloud の公式アプリ [https://play.google.com/store/apps/details?id=com.nextcloud.client Google Play] [https://f-droid.org/packages/com.nextcloud.client/ F-Droid] からダウンロードできます。
   
連絡先カレンダーの同期を有効するには:
+
連絡先カレンダーの同期を有効するには ([[Android]] 4 以上):
  +
# [https://davdroid.bitfire.at/ DAVdroid] ([https://play.google.com/store/apps/details?id=at.bitfire.davdroid Play Store], [https://f-droid.org/app/at.bitfire.davdroid F-Droid]) をダウンロード。
* Android 4 以上を使っている場合:
 
  +
# {{ic|httpd.conf}} で {{ic|mod_rewrite.so}} を有効化。
*# [https://davdroid.bitfire.at/] をダウンロードしてください ([https://play.google.com/store/apps/details?id=at.bitfire.davdroid Play ストア], [https://f-droid.org/app/at.bitfire.davdroid F-Droid])。
 
  +
# ''Account'' 設定で DAVdroid アカウントを新しく作成して、短いサーバーアドレス (例: {{ic|<nowiki>https://cloud.example.com</nowiki>}}、リダイレクトをウェブサーバーで正しく設定していれば {{ic|<nowiki>/remote.php/{carddav,webdav}</nowiki>}} の部分は不要です。''DAVdroid'' は自動的に URL を検索します) とログイン名・パスワードを指定する。
*# {{ic|httpd.conf}} で mod_rewrite.so を有効化してください。
 
*# ''Account'' 設定で新しい DAVdroid アカウントを作成して、"短い"サーバーアドレスとログイン名/パスワードを指定してください。例: {{ic|<nowiki>https://cloud.example.com</nowiki>}} (ウェブサーバーでリダイレクトを正しく設定していれば {{ic|<nowiki>/remote.php/{carddav,webdav}</nowiki>}} の部分は必要ありません。''DAVdroid'' は適切な URL を認識するはずです)。
 
:古いバージョンが対象ですが、[http://www.slsmk.com/sync-android-contacts-calendar-and-files-to-owncloud/ こちらの記事] には有用な情報が記載されています。
 
   
  +
=== iOS ===
* 4.0 以下のバージョンの Android を使っていて、フリーのソフトウェアを使いたい場合、カレンダーと連絡先の同期には [https://f-droid.org/repository/browse/?fdfilter=caldav&fdid=com.morphoss.acal aCal] を、カレンダーだけの同期には CalDAV Sync Adapter ([https://f-droid.org/repository/browse/?fdfilter=caldav&fdid=org.gege.caldavsyncadapter F-Droid]) を試して下さい。フリーでないソフトウェアを使う気があるのであれば、[http://dmfs.org/ CardDAV-Sync と CalDAV-Sync] の使用が [http://doc.owncloud.org/server/7.0/user_manual/pim/contacts.html#synchronizing-with-android 推奨] されています。
 
   
  +
[https://itunes.apple.com/us/app/nextcloud/id1125420102 App Store] から Nextcloud の公式アプリをダウンロードしてください。
=== 巨大なファイル ===
 
   
  +
=== SABnzbd ===
WebDAV は大きなファイルを扱うのには向いていません、CPU とメモリを食いつぶしてしまいます。
 
   
  +
[[SABnzbd]] を使う場合、{{ic|sabnzbd.ini}} ファイルに以下を設定すると良いでしょう:
現在のバージョンでは、ownCloud に大きなデータをコピーする良い方法はないように思われます。
 
  +
folder_rename 0
  +
というのは ownCloud はアップロードされたファイルを速攻でスキャンするからです。展開された接頭辞などを SABnzbd が削除することを予防します。
   
  +
== ヒントとテクニック ==
対処法:
 
   
  +
=== サブディレクトリで ownCloud を実行 ===
大きなファイルをあなたの ownCloud に直接コピーし、データベースを完全リスキャンします (例えば [http://apps.owncloud.com/content/show.php?content=151948&forumpage=0&PHPSESSID=37b915160effcc0f37cc761ad2ab88be Re-scan filesystem] アドオンを使うことができます)。
 
   
  +
{{ic|httpd.conf}} から読み込まれるデフォルトの {{ic|owncloud.conf}} では、ownCloud はポート 80 と localhost ドメインを使用します。
ですが、この方法は将来 ownCloud が計画している end-to-end 暗号化が実装された時に使えなくなるかもしれないので、注意してください。
 
   
  +
サブディレクトリで ownCloud を使いたい場合、{{ic|/etc/httpd/conf/extra/owncloud.conf}} を編集して {{ic|<nowiki><VirtualHost *:80> ... </VirtualHost></nowiki>}} という部分をコメントアウトしてください。
== 重要なノート ==
 
   
  +
uwsgi で owncloud を使用する場合、以下の nginx 設定が使えます:
* owncloud.example.xxx のようなサブドメインを使う場合、証明書でカバーされているか確認してください。そうでなければ、ownCloud クライアントや wevdav からの接続は失敗するかもしれません。
 
  +
{{hc|head=/etc/nginx/conf.d/owncloud.conf|output=<nowiki>
  +
location = /.well-known/carddav {
  +
return 301 $scheme://$host/owncloud/remote.php/dav;
  +
}
   
  +
location = /.well-known/caldav {
* ownCloud の [http://owncloud.org/sync-clients/ sync-clients] を使うことを計画しているなら、[[Network Time Protocol daemon|ntpd]] をインストールして ownCloud サーバーで実行してください。ntpd が実行されてないと、sync-client は失敗します。
 
  +
return 301 $scheme://$host/owncloud/remote.php/dav;
  +
}
   
  +
location /.well-known/acme-challenge { }
* 接続には [[LAMP#SSL|SSL 暗号化]]を追加してください!
 
(上記のように SSL 暗号化を追加する場合、{{ic|/etc/httpd/conf/extra/httpd-ssl.conf}} を編集して {{ic|DocumentRoot "/srv/http"}} を {{ic|DocumentRoot "/usr/share/webapps/owncloud"}} に変更してください。)
 
   
  +
location ^~ /owncloud {
* ownCloud のアプリは他にも [http://apps.owncloud.com/ ここ] で探すことができます。
 
   
  +
root /usr/share/webapps;
* 新しいアプリケーションをインストールするには、アプリストアから zip をダウンロードして、それを {{ic|/srv/http/owncloud/apps/}} に展開します。その後、httpd を再起動してください:
 
   
  +
# set max upload size
# systemctl restart httpd
 
  +
client_max_body_size 512M;
  +
fastcgi_buffers 64 4K;
   
  +
# Disable gzip to avoid the removal of the ETag header
サーバーにログインしてアプリセクションを開けば新しいアプリが追加されているはずです。
 
  +
gzip off;
   
  +
# Uncomment if your server is build with the ngx_pagespeed module
* HTTP のベーシック認証で ownCloud へのアクセスを保護するときは、"status.php" ファイルは認証から外して誰でもアクセスできるようにしてください [https://github.com/owncloud/mirall/issues/734]。
 
  +
# This module is currently not supported.
  +
#pagespeed off;
   
  +
location /owncloud {
=== SABnzbd ===
 
  +
rewrite ^ /owncloud/index.php$uri;
  +
}
   
  +
location ~ ^/owncloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {
[[en2:SABnzbd|SABnzbd]] を使う場合、{{ic|sabnzbd.ini}} ファイルに以下を設定すると良いでしょう:
 
  +
deny all;
folder_rename 0
 
  +
}
というのは ownCloud はアップロードされたファイルを速攻でスキャンするからです。展開された接頭辞などを SABnzbd が削除することを予防します。
 
  +
  +
location ~ ^/owncloud/(?:\.|autotest|occ|issue|indie|db_|console) {
  +
deny all;
  +
}
  +
  +
location ~ ^/owncloud/(?:updater|ocs-provider)(?:$|/) {
  +
try_files $uri/ =404;
  +
index index.php;
  +
}
  +
  +
location ~ ^/owncloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
  +
include uwsgi_params;
  +
uwsgi_modifier1 14;
  +
# Avoid duplicate headers confusing OC checks
  +
uwsgi_hide_header X-Frame-Options;
  +
uwsgi_hide_header X-XSS-Protection;
  +
uwsgi_hide_header X-Content-Type-Options;
  +
uwsgi_hide_header X-Robots-Tag;
  +
uwsgi_pass unix:/run/uwsgi/owncloud.sock;
  +
}
  +
  +
# Adding the cache control header for js and css files
  +
# Make sure it is BELOW the PHP block
  +
location ~* \.(?:css|js) {
  +
try_files $uri /owncloud/index.php$uri$is_args$args;
  +
add_header Cache-Control "public, max-age=7200";
  +
# Add headers to serve security related headers (It is intended
  +
# to have those duplicated to the ones above)
  +
# Before enabling Strict-Transport-Security headers please read
  +
# into this topic first.
  +
# add_header Strict-Transport-Security "max-age=15768000;
  +
# includeSubDomains; preload;";
  +
add_header X-Content-Type-Options nosniff;
  +
add_header X-Frame-Options "SAMEORIGIN";
  +
add_header X-XSS-Protection "1; mode=block";
  +
add_header X-Robots-Tag none;
  +
add_header X-Download-Options noopen;
  +
add_header X-Permitted-Cross-Domain-Policies none;
  +
# Optional: Don't log access to assets
  +
access_log off;
  +
}
  +
  +
location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg) {
  +
try_files $uri /owncloud/index.php$uri$is_args$args;
  +
# Optional: Don't log access to other assets
  +
access_log off;
  +
}
  +
}
  +
</nowiki>}}
  +
  +
=== Docker ===
  +
[[Docker]] の [https://hub.docker.com/_/owncloud/ ownCloud] あるいは [https://github.com/nextcloud/docker Nextcloud] リポジトリを見てください。
  +
  +
=== ファイルマネージャからアップロード・共有 ===
  +
[https://github.com/schiesbn/shareLinkCreator shareLinkCreator] はサポートされているファイルマネージャから ownCloud にファイルをアップロードする機能を提供します。アップロードしたファイルのリンクをメールなどで配ることが可能です。
  +
  +
=== バックグラウンドジョブの定義 ===
  +
  +
Nextcloud では一部のタスクを定期的に実行する必要があり、デフォルトでは AJAX が使われます。しかしながら AJAX は信頼性の高い方法とはいえないため [[Cron]] の使用が推奨されています。Arch Linux は [[systemd]] を搭載しているため、[[Systemd/タイマー|systemd タイマー]]を使用すると良いでしょう。
  +
  +
まずはサービスを作成:
  +
  +
{{hc|/etc/systemd/system/nextcloudcron.service|<nowiki>
  +
[Unit]
  +
Description=Nextcloud cron.php job
  +
  +
[Service]
  +
User=http
  +
ExecStart=/usr/bin/php -f /usr/share/webapps/nextcloud/cron.php
  +
  +
[Install]
  +
WantedBy=basic.target
  +
</nowiki>}}
  +
  +
そしてサービスのタイマーを作成:
  +
  +
{{hc|/etc/systemd/system/nextcloudcron.timer|<nowiki>
  +
[Unit]
  +
Description=Run Nextcloud cron.php every 15 minutes
  +
  +
[Timer]
  +
OnBootSec=5min
  +
OnUnitActiveSec=15min
  +
Unit=nextcloudcron.service
  +
  +
[Install]
  +
WantedBy=timers.target
  +
</nowiki>}}
  +
  +
作成したら {{ic|nextcloudcron.timer}} を[[起動]]・[[有効化]]してください。
  +
  +
タイマーの実行を確認するには:
  +
# systemctl list-timers
  +
  +
=== Collabora Online Office の統合 ===
  +
  +
==== 公式 Docker イメージを使う ====
  +
  +
{{Pkg|docker}} パッケージをインストールして collabora のファイルを用意して Collabora サーバーをセットアップしてください。
  +
  +
{{ic|docker.service}} を[[起動]]・[[有効化]]してください。
  +
  +
必要なバイナリをダウンロード:
  +
  +
# docker pull collabora/code
  +
  +
それから Collabora サーバーをインストールしてください。{{ic|cloud//.example//.com}} は collabora ではなく nextcloud のドメインにしてください:
  +
  +
# docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=cloud\\.example\\.com' --restart always --cap-add MKNOD collabora/code
  +
  +
文字列は正規表現として評価されるため、ドットは全てバックスラッシュ (\) 2回でエスケープしてください。複数の Nextcloud で docker コンテナを使用する場合、'domain=cloud\\.example\\.com\|second\\.example\\.com' を使ってください (ホストは全て \|. で区切ります)。`localhost` をドメインとして使用する場合は {{ic|--net host}} を追加して docker コンテナが Nextcloud サーバーにアクセスできるようにする必要があります。
  +
  +
===== Nginx =====
  +
  +
nextcloud のドメイン設定に以下を追加するか、{{ic|/etc/nginx/conf.d/}} ディレクトリに新しい設定ファイルを作成してください ({{ic|office.example.com}} と {{ic|ssl_certificate}} は適切な値に置き換えてください):
  +
  +
{{hc|/etc/nginx/conf.d/example.conf|<nowiki>
  +
upstream office.example.com {
  +
server 127.0.0.1:9980;
  +
}
  +
  +
server {
  +
listen 443 ssl;
  +
server_name office.example.com;
  +
  +
ssl_certificate /etc/letsencrypt/live/office.example.com/fullchain.pem;
  +
ssl_certificate_key /etc/letsencrypt/live/office.example.com/privkey.pem;
  +
  +
# static files
  +
location ^~ /loleaflet {
  +
proxy_pass http://127.0.0.1:9980;
  +
proxy_set_header Host $host;
  +
}
  +
  +
# WOPI discovery URL
  +
location ^~ /hosting/discovery {
  +
proxy_pass http://127.0.0.1:9980;
  +
proxy_set_header Host $host;
  +
}
  +
  +
# Main websocket
  +
location ~ /lool/(.*)/ws$ {
  +
proxy_pass http://127.0.0.1:9980;
  +
proxy_set_header Upgrade $http_upgrade;
  +
proxy_set_header Connection "Upgrade";
  +
proxy_set_header Host $host;
  +
proxy_read_timeout 36000s;
  +
}
  +
  +
# Admin Console websocket
  +
location ^~ /lool/adminws {
  +
proxy_buffering off;
  +
proxy_pass http://127.0.0.1:9980;
  +
proxy_set_header Upgrade $http_upgrade;
  +
proxy_set_header Connection "Upgrade";
  +
proxy_set_header Host $host;
  +
proxy_read_timeout 36000s;
  +
}
  +
  +
# download, presentation and image upload
  +
location ~ /lool {
  +
proxy_pass http://127.0.0.1:9980;
  +
proxy_set_header Host $host;
  +
}
  +
}
  +
</nowiki>}}
  +
  +
設定したら nginx を再起動してください。
  +
  +
===== Apache =====
  +
  +
nextcloud の設定ファイルに以下を追加してください:
  +
  +
{{hc|/etc/httpd/conf/extra/nextcloud.conf|<nowiki>
  +
<VirtualHost *:443>
  +
ServerName office.nextcloud.com:443
  +
  +
# SSL configuration, you may want to take the easy route instead and use Lets Encrypt!
  +
SSLEngine on
  +
SSLCertificateFile /path/to/signed_certificate
  +
SSLCertificateChainFile /path/to/intermediate_certificate
  +
SSLCertificateKeyFile /path/to/private/key
  +
SSLProtocol all -SSLv2 -SSLv3
  +
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
  +
SSLHonorCipherOrder on
  +
  +
# Encoded slashes need to be allowed
  +
AllowEncodedSlashes NoDecode
  +
  +
# Container uses a unique non-signed certificate
  +
SSLProxyEngine On
  +
SSLProxyVerify None
  +
SSLProxyCheckPeerCN Off
  +
SSLProxyCheckPeerName Off
  +
  +
# keep the host
  +
ProxyPreserveHost On
  +
  +
# static html, js, images, etc. served from loolwsd
  +
# loleaflet is the client part of LibreOffice Online
  +
ProxyPass /loleaflet https://127.0.0.1:9980/loleaflet retry=0
  +
ProxyPassReverse /loleaflet https://127.0.0.1:9980/loleaflet
  +
  +
# WOPI discovery URL
  +
ProxyPass /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0
  +
ProxyPassReverse /hosting/discovery https://127.0.0.1:9980/hosting/discovery
  +
  +
# Main websocket
  +
ProxyPassMatch "/lool/(.*)/ws$" wss://127.0.0.1:9980/lool/$1/ws nocanon
  +
  +
# Admin Console websocket
  +
ProxyPass /lool/adminws wss://127.0.0.1:9980/lool/adminws
  +
  +
# Download as, Fullscreen presentation and Image upload operations
  +
ProxyPass /lool https://127.0.0.1:9980/lool
  +
ProxyPassReverse /lool https://127.0.0.1:9980/lool
  +
</VirtualHost>
  +
</nowiki>}}
  +
  +
設定したら apache を再起動してください。
  +
  +
===== Nextcloud アプリのインストール =====
  +
  +
Apps セクションから “Office & Text” を選択して “Collabora Online” アプリをインストールしてください。管理パネルから Collabora Online タブを選択して設定したサーバーのドメインを指定してください。
  +
  +
==== Arch Linux のパッケージを使う ====
  +
  +
{{AUR|collabora-online-server-nodocker}} パッケージは Collabora Office (デスクトップスイート) と “lool” (LibreOffice OnLine) ベースの “CODE” (Collabora Online Development Edition) サーバーをインストールします。
  +
  +
{{ic|/etc/loolwsd/loolwsd.xml}} ファイルを以下のように変更してください:
  +
* `config > server_name` に公開する Nextcloud のアドレスのホストとポートを記入してください (例: {{ic|example.org:443}})。
  +
* `config > ssl > enable` は false にしてください (ウェブブラウザ —HTTPS→ プロキシ —HTTP→ loolwsd)。
  +
* `config > ssl > termination` は true にしてください。
  +
* `config > storage > wopi > host` はプロキシサーバーの実際のホストネームに合わせてください (例: `(?:.*\.)?example\.org`)。
  +
* `config > admin_console > username` と `config > admin_console > password` は適当に設定してください。
  +
  +
それから {{ic|loolwsd.service}} を起動・有効化して、{{ic|/usr/share/doc/loolwsd/example.nginx.conf}} に書かれているように Nginx を設定してください。
   
 
== トラブルシューティング ==
 
== トラブルシューティング ==
  +
  +
=== Environment variables not available ===
  +
  +
{{ic|/etc/php/php-fpm.d/www.conf}} の以下の行をアンコメントしてください [https://docs.nextcloud.com/server/13/go.php?to=admin-php-fpm]:
  +
env[PATH] = /usr/local/bin:/usr/bin:/bin
   
 
=== 自己署名証明書が使えない ===
 
=== 自己署名証明書が使えない ===
491行目: 754行目:
 
=== Android デバイスの自己署名証明書 ===
 
=== Android デバイスの自己署名証明書 ===
   
  +
[[LAMP#TLS/SSL]] に書かれているように SSL のセットアップをした場合、古いバージョンの DAVdroid では証明書が信頼できないとして接続が拒否されます。以下のようにサーバーに証明書を作成できます:
Once you have followed the setup for SSL, as on [https://wiki.archlinux.org/index.php/LAMP#TLS.2FSSL LAMP] for example, early versions of DAVdroid will reject the connection because the certificate is not trusted. A certificate can be made as follows on your server:
 
   
# openssl x509 -req -days 365 -in /etc/httpd/conf/server.csr -signkey /etc/httpd/conf/server.key -extfile android.txt -out CA.crt
+
# openssl x509 -req -days 365 -in /etc/httpd/conf/server.csr -signkey /etc/httpd/conf/server.key -extfile android.txt -out CA.crt
# openssl x509 -inform PEM -outform DER -in CA.crt -out CA.der.crt
+
# openssl x509 -inform PEM -outform DER -in CA.crt -out CA.der.crt
   
The file {{ic|android.txt}} should contain the following:
+
{{ic|android.txt}} ファイルに以下を記述してください:
   
basicConstraints=CA:true
+
basicConstraints=CA:true
   
Then import {{ic|CA.der.crt}} to your Android device:
+
そして Android 端末に {{ic|CA.der.crt}} をインポートしてください:
   
  +
Android 端末の SD カードに {{ic|CA.der.crt}} ファイルを保存してください (メールの添付ファイルなどを使って保存してください)。ファイルはルートディレクトリに配置してください。そして ''Settings > Security > Credential storage'' から ''Install from device storage'' を選択します。{{ic|.crt}} ファイルが検出されて、証明書の名前の入力が求められます。証明書をインポートしたら、''Settings > Security > Credential storage > Trusted credentials > User'' から確認できるはずです。
Put the {{ic|CA.der.crt}} file onto the sdcard of your Android device (usually to the internal one, e.g. save from a mail attachment). It should be in the root directory. Go to ''Settings > Security > Credential storage'' and select ''Install from device storage''.
 
The {{ic|.crt}} file will be detected and you will be prompted to enter a certificate name. After importing the certificate, you will find it in ''Settings > Security > Credential storage > Trusted credentials > User''.
 
   
 
ソース: [http://www.leftbrainthings.com/2013/10/13/creating-and-importing-self-signed-certificate-to-android-device/]
 
ソース: [http://www.leftbrainthings.com/2013/10/13/creating-and-importing-self-signed-certificate-to-android-device/]
  +
  +
[https://play.google.com/store/apps/details?id=at.bitfire.cadroid CAdroid] を使ってサーバーから直接証明書をインポートする方法もあります。
   
 
=== Cannot write into config directory! ===
 
=== Cannot write into config directory! ===
   
  +
PHP やウェブサーバーの設定ファイル (例: {{ic|/etc/httpd/conf/extra/nextcloud.conf}}) で {{ic|open_basedir}} を設定している場合、{{ic|/etc/webapps}} が含まれていることを確認してください。
Check your httpd configuration file (like {{ic|owncloud.conf}}). Add your configuration directory ({{ic|/etc/webapps}} by default) to
 
 
php_admin_value open_basedir "/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/path/to/dir/"
 
 
Restart the httpd or php-fpm service to activate the change.
 
   
  +
変更を適用するにはウェブサーバーの再起動が必要です。
=== Cannot create data directory (/path/to/dir) ===
 
   
  +
=== Cannot create data directory ===
Check your httpd configuration file (like {{ic|owncloud.conf}}). Add your data directory to
 
   
  +
PHP やウェブサーバーの設定ファイル (例: {{ic|/etc/httpd/conf/extra/nextcloud.conf}}) で {{ic|open_basedir}} を設定している場合、data ディレクトリが含まれていることを確認してください。
php_admin_value open_basedir "/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/path/to/dir/"
 
   
  +
変更を適用するにはウェブサーバーの再起動が必要です。
Restart the httpd or php-fpm service to activate the change.
 
   
 
=== CSync failed to find a specific file. ===
 
=== CSync failed to find a specific file. ===
   
  +
おそらく証明書に問題があります。証明書を再度作成して、名前を空にしないようにしてください。そうしないとエラーがまた発生します。
This is most likely a certificate issue. Recreate it, and do not leave the common name empty or you will see the error again.
 
   
 
# openssl req -new -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt
 
# openssl req -new -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt
531行目: 791行目:
 
=== ログイン後に白いページが表示される ===
 
=== ログイン後に白いページが表示される ===
   
おそらく新しくインストールしたアプリが原因です。修正するには、[[phpMyAdmin]] を使っ {{ic|oc_appconfig}} テーブルを編集すか (運が良いことにテーブルedit オプショがある場合) mysql で手動で修正してください:
+
おそらく新しくインストールしたアプリが原因です。修正するには、[https://docs.nextcloud.com/server/13/admin_manual/configuration_server/occ_command.html こちら] に書かれようocc コマドを使用ます。アプリを全確認するには:
  +
# sudo -u http php /usr/share/webapps/nextcloud/occ app:list
  +
問題のアプリを無効化するには (Nextcloud を標準のディレクトリにインストールした場合):
  +
# sudo -u http php /usr/share/webapps/nextcloud/occ app:disable <nameOfExtension>
   
  +
もしくは [[phpMyAdmin]] を使って {{ic|oc_appconfig}} テーブルを編集するか (運が良いことにテーブルに edit オプションがある場合) mysql で手動で修正してください:
mysql -u root -p owncloud
 
  +
MariaDB [owncloud]> '''delete from''' oc_appconfig '''where''' appid='<nameOfExtension>' '''and''' configkey='enabled' '''and''' configvalue='yes'
 
  +
$ mysql -u root -p owncloud
  +
MariaDB [owncloud]> '''delete from''' oc_appconfig '''where''' appid='<nameOfExtension>' '''and''' configkey='enabled' '''and''' configvalue='yes';
 
MariaDB [owncloud]> '''insert into''' oc_appconfig (appid,configkey,configvalue) '''values''' ('<nameOfExtension>','enabled','no');
 
MariaDB [owncloud]> '''insert into''' oc_appconfig (appid,configkey,configvalue) '''values''' ('<nameOfExtension>','enabled','no');
   
541行目: 806行目:
 
=== GUI の同期クライアントで接続できない ===
 
=== GUI の同期クライアントで接続できない ===
   
HTTP のベーシック認証を使っている場合、"status.php" が対象から外れていることを確認してください。このファイルは誰からでもアクセスできるようにしておく必要があります [https://github.com/owncloud/mirall/issues/734]。
+
HTTP のベーシック認証を使っている場合、{{ic|status.php}} が対象から外れていることを確認してください。このファイルは誰からでもアクセスできるようにしておく必要があります [https://github.com/owncloud/mirall/issues/734]。
   
  +
=== ファイルをアップロードすると 'Integrity constraint violation...' エラーが表示される ===
=== Server waits forever after creating admin account, before giving a 503 error ===
 
   
  +
ownCloud の同期クライアントで以下のエラーが表示されることがあります:
If the server waits forever but the database is working, try installing all of the apps available in the ArchLinux repos. If you don't have any apps installed, it can cause issues.
 
   
  +
SQLSTATE[23000]: Integrity constraint violation: ... Duplicate entry '...' for key 'fs_storage_path_hash')...
=== Some files upload, but give an error 'Integrity constraint violation...' ===
 
   
  +
File Locking アプリの問題が原因です。ウェブーサーバーの設定の衝突が発生しているのに対処できていません。エラーが発生しない [https://docs.nextcloud.com/server/13/admin_manual/configuration_files/files_locking_transactional.html Transactional File Locking] が存在しますが、Redis の php キャッシュを使う必要があります。{{Pkg|redis}} と {{Pkg|php-redis}} をインストールして、現在使っている php のキャッシュをコメントアウトして、{{ic|/etc/php/conf.d/redis.ini}} から {{ic|1=extension=redis.so}} をアンコメントしてください。そして {{ic|config.php}} に以下の変更を加えます:
You may see the following error in the ownCloud sync client:
 
   
  +
'memcache.local' => '\OC\Memcache\Redis',
SQLSTATE[23000]: Integrity constraint violation: ... Duplicate entry '...' for key 'fs_storage_path_hash')...
 
  +
'filelocking.enabled' => 'true',
  +
'memcache.locking' => '\OC\Memcache\Redis',
  +
'redis' => array(
  +
'host' => 'localhost',
  +
'port' => 6379,
  +
'timeout' => 0.0,
  +
),
   
  +
設定したら [[Redis]] を[[再起動]]してください。
This is caused by an issue with the File Locking app, which is often not sufficient to keep conflicts from occurring on some webserver configurations. A more complete [https://doc.owncloud.org/server/8.1/admin_manual/configuration_files/files_locking_transactional.html Transactional File Locking] is available that rids these errors, but you must be using the Redis php-caching method. Install {{Pkg|redis}} and {{AUR|php-redis}}, comment out your current php-cache mechanism, and then in {{ic|/etc/php/conf.d/redis.ini}} uncomment {{ic|1=extension=redis.so}}. Then in {{ic|config.php}} make the following changes:
 
   
  +
最後に、File Locking アプリを無効化して、Transational File Locking を使うようにしてください。
'memcache.local' => '\OC\Memcache\Redis',
 
'filelocking.enabled' => 'true',
 
'memcache.locking' => '\OC\Memcache\Redis',
 
'redis' => array(
 
'host' => 'localhost',
 
'port' => 6379,
 
'timeout' => 0.0,
 
),
 
   
  +
管理者ページのサーバーステータスに 'Transactional File Locking Enabled' が表示され、同期の問題が消えるはずです。
and start Redis:
 
 
systemctl enable redis.service
 
systemctl start redis.service
 
 
Finally, disable the File Locking App, as the Transational File Locking will take care of it (and would conflict).
 
 
If everything is working, you should see 'Transactional File Locking Enabled' under Server Status on the Admin page, and syncs should no longer cause issues.
 
   
 
=== "Cannot write into apps directory" ===
 
=== "Cannot write into apps directory" ===
   
  +
[https://docs.nextcloud.com/server/13/admin_manual/installation/apps_management_installation.html 公式の管理者マニュアル] に書かれているように、http ユーザーからアプリディレクトリに書き込みができるようにするか、{{ic|appstoreenabled}} を {{ic|false}} に設定する必要があります。
As mentioned in the [http://doc.owncloud.org/server/6.0/admin_manual/configuration/configuration_apps.html official admin manual], either you need an apps directory that is writable by the http user, or you need to set {{ic|appstoreenabled}} to {{ic|false}}.
 
  +
  +
=== MIME タイプエラーによってインストールしたアプリがブロックされる ===
   
  +
apps フォルダを nextcloud のインストールディレクトリの外に配置した場合、ウェブサーバーが正しく設定されているか確認してください。
''Also'', not mentioned there, the directory needs to be in the {{ic|open_basedir}} line in {{ic|/etc/php/php.ini}}.
 
   
  +
nginx の場合、以下のように設定ファイルにデフォルトで含まれていないフォルダの location ブロックを追加する必要があります:
{{Accuracy|Does not seem to work with 8.0.2}}
 
   
  +
location ~ /apps2/(.*)$ {
One clean method is to have the package-installed directory at {{ic|/usr/share/webapps/owncloud/apps}} stay owned by root, and have the user-installed apps go into e.g. {{ic|/var/www/owncloud/apps}}, which is owned by http. Then you can set {{ic|appstoreenabled}} to {{ic|true}} and package upgrades of apps should work fine as well. Relevant lines from {{ic|/etc/webapps/owncloud/config/config.php}}:
 
  +
alias /var/www/nextcloud/apps/$1;
 
  +
}
{{bc|<nowiki>
 
'apps_paths' =>
 
array (
 
0 =>
 
array (
 
'path' => '/usr/share/webapps/owncloud/apps',
 
'url' => '/apps',
 
'writable' => false,
 
),
 
1 =>
 
array (
 
'path' => '/var/www/owncloud/apps',
 
'url' => '/wapps',
 
'writable' => true,
 
),
 
),
 
</nowiki>}}
 
   
  +
=== nginx.conf に推奨設定を記述したのにセキュリティの警告が表示される ===
Example {{ic|open_basedir}} line from {{ic|/etc/php/php.ini}} (you might have other directories in there as well):
 
   
  +
管理者マニュアルにしたがって {{ic|Strict-Transport-Security}}, {{ic|X-Content-Type-Options}}, {{ic|X-Frame-Options}}, {{ic|X-XSS-Protection}}, {{ic|X-Robots-Tag}} を設定しても管理者ページの上部に警告が表示されることがあります。
open_basedir = /srv/http/:/usr/share/webapps/:/var/www/owncloud/apps/
 
   
  +
考えられる原因として ownCloud 自身が設定を行っていて、uWSGI によって nginx に設定が重複して追加されてしまっている可能性があります:
Directory permissions:
 
 
{{hc|$ ls -ld /usr/share/webapps/owncloud/apps /var/www/owncloud/apps/|
 
<nowiki>drwxr-xr-x 26 root root 4096 des. 14 20:48 /usr/share/webapps/owncloud/apps
 
drwxr-xr-x 2 http http 48 jan. 20 20:01 /var/www/owncloud/apps/</nowiki>}}
 
 
=== Security warnings even though the recommended settings have been included in nginx.conf ===
 
 
At the top of the admin page there might be a warning to set the {{ic|Strict-Transport-Security}}, {{ic|X-Content-Type-Options}}, {{ic|X-Frame-Options}}, {{ic|X-XSS-Protection}} and {{ic|X-Robots-Tag}} according to https://doc.owncloud.org/server/8.1/admin_manual/configuration_server/harden_server.html even though they are already set like that.
 
 
A possible cause could be that because owncloud sets those settings, uwsgi passed them along and nginx added them again:
 
 
{{hc|$ curl -I https://domain.tld|
 
{{hc|$ curl -I https://domain.tld|
 
<nowiki>...
 
<nowiki>...
628行目: 862行目:
 
X-Robots-Tag: none</nowiki>}}
 
X-Robots-Tag: none</nowiki>}}
   
While the fast_cgi sample config has a parameter to avoid that ( {{ic|fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice}} ), when using uwsgi and nginx the following modification of the uwsgi part in nginx.conf could help:
+
fast_cgi のサンプル設定には重複を避けるためのパラメータが存在しますが ({{ic|fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice}})uwsgi nginx を使用する場合、{{ic|nginx.conf}} の uwsgi の部分に以下の修正を加えることで解決します:
   
 
{{hc| /etc/nginx/nginx.conf|
 
{{hc| /etc/nginx/nginx.conf|
647行目: 881行目:
 
}
 
}
 
...</nowiki>}}
 
...</nowiki>}}
  +
  +
=== "Reading from keychain failed with error: 'No keychain service available'" ===
  +
Gnome の場合、{{Pkg|libgnome-keyring}} と {{Pkg|gnome-keyring}} パッケージをインストールすることで解決します。KDE の場合、{{Pkg|libgnome-keyring}} と {{Pkg|qtkeychain}} パッケージをインストールしてください。
  +
  +
=== FolderSync: "Method Not Allowed" ===
  +
  +
FolderSync は {{ic|/nextcloud/remote.php/webdav}} へのアクセス権限を必要とするため、{{ic|/etc/httpd/conf/extra/nextcloud.conf}} にエイリアスを作成してください:
  +
<IfModule mod_alias.c>
  +
Alias /nextcloud /usr/share/webapps/nextcloud/
  +
Alias /owncloud /usr/share/webapps/nextcloud/
  +
</IfModule>
  +
  +
=== Nextcloud 13 : "Unable to load dynamic library 'mcrypt.so" ===
  +
  +
php 7.2 から mcrypt 拡張は削除されました [https://wiki.php.net/rfc/mcrypt-viking-funeral]。
  +
  +
mcrypt に関する Nextcloud のエラーを修正するには、PECL で php 7.2 に対応した拡張をインストールします。
  +
  +
1. [https://wiki.php.net/rfc/mcrypt-viking-funeral/ php-pear] をインストール (インストールしていない場合)。
  +
  +
2. PECL チャンネルを更新:
  +
# pecl channel-update pecl.php.net
  +
  +
3. mcrypt 1.0.1 をインストール:
  +
# pecl install mcrypt-1.0.1
  +
  +
4. {{ic|/etc/php/php.conf}} の以下の行をアンコメント:
  +
  +
;extension=mcrypt.so
   
 
== 参照 ==
 
== 参照 ==
* [http://owncloud.org/ ownCloud 公式ウェブサイト]
+
* [https://docs.nextcloud.com/ nextcloud 公式ウェブサイト]
* [http://doc.owncloud.org/server/8.2/admin_manual/ ownCloud 8.2 管理者ドキュメント]
+
* [https://docs.nextcloud.com/server/13/admin_manual/ nextcloud 13.0 管理者ドキュメント]

2019年9月25日 (水) 23:54時点における版

関連記事

Wikipedia より:

Nextcloud はファイルホストサービスを作成して使用するためのクライアントサーバーソフトウェアスイートである。広く使われている Dropbox と同じような機能を持ち、フリーでオープンソースであるため、誰でもプライベートサーバーにインストール・使用することができる。Dropbox などのプロプライエタリサービスと異なり、オープンなアーキテクチャを活用してサーバーに機能 (アプリケーション) を簡単に追加することが可能。

Nextcloud は ownCloud のフォークです。Nextcloud と ownCloud の違いについては [1] を見てください。

目次

要件

Nextcloud は以下のコンポーネントを必要とします:

先に進む前にまずは必要なコンポーネントをインストールしてください。

インストール

nextcloud パッケージをインストールしてください。

セットアップ

Nextcloud をセットアップするには PHP が動作するウェブサーバー・データベースサーバーが必要です。

Pacman フック

nextcloud のデータベースのアップグレードを自動化するには、以下のように pacman でアップグレードした後のフックを設定します:

/etc/pacman.d/hooks/nextcloud.hook
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = nextcloud
Target = nextcloud-app-*
  
[Action]
Description = Update Nextcloud installation
When = PostTransaction
Exec = /usr/bin/runuser -u http -- /usr/bin/php /usr/share/webapps/nextcloud/occ upgrade

pacman.confHookDir をカスタマイズしている場合はフックを適切な場所に配置してください。

Pacman#フックも参照。

PHP の設定

ヒント: 必要な全ての PHP モジュールについては、上流のドキュメントを参照してください: Nextcloud 13.0

PHP#gdphp-intl を追加モジュールとしてインストールしてください。また、OPcache を設定してください [2].

一部のアプリ (News など) は iconv 拡張を必要とします。アプリを使いたい場合は /etc/php/php.ini で拡張をアンコメントしてください。

使用するデータベースバックエンドに応じて設定が必要です:

キャッシュを活用することでパフォーマンスを改善することができます。詳しくは公式ドキュメントの メモリキャッシュの設定 を見てください。

データベースの設定

Nextcloud を動かすには SQL データベースをセットアップする必要があります。データベースを設定したら、まずは管理者アカウントを作成する必要があります。

MariaDB

以下は MariaDB のデータベースとユーザーを設定する例です:

$ mysql -u root -p
mysql> CREATE DATABASE `nextcloud` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
mysql> CREATE USER `nextcloud`@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON `nextcloud`.* TO `nextcloud`@`localhost`;
mysql> \q
ノート: Nextcloud サーバーで絵文字を使えるようにするためデータベースの4バイト文字のサポートを有効にしてください [3]

PostgreSQL

以下は PostgreSQL のデータベースとユーザーを設定する例です:

$ sudo -u postgres createuser -h localhost -P nextcloud
Enter password for new role:
Enter it again:
$ sudo -u postgres createdb -O nextcloud nextcloud

ウェブサーバーの設定

警告: 平文の HTTP ではなく TLS/SSL (HTTPS) を使用することが推奨されます。詳しくは Apache#TLS/SSLNginx#TLS/SSL を参照してください。

使用するウェブサーバーによって、必要な設定は変わります。

Apache

Apache をインストールしたら Apache の PHP モジュールをインストール・有効化してください。

Apache の設定ファイルを設定ディレクトリにコピーしてください:

# cp /etc/webapps/nextcloud/apache.example.conf /etc/httpd/conf/extra/nextcloud.conf

必要に応じてファイルの設定を変更してください。デフォルトでは /nextcloud/usr/share/webapps/nextcloud が表示されるエイリアスが記述されています。

設定したら /etc/httpd/conf/httpd.conf に以下を追加してください:

Include conf/extra/nextcloud.conf

Nextcloud がインストールされているルートディレクトリ (例: /usr/share/webapps/nextcloud) にウェブサーバーのユーザー http からアクセスできることを確認してください。

その後 Apache (httpd.service) を再起動してください。

WebDAV

Nextcloud には WebDAV の実装が付いていますが、Apache の実装と衝突する可能性があります。Apache で WebDAV を有効にしていた場合 (デフォルトでは有効になっていません)、/etc/httpd/conf/httpd.confmod_davmod_dav_fs モジュールを無効にしてください。詳しくは [4] を参照。

Nginx

Nginx#FastCGI に書かれているように PHP-FPM を設定してください。また、/etc/php/php-fpm.d/www.confenv[PATH] をアンコメントしてください。

server ブロックを作成して Nextcloud のドキュメント に書かれているように中身を追加してください:

ノート: nextcloud を使用する場合は root のパスを /usr/share/webapps/nextcloud としてください。
ヒント: Let's Encrypt を設定する場合は最初の設定として テンプレート を参照してください。
/etc/nginx/sites-available/owncloud.conf
upstream php-handler {
    server unix:/run/php-fpm/php-fpm.sock;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name cloud.example.com;

    ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;
    ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key;

    ..

    # Path to the root of your installation
    root /usr/share/webapps/nextcloud/;

    ..


    location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        #Avoid sending the security headers twice
        fastcgi_param modHeadersAvailable true;
        fastcgi_param front_controller_active true;
        fastcgi_pass php-handler;
        fastcgi_intercept_errors on;
        fastcgi_request_buffering off;
    }
}

初期化

ウェブブラウザで Nextcloud をインストールした PC のアドレスを開いてください (例: https://www.example.com/nextcloud )。指示に従って管理者アカウントを追加し先に作成したデータベースを選択します。

ストレージディレクトリの作成

"Cannot write into "apps" directory" というエラーが表示される場合、Arch の Nextcloud パッケージが apps フォルダだけ使用していて data フォルダが存在しないのが原因です。

アプリ用の新しい書き込み可能なフォルダを作成して data フォルダも作成するのが一番簡単な解決方法です (http グループは必要に応じて使用しているウェブサーバーのグループに置き換えてください):

# mkdir -p /usr/share/webapps/nextcloud/data
# chown http:http /usr/share/webapps/nextcloud/data
# chown http:http /usr/share/webapps/nextcloud/apps
# chmod 750 /usr/share/webapps/nextcloud/data
# chmod 750 /usr/share/webapps/nextcloud/apps

データディレクトリを上書きするために、/etc/webapps/nextcloud/config/config.php を編集して、ファイルの末尾の ); の前に以下の行を追加してください:

/etc/webapps/nextcloud/config/config.php
'datadirectory' => '/usr/share/webapps/nextcloud/data'

ページを更新すればエラーは消えるはずです。

キャッシュの設定

キャッシュを有効化 することが推奨されています。Nextcloud のドキュメントでは Redis, Memcached, APCu の使用方法が書かれています。

セキュリティの強化

Nextcloud Hardening and Securityセキュリティの記事に一般的なトピックの説明があります。セキュリティスキャナ も参照。

Let's Encrypt

nginx

こちらのファイル をテンプレートとして使ってクラウド設定の /etc/nginx/conf.d/cloud-initial.conf を作成してください。テンプレートファイルの "@@FQDN@@" は実際に使用する FQDN に置き換えてください。最初に暗号化されない設定を使うにはサーバーの証明書を生成する必要があります。Let’s Encrypt に書かれている手順に従ってサーバーの暗号化証明書を作成してください。

証明書を作成できたら /etc/nginx/conf.d/cloud-initial.conf を新しいファイル /etc/nginx/conf.d/cloud.conf に置き換えてください。こちらのファイル をテンプレートとして使うことができます。"@@FQDN@@" は実際に使用する FQDN に置き換えてください。その後 nginx.service起動有効化してください。

uWSGI

uwsgi-plugin-php による uWSGI アプリケーションサーバーを使うことで Nextcloud を固有のプロセスで動かすことができます。システム全体の php.ini を編集しなくても、インスタンスの PHP 設定を定義することができるため、ウェブアプリケーションの設定を分離することが可能です。uWSGI 自体にリソースの使用を制限するための機能が豊富に含まれており、アプリケーションのセキュリティを強化したり、専用のユーザーで動くようにプロセスを分けられます。

PHP-FPM の設定と異なるところは location ~ \.php(?:$|/) {} ブロックだけです:

location ~ \.php(?:$|/) {
    include uwsgi_params;
    uwsgi_modifier1 14;
    # Avoid duplicate headers confusing OC checks
    uwsgi_hide_header X-Frame-Options;
    uwsgi_hide_header X-XSS-Protection;
    uwsgi_hide_header X-Content-Type-Options;
    uwsgi_hide_header X-Robots-Tag;
    uwsgi_pass unix:/run/uwsgi/nextcloud.sock;
}

それから uWSGI の設定ファイルを作成してください:

/etc/uwsgi/nextcloud.ini
[uwsgi]
; load the required plugins
plugins = php
; force the sapi name to 'apache', this will enable the opcode cache  
php-sapi-name = apache

; set master process name and socket
; '%n' refers to the name of this configuration file without extension
procname-master = uwsgi %n
master = true
socket = /run/uwsgi/%n.sock

; drop privileges
uid    = http
gid    = http
umask  = 027

; run with at least 1 process but increase up to 4 when needed
processes = 4
cheaper = 1

; reload whenever this config file changes
; %p is the full path of the current config file
touch-reload = %p

; disable uWSGI request logging
;disable-logging = true

; enforce a DOCUMENT_ROOT
php-docroot     = /usr/share/webapps/%n
; limit allowed extensions
php-allowed-ext = .php
; and search for index.php if required
php-index = index.php

; set php configuration for this instance of php, no need to edit global php.ini
php-set = date.timezone=Etc/UTC
;php-set = open_basedir=/tmp/:/usr/share/webapps/nextcloud:/etc/webapps/nextcloud:/dev/urandom
php-set = expose_php=false
; avoid security risk of leaving sessions in world-readable /tmp
php-set = session.save_path=/usr/share/webapps/nextcloud/data

; port of php directives set upstream in /usr/share/webapps/nextcloud/.user.ini for use with PHP-FPM
php-set = upload_max_filesize=513M
php-set = post_max_size=513M
php-set = memory_limit=512M
php-set = output_buffering=off

; load all extensions only in this instance of php, no need to edit global php.ini
;; required core modules
php-set = extension=gd
php-set = extension=iconv
;php-set = extension=zip     # enabled by default in global php.ini

;; database connectors
;; uncomment your selected driver
;php-set = extension=pdo_sqlite
;php-set = extension=pdo_mysql
;php-set = extension=pdo_pgsql

;; recommended extensions
;php-set = extension=curl    # enabled by default in global php.ini
php-set = extension=bz2
php-set = extension=intl

;; required for specific apps
;php-set = extension=ldap    # for LDAP integration
;php-set = extension=ftp     # for FTP storage / external user authentication
;php-set = extension=imap    # for external user authentication, requires php-imap

;; recommended for specific apps
;php-set = extension=exif    # for image rotation in pictures app, requires exiv2
;php-set = extension=gmp     # for SFTP storage

;; for preview generation
;; provided by packages in AUR
; php-set = extension=imagick

; opcache
php-set = zend_extension=opcache

; user cache
; provided by php-acpu, to be enabled **either** here **or** in /etc/php/conf.d/apcu.ini
php-set = extension=apcu
; per https://github.com/krakjoe/apcu/blob/simplify/INSTALL
php-set = apc.ttl=7200
php-set = apc.enable_cli=1

cron2 = minute=-15,unique=1 /usr/bin/php -f /usr/share/webapps/nextcloud/cron.php 1>/dev/null
ノート:
警告: uWSGI cron によって設定される Nextcloud のバックグラウンドジョブ/etc/php/php.ini のグローバル設定を使用します。必要なモジュールなどのパラメータが有効にならず、様々な問題 が発生します。/etc/php/php.ini/etc/uwsgi/cron-php.ini などにコピーして必要な設定 (/etc/uwsgi/nextcloud.ini のパラメータ) を行い、cron で php を実行する箇所に -c /etc/uwsgi/cron-php.ini オプションを追加することで問題は解決します。

有効化

uWSGI には設定ファイルをインスタンスの識別子として使ってアプリケーションを起動したり有効化できるテンプレートユニットが入っています。例えば:

# systemctl start uwsgi@nextcloud.socket

上のコマンドは /etc/uwsgi/nextcloud.ini 設定ファイルを参照して必要に応じて起動します。

ブート時にデフォルトで uwsgi サービスを有効化するには、次を実行:

# systemctl enable uwsgi@nextcloud.socket
ノート: systemd のソケットアクティベーション を利用することで、インスタンスへの接続がない間は無駄にリソースを消費しないようにしています。すぐに有効化したい場合は、.socket という部分を削除してサービスを起動・有効化してください。

uWSGI#サービスの起動も参照。

ファイルシステムのパーティションの設定

config/, data/, apps/ のパーミッションはできるかぎり厳しく設定してください。HTTP ユーザー (apache であれば http) をディレクトリの所有者として、パーミッションは 700 にしてください。以下のスクリプトを使うことで設定できます:

oc-perms
#!/bin/bash
ocpath='/usr/share/webapps/nextcloud'
htuser='http'
htgroup='http'
rootuser='root'

printf "Creating possible missing Directories\n"
mkdir -p $ocpath/data
mkdir -p $ocpath/assets

printf "chmod Files and Directories\n"
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750

printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/assets/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocpath}/data/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/updater/

chmod +x ${ocpath}/occ

printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]
 then
  chmod 0644 ${ocpath}/.htaccess
  chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
fi
if [ -f ${ocpath}/data/.htaccess ]
 then
  chmod 0644 ${ocpath}/data/.htaccess
  chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
fi

標準的なインストール場所からファイルパスをカスタマイズしている場合、上記のスクリプトも修正する必要があります。

同期

デスクトップ

公式クライアントは owncloud-client または nextcloud-client パッケージでインストールできます。開発版の owncloud-client-gitAUR パッケージも存在します。

カレンダー

Mozilla ThunderbirdLightning カレンダーを使って Nextcloud のカレンダーにアクセスするには以下の URL を使います:

https://ADDRESS/remote.php/caldav/calendars/USERNAME/CALENDARNAME

Kontact や Evolution など CalDAV に対応するプログラムを使って Nextcloud のカレンダーにアクセスするには、以下の URL を使います:

https://ADDRESS/remote.php/caldav

詳しくは 公式ドキュメント を見てください。

連絡先

Thunderbird と連絡先を同期するには、SOGo フロントエンドLightning エクステンションをインストールして公式ドキュメントの 手順 に従う必要があります。

davfs2 でファイルをマウントする

ownCloud を永続的にマウントしたい場合、まず davfs2 をインストールしてください (Davfs2 に説明があります)。

もし ownCloud が https://own.example.com にある場合、WebDAV の URL は https://own.example.com/remote.php/webdav になります (ownCloud 6.0 現在)。

ownCloud をマウントするには、次のコマンドを使います:

# mount -t davfs https://own.example.com/remote.php/webdav /path/to/mount

/etc/fstab にエントリを作成することもできます:

/etc/fstab
https://own.example.com/remote.php/webdav /path/to/mount davfs rw,user,noauto 0 0
ヒント: 自動でマウントしたい場合、Davfs2#接続情報の保存で説明されているようにファイルにユーザー名 (と必要であればパスワード) を保存できます。
ノート: ディレクトリは作成・コピーできるのに、ファイルの作成やコピーができない場合、Davfs2#ファイルの作成やコピーができないを見てください。

GNOME Files (Nautilus) でファイルをマウントする

Nautilus ('+ Other Locations') では WebDAV プロトコルを使ってファイルに直接アクセスできます。Nextcloud のインストール Web GUI で表示されるリンクを使ってください (通常は https://example.org/remote.php/webdav/)。ただしプロトコルの名前は 'https' から 'davs' に置き換えてください。Nautilus は接続時にユーザー名とパスワードを要求します。

Android

Nextcloud の公式アプリは Google PlayF-Droid からダウンロードできます。

連絡先やカレンダーの同期を有効化するには (Android 4 以上):

  1. DAVdroid (Play Store, F-Droid) をダウンロード。
  2. httpd.confmod_rewrite.so を有効化。
  3. Account 設定で DAVdroid アカウントを新しく作成して、短いサーバーアドレス (例: https://cloud.example.com、リダイレクトをウェブサーバーで正しく設定していれば /remote.php/{carddav,webdav} の部分は不要です。DAVdroid は自動的に URL を検索します) とログイン名・パスワードを指定する。

iOS

App Store から Nextcloud の公式アプリをダウンロードしてください。

SABnzbd

SABnzbd を使う場合、sabnzbd.ini ファイルに以下を設定すると良いでしょう:

folder_rename 0

というのは ownCloud はアップロードされたファイルを速攻でスキャンするからです。展開された接頭辞などを SABnzbd が削除することを予防します。

ヒントとテクニック

サブディレクトリで ownCloud を実行

httpd.conf から読み込まれるデフォルトの owncloud.conf では、ownCloud はポート 80 と localhost ドメインを使用します。

サブディレクトリで ownCloud を使いたい場合、/etc/httpd/conf/extra/owncloud.conf を編集して <VirtualHost *:80> ... </VirtualHost> という部分をコメントアウトしてください。

uwsgi で owncloud を使用する場合、以下の nginx 設定が使えます:

/etc/nginx/conf.d/owncloud.conf
location = /.well-known/carddav {
  return 301 $scheme://$host/owncloud/remote.php/dav;
}

location = /.well-known/caldav {
  return 301 $scheme://$host/owncloud/remote.php/dav;
}

location /.well-known/acme-challenge { }

location ^~ /owncloud {

  root /usr/share/webapps;

  # set max upload size
  client_max_body_size 512M;
  fastcgi_buffers 64 4K;

  # Disable gzip to avoid the removal of the ETag header
  gzip off;

  # Uncomment if your server is build with the ngx_pagespeed module
  # This module is currently not supported.
  #pagespeed off;

  location /owncloud {
    rewrite ^ /owncloud/index.php$uri;
  }

  location ~ ^/owncloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {
    deny all;
  }

  location ~ ^/owncloud/(?:\.|autotest|occ|issue|indie|db_|console) {
    deny all;
  }

  location ~ ^/owncloud/(?:updater|ocs-provider)(?:$|/) {
    try_files $uri/ =404;
    index index.php;
  }

  location ~ ^/owncloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
    include uwsgi_params;
    uwsgi_modifier1 14;
    # Avoid duplicate headers confusing OC checks
    uwsgi_hide_header X-Frame-Options;
    uwsgi_hide_header X-XSS-Protection;
    uwsgi_hide_header X-Content-Type-Options;
    uwsgi_hide_header X-Robots-Tag;
    uwsgi_pass unix:/run/uwsgi/owncloud.sock;
  }

  # Adding the cache control header for js and css files
  # Make sure it is BELOW the PHP block
  location ~* \.(?:css|js) {
    try_files $uri /owncloud/index.php$uri$is_args$args;
    add_header Cache-Control "public, max-age=7200";
    # Add headers to serve security related headers  (It is intended
    # to have those duplicated to the ones above)
    # Before enabling Strict-Transport-Security headers please read
    # into this topic first.
    # add_header Strict-Transport-Security "max-age=15768000;
    # includeSubDomains; preload;";
    add_header X-Content-Type-Options nosniff;
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    add_header X-Download-Options noopen;
    add_header X-Permitted-Cross-Domain-Policies none;
    # Optional: Don't log access to assets
    access_log off;
  }

  location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg) {
    try_files $uri /owncloud/index.php$uri$is_args$args;
    # Optional: Don't log access to other assets
    access_log off;
  }
}

Docker

DockerownCloud あるいは Nextcloud リポジトリを見てください。

ファイルマネージャからアップロード・共有

shareLinkCreator はサポートされているファイルマネージャから ownCloud にファイルをアップロードする機能を提供します。アップロードしたファイルのリンクをメールなどで配ることが可能です。

バックグラウンドジョブの定義

Nextcloud では一部のタスクを定期的に実行する必要があり、デフォルトでは AJAX が使われます。しかしながら AJAX は信頼性の高い方法とはいえないため Cron の使用が推奨されています。Arch Linux は systemd を搭載しているため、systemd タイマーを使用すると良いでしょう。

まずはサービスを作成:

/etc/systemd/system/nextcloudcron.service
[Unit]
Description=Nextcloud cron.php job

[Service]
User=http
ExecStart=/usr/bin/php -f /usr/share/webapps/nextcloud/cron.php

[Install]
WantedBy=basic.target

そしてサービスのタイマーを作成:

/etc/systemd/system/nextcloudcron.timer
[Unit]
Description=Run Nextcloud cron.php every 15 minutes

[Timer]
OnBootSec=5min
OnUnitActiveSec=15min
Unit=nextcloudcron.service

[Install]
WantedBy=timers.target

作成したら nextcloudcron.timer起動有効化してください。

タイマーの実行を確認するには:

# systemctl list-timers

Collabora Online Office の統合

公式 Docker イメージを使う

docker パッケージをインストールして collabora のファイルを用意して Collabora サーバーをセットアップしてください。

docker.service起動有効化してください。

必要なバイナリをダウンロード:

# docker pull collabora/code

それから Collabora サーバーをインストールしてください。cloud//.example//.com は collabora ではなく nextcloud のドメインにしてください:

# docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=cloud\\.example\\.com' --restart always --cap-add MKNOD collabora/code

文字列は正規表現として評価されるため、ドットは全てバックスラッシュ (\) 2回でエスケープしてください。複数の Nextcloud で docker コンテナを使用する場合、'domain=cloud\\.example\\.com\|second\\.example\\.com' を使ってください (ホストは全て \|. で区切ります)。`localhost` をドメインとして使用する場合は --net host を追加して docker コンテナが Nextcloud サーバーにアクセスできるようにする必要があります。

Nginx

nextcloud のドメイン設定に以下を追加するか、/etc/nginx/conf.d/ ディレクトリに新しい設定ファイルを作成してください (office.example.comssl_certificate は適切な値に置き換えてください):

/etc/nginx/conf.d/example.conf
 upstream office.example.com {
    server 127.0.0.1:9980;
}

server {
    listen 443 ssl;
    server_name office.example.com;
 
    ssl_certificate /etc/letsencrypt/live/office.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/office.example.com/privkey.pem;

    # static files
    location ^~ /loleaflet {
        proxy_pass http://127.0.0.1:9980;
        proxy_set_header Host $host;
    }

    # WOPI discovery URL
    location ^~ /hosting/discovery {
        proxy_pass http://127.0.0.1:9980;
        proxy_set_header Host $host;
    }

    # Main websocket
    location ~ /lool/(.*)/ws$ {
        proxy_pass http://127.0.0.1:9980;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
        proxy_read_timeout 36000s;
    }

    # Admin Console websocket
    location ^~ /lool/adminws {
	proxy_buffering off;
        proxy_pass http://127.0.0.1:9980;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
        proxy_read_timeout 36000s;
    }

    # download, presentation and image upload
    location ~ /lool {
        proxy_pass http://127.0.0.1:9980;
        proxy_set_header Host $host;
    }
}

設定したら nginx を再起動してください。

Apache

nextcloud の設定ファイルに以下を追加してください:

/etc/httpd/conf/extra/nextcloud.conf
<VirtualHost *:443>
ServerName office.nextcloud.com:443

# SSL configuration, you may want to take the easy route instead and use Lets Encrypt!
SSLEngine on
SSLCertificateFile /path/to/signed_certificate
SSLCertificateChainFile /path/to/intermediate_certificate
SSLCertificateKeyFile /path/to/private/key
SSLProtocol             all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
SSLHonorCipherOrder     on

# Encoded slashes need to be allowed
AllowEncodedSlashes NoDecode

# Container uses a unique non-signed certificate
SSLProxyEngine On
SSLProxyVerify None
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerName Off

# keep the host
ProxyPreserveHost On

# static html, js, images, etc. served from loolwsd
# loleaflet is the client part of LibreOffice Online
ProxyPass           /loleaflet https://127.0.0.1:9980/loleaflet retry=0
ProxyPassReverse    /loleaflet https://127.0.0.1:9980/loleaflet

# WOPI discovery URL
ProxyPass           /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0
ProxyPassReverse    /hosting/discovery https://127.0.0.1:9980/hosting/discovery

# Main websocket
ProxyPassMatch "/lool/(.*)/ws$" wss://127.0.0.1:9980/lool/$1/ws nocanon

# Admin Console websocket
ProxyPass   /lool/adminws wss://127.0.0.1:9980/lool/adminws

# Download as, Fullscreen presentation and Image upload operations
ProxyPass           /lool https://127.0.0.1:9980/lool
ProxyPassReverse    /lool https://127.0.0.1:9980/lool
</VirtualHost>

設定したら apache を再起動してください。

Nextcloud アプリのインストール

Apps セクションから “Office & Text” を選択して “Collabora Online” アプリをインストールしてください。管理パネルから Collabora Online タブを選択して設定したサーバーのドメインを指定してください。

Arch Linux のパッケージを使う

collabora-online-server-nodockerAUR パッケージは Collabora Office (デスクトップスイート) と “lool” (LibreOffice OnLine) ベースの “CODE” (Collabora Online Development Edition) サーバーをインストールします。

/etc/loolwsd/loolwsd.xml ファイルを以下のように変更してください:

  • `config > server_name` に公開する Nextcloud のアドレスのホストとポートを記入してください (例: example.org:443)。
  • `config > ssl > enable` は false にしてください (ウェブブラウザ —HTTPS→ プロキシ —HTTP→ loolwsd)。
  • `config > ssl > termination` は true にしてください。
  • `config > storage > wopi > host` はプロキシサーバーの実際のホストネームに合わせてください (例: `(?:.*\.)?example\.org`)。
  • `config > admin_console > username` と `config > admin_console > password` は適当に設定してください。

それから loolwsd.service を起動・有効化して、/usr/share/doc/loolwsd/example.nginx.conf に書かれているように Nginx を設定してください。

トラブルシューティング

Environment variables not available

/etc/php/php-fpm.d/www.conf の以下の行をアンコメントしてください [5]:

env[PATH] = /usr/local/bin:/usr/bin:/bin

自己署名証明書が使えない

ownCloud は cURLSabreDAV を使って WebDAV が有効になっているかチェックします。(LAMP の記事に書かれているように) 自己署名証明書で SSL/TLS を使って、ownCloud の管理者ページにアクセスすると、以下のエラーメッセージが表示されます:

Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.

LAMP のチュートリアルにしたがって設定を行っている場合、以下の手順を実行してください:

証明書のためのローカルディレクトリを作成して、そこに LAMP の証明書をコピーします。これによって ca-certificates のアップデートによって証明書が上書きされるのを防ぎます。

# cp /etc/httpd/conf/server.crt /usr/share/ca-certificates/WWW.EXAMPLE.COM.crt

WWW.EXAMPLE.COM.crt/etc/ca-certificates.conf に追加:

WWW.EXAMPLE.COM.crt

そして証明書を更新:

# update-ca-certificates

httpd サービスを再起動して証明書を有効にしてください。

これで動作しない場合は /etc/php/php.ini で mod_curl を無効化してみてください。

Android デバイスの自己署名証明書

LAMP#TLS/SSL に書かれているように SSL のセットアップをした場合、古いバージョンの DAVdroid では証明書が信頼できないとして接続が拒否されます。以下のようにサーバーに証明書を作成できます:

# openssl x509 -req -days 365 -in /etc/httpd/conf/server.csr -signkey /etc/httpd/conf/server.key -extfile android.txt -out CA.crt
# openssl x509 -inform PEM -outform DER -in CA.crt -out CA.der.crt

android.txt ファイルに以下を記述してください:

basicConstraints=CA:true

そして Android 端末に CA.der.crt をインポートしてください:

Android 端末の SD カードに CA.der.crt ファイルを保存してください (メールの添付ファイルなどを使って保存してください)。ファイルはルートディレクトリに配置してください。そして Settings > Security > Credential storage から Install from device storage を選択します。.crt ファイルが検出されて、証明書の名前の入力が求められます。証明書をインポートしたら、Settings > Security > Credential storage > Trusted credentials > User から確認できるはずです。

ソース: [6]

CAdroid を使ってサーバーから直接証明書をインポートする方法もあります。

Cannot write into config directory!

PHP やウェブサーバーの設定ファイル (例: /etc/httpd/conf/extra/nextcloud.conf) で open_basedir を設定している場合、/etc/webapps が含まれていることを確認してください。

変更を適用するにはウェブサーバーの再起動が必要です。

Cannot create data directory

PHP やウェブサーバーの設定ファイル (例: /etc/httpd/conf/extra/nextcloud.conf) で open_basedir を設定している場合、data ディレクトリが含まれていることを確認してください。

変更を適用するにはウェブサーバーの再起動が必要です。

CSync failed to find a specific file.

おそらく証明書に問題があります。証明書を再度作成して、名前を空にしないようにしてください。そうしないとエラーがまた発生します。

# openssl req -new -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt

ログイン後に白いページが表示される

おそらく新しくインストールしたアプリが原因です。修正するには、こちら に書かれているように occ コマンドを使用します。アプリを全て確認するには:

# sudo -u http php /usr/share/webapps/nextcloud/occ app:list

問題のアプリを無効化するには (Nextcloud を標準のディレクトリにインストールした場合):

# sudo -u http php /usr/share/webapps/nextcloud/occ app:disable <nameOfExtension>

もしくは phpMyAdmin を使って oc_appconfig テーブルを編集するか (運が良いことにテーブルに edit オプションがある場合) mysql で手動で修正してください:

$ mysql -u root -p owncloud
MariaDB [owncloud]> delete from oc_appconfig where appid='<nameOfExtension>' and configkey='enabled' and configvalue='yes';
MariaDB [owncloud]> insert into oc_appconfig (appid,configkey,configvalue) values ('<nameOfExtension>','enabled','no');

テーブルから関連する設定が削除されるので、後でまた追加してください。

GUI の同期クライアントで接続できない

HTTP のベーシック認証を使っている場合、status.php が対象から外れていることを確認してください。このファイルは誰からでもアクセスできるようにしておく必要があります [7]

ファイルをアップロードすると 'Integrity constraint violation...' エラーが表示される

ownCloud の同期クライアントで以下のエラーが表示されることがあります:

SQLSTATE[23000]: Integrity constraint violation: ... Duplicate entry '...' for key 'fs_storage_path_hash')...

File Locking アプリの問題が原因です。ウェブーサーバーの設定の衝突が発生しているのに対処できていません。エラーが発生しない Transactional File Locking が存在しますが、Redis の php キャッシュを使う必要があります。redisphp-redis をインストールして、現在使っている php のキャッシュをコメントアウトして、/etc/php/conf.d/redis.ini から extension=redis.so をアンコメントしてください。そして config.php に以下の変更を加えます:

'memcache.local' => '\OC\Memcache\Redis',
'filelocking.enabled' => 'true',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
     'host' => 'localhost',
     'port' => 6379,
     'timeout' => 0.0,
       ),

設定したら Redis再起動してください。

最後に、File Locking アプリを無効化して、Transational File Locking を使うようにしてください。

管理者ページのサーバーステータスに 'Transactional File Locking Enabled' が表示され、同期の問題が消えるはずです。

"Cannot write into apps directory"

公式の管理者マニュアル に書かれているように、http ユーザーからアプリディレクトリに書き込みができるようにするか、appstoreenabledfalse に設定する必要があります。

MIME タイプエラーによってインストールしたアプリがブロックされる

apps フォルダを nextcloud のインストールディレクトリの外に配置した場合、ウェブサーバーが正しく設定されているか確認してください。

nginx の場合、以下のように設定ファイルにデフォルトで含まれていないフォルダの location ブロックを追加する必要があります:

location ~ /apps2/(.*)$ {
    alias /var/www/nextcloud/apps/$1;
}

nginx.conf に推奨設定を記述したのにセキュリティの警告が表示される

管理者マニュアルにしたがって Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, X-XSS-Protection, X-Robots-Tag を設定しても管理者ページの上部に警告が表示されることがあります。

考えられる原因として ownCloud 自身が設定を行っていて、uWSGI によって nginx に設定が重複して追加されてしまっている可能性があります:

$ curl -I https://domain.tld
...
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: Sameorigin
X-Robots-Tag: none
Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Robots-Tag: none

fast_cgi のサンプル設定には重複を避けるためのパラメータが存在しますが (fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice)、uwsgi と nginx を使用する場合、nginx.conf の uwsgi の部分に以下の修正を加えることで解決します:

 /etc/nginx/nginx.conf
...
        # pass all .php or .php/path urls to uWSGI
        location ~ ^(.+\.php)(.*)$ {
            include uwsgi_params;
            uwsgi_modifier1 14;
            # hode following headers received from uwsgi, because otherwise we would send them twice since we already add them in nginx itself
            uwsgi_hide_header X-Frame-Options;
            uwsgi_hide_header X-XSS-Protection;
            uwsgi_hide_header X-Content-Type-Options;
            uwsgi_hide_header X-Robots-Tag;
            uwsgi_hide_header X-Frame-Options;
            #Uncomment line below if you get connection refused error. Remember to commet out line with "uwsgi_pass 127.0.0.1:3001;" below
            uwsgi_pass unix:/run/uwsgi/owncloud.sock;
            #uwsgi_pass 127.0.0.1:3001;
        }
...

"Reading from keychain failed with error: 'No keychain service available'"

Gnome の場合、libgnome-keyringgnome-keyring パッケージをインストールすることで解決します。KDE の場合、libgnome-keyringqtkeychain パッケージをインストールしてください。

FolderSync: "Method Not Allowed"

FolderSync は /nextcloud/remote.php/webdav へのアクセス権限を必要とするため、/etc/httpd/conf/extra/nextcloud.conf にエイリアスを作成してください:

<IfModule mod_alias.c>
  Alias /nextcloud /usr/share/webapps/nextcloud/
  Alias /owncloud /usr/share/webapps/nextcloud/
</IfModule>

Nextcloud 13 : "Unable to load dynamic library 'mcrypt.so"

php 7.2 から mcrypt 拡張は削除されました [8]

mcrypt に関する Nextcloud のエラーを修正するには、PECL で php 7.2 に対応した拡張をインストールします。

1. php-pear をインストール (インストールしていない場合)。

2. PECL チャンネルを更新:

# pecl channel-update pecl.php.net

3. mcrypt 1.0.1 をインストール:

# pecl install mcrypt-1.0.1

4. /etc/php/php.conf の以下の行をアンコメント:

;extension=mcrypt.so

参照