「Seafile」の版間の差分
表示
削除された内容 追加された内容
細 →参照: リンク切れ修正 |
Kusanaginoturugi (トーク | 投稿記録) アーカイブ タグ: 新規リダイレクト |
||
| (同じ利用者による、間の1版が非表示) | |||
| 1行目: | 1行目: | ||
#redirect [[ArchWiki:アーカイブ]] |
|||
[[Category:ファイル共有]] |
|||
[[Category: |
[[Category:アーカイブ]] |
||
[[en:Seafile]] |
|||
Seafile はオープンソースのクラウドストレージシステムです。ファイル同期・プライバシー保護・チームワークの高度なサポートがあります。 |
|||
ファイルの集合はライブラリと呼ばれ、各ライブラリを別々に同期することができます。ライブラリはユーザーが決めたパスワードで暗号化できます。パスワードはサーバーに保存されないため、サーバーの管理者ですらファイルの中身を見ることはできません。 |
|||
Seafile ではファイル同期や wiki、議論ができるグループを作成することができ、チーム内で簡単にドキュメントを共有できます。 |
|||
この記事では Seafile サーバーのインストールについて説明します。Seafile サーバーにアクセスするためのクライアントだけ使いたい場合、{{Aur|seafile-client}} をインストールしてください。 |
|||
== インストール == |
|||
{{AUR|seafile-server}} パッケージを[[インストール]]してください。このパッケージは {{AUR|seafile}} の分割パッケージですが、全てのパッケージをインストールする必要は必ずしもありません。 |
|||
root で seafile サーバーを動作させるための新しいユーザーを作成してください: |
|||
# useradd -m -r -d /srv/seafile -s /usr/bin/nologin seafile |
|||
== 設定 == |
|||
=== サーバーインスタンスの設定 === |
|||
[[#インストール]]で設定したユーザーに切り替えてください (これより下のコマンドは特に断りがないかぎりこのユーザーで実行します): |
|||
$ sudo -u seafile -s /bin/sh |
|||
新しい seafile サーバーインスタンスのためのディレクトリレイアウトを作成: |
|||
$ mkdir -p $HOME/example.org/seafile-server |
|||
$ cd $HOME/example.org |
|||
{{Note|''example.org'' は実際のサーバーのドメインに置き換えてください。}} |
|||
必要な seahub のバージョンを確認 ('x.y.z-r' という形式で表示されます。例: 3.0.2): |
|||
$ pacman -Qi seafile-server | grep Version |
|||
出力された値に {{ic|SEAFILE_SERVER_VERSION}} 変数を設定: |
|||
$ SEAFILE_SERVER_VERSION=3.0.3 |
|||
seahub をダウンロードして展開: |
|||
$ wget -P seafile-server https://github.com/haiwen/seahub/archive/v$SEAFILE_SERVER_VERSION-server.tar.gz |
|||
$ tar -xz -C seafile-server -f seafile-server/v$SEAFILE_SERVER_VERSION-server.tar.gz |
|||
展開したディレクトリの名前を変更: |
|||
$ mv seafile-server/seahub-$SEAFILE_SERVER_VERSION-server seafile-server/seahub |
|||
[http://manual.seafile.com/deploy/README.html seafile のマニュアル] に書かれている以下のどちらかのページの 'setup' セクションに従って seafile サーバーインスタンスの設定を作成してください: |
|||
* [http://manual.seafile.com/deploy/using_sqlite.html SQLite] |
|||
* [http://manual.seafile.com/deploy/using_mysql.html MySQL] |
|||
seafile ユーザーで {{ic|seafile-admin}} コマンドを実行することで初期設定ができます。適切なディレクトリで実行してください: |
|||
{{Note|{{AUR|seahub}} パッケージをインストールしないと {{ic|seafile-admin}} は機能しません。}} |
|||
$ cd $HOME/''example.org'' |
|||
$ seafile-admin setup |
|||
英語以外の言語のサポートが必要な場合、以下のコマンドを実行して必要な言語をコンパイルしてください: |
|||
$ cd $HOME/''example.org''/seafile-server/seahub/locale/<yourlanguage>/LC_MESSAGES/ |
|||
$ msgfmt -o django.mo django.po |
|||
そしてデフォルト言語を設定に追加してください: |
|||
$ echo "LANGUAGE='<yourlanguage>'" >> $HOME/example.org/conf/seahub_settings.py |
|||
{{ic|/usr/lib/systemd/system/}} に存在する seafile の systemd サービスの {{ic|seafile-server@.service}} を {{ic|/etc/systemd/system}} にコピーして、{{ic|%i}} を[[#インストール]] で設定した $HOME に置き換えてください。 |
|||
Seafile のウェブフロント実装である seahub をテストしたい場合、systemd のサービスファイルを編集して {{ic|--fastcgi}} パラメータを削除してください。fastcgi は seahub ではサポートされていません。 |
|||
新しい seafile サーバーを手動で起動する場合、以下のコマンドを root で実行: |
|||
# systemctl start seafile-server@''example.org'' |
|||
起動が上手く出来たら、サービスを[[有効化]]すると良いでしょう。 |
|||
seafile のサーバーデーモンを起動したら、seafile インスタンスの管理ユーザーを作成します: |
|||
$ cd $HOME/''example.org'' |
|||
$ seafile-admin create-admin |
|||
=== nginx でインスタンスをデプロイ === |
|||
nginx で Seafile のウェブインターフェイスである seahub をデプロイしたい場合、以下のような nginx の設定を使います: |
|||
{{bc| |
|||
server { |
|||
listen 80; |
|||
server_name www.example.org example.org; |
|||
<nowiki>return 301 https://$server_name$request_uri;</nowiki> |
|||
} |
|||
server { |
|||
listen 443; |
|||
ssl on; |
|||
ssl_certificate /etc/ssl/certs/example.org.crt; |
|||
ssl_certificate_key /etc/ssl/private/server.key; |
|||
server_name www.example.org example.org; |
|||
location / { |
|||
fastcgi_pass 127.0.0.1:8000; |
|||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
|||
fastcgi_param PATH_INFO $fastcgi_script_name; |
|||
fastcgi_param SERVER_PROTOCOL $server_protocol; |
|||
fastcgi_param QUERY_STRING $query_string; |
|||
fastcgi_param REQUEST_METHOD $request_method; |
|||
fastcgi_param CONTENT_TYPE $content_type; |
|||
fastcgi_param CONTENT_LENGTH $content_length; |
|||
fastcgi_param SERVER_ADDR $server_addr; |
|||
fastcgi_param SERVER_PORT $server_port; |
|||
fastcgi_param SERVER_NAME $server_name; |
|||
fastcgi_param HTTPS on; |
|||
fastcgi_param HTTP_SCHEME https; |
|||
} |
|||
location /seafhttp { |
|||
rewrite ^/seafhttp(.*)$ $1 break; |
|||
<nowiki>proxy_pass http://127.0.0.1:8082;</nowiki> |
|||
client_max_body_size 0; |
|||
} |
|||
location /media { |
|||
root {ABSOLUTE_PATH_TO_SEAFILE_USER'S_HOME}/example.org/seafile-server/seahub; |
|||
} |
|||
} |
|||
}} |
|||
また、nginx で HTTPS を使用する場合、{{ic|ccnet.conf}} と {{ic|seahub_settings.py}} に以下の値を追加してください。設定しないとアップロードができません [http://manual.seafile.com/deploy/https_with_nginx.html], [https://forum.seafile.de/t/was-loaded-over-https-but-requested-an-insecure-xmlhttprequest-endpoint/248]。ファイルは seafile ユーザーで編集してください。 |
|||
{{hc|$HOME/example.org/config/ccnet.conf|2=<nowiki> |
|||
SERVICE_URL = https://example.org:8000 |
|||
</nowiki>}} |
|||
{{hc|$HOME/example.org/config/seahub_settings.py|2=<nowiki> |
|||
FILE_SERVER_ROOT = 'https://example.org/seafhttp' |
|||
</nowiki>}} |
|||
== メンテナンス == |
|||
=== アップグレード === |
|||
まず root で seafile サーバーインスタンスを停止してください (全てのインスタンスを停止してください): |
|||
# systemctl stop seafile-server@example.org |
|||
[[Arch User Repository]] から {{AUR|seafile-server}} をアップグレードしてください。 |
|||
以下のコマンドで seafile ユーザーに切り替えます: |
|||
$ sudo -u seafile -s |
|||
seafile のサーバーインスタンスの数だけ、以下の手順を繰り返しおこなってください。 |
|||
* サーバーインスタンスの 'seafile-server' サブディレクトリに移動: |
|||
$ cd /srv/seafile/example.org/seafile-server |
|||
* preupgrade スクリプトを実行 (または手動で設定してください。[https://github.com/haiwen/seafile/wiki/Build-and-deploy-seafile-server-from-source Seafile wiki] を参照): |
|||
$ seahub-preupgrade |
|||
* upgrade サブディレクトリから適切な seafile/seahub アップグレードスクリプトを実行: |
|||
:* マイナーアップグレードの場合 (x.y.a から x.y.b): {{ic|$ ./upgrade/minor-upgrade.sh}}。 |
|||
:* メジャーアップグレードの場合 (x.y.a から z.w.b): {{ic|$ ./upgrade/upgrade_x.y_z.w.sh}}。 |
|||
* 上記で説明している言語の設定をおこなってください。 |
|||
最後に、root で seafile のサーバーインスタンスを起動してください: |
|||
# systemctl start seafile-server@example.org |
|||
=== Seafile GC の実行 === |
|||
未使用ブロックに確保されているストレージ領域を開放するには、Seafile のガベージコレクタを実行します。 |
|||
GC プログラムは以下のブロックを削除します: |
|||
* 存在しないライブラリにも属していないブロック。 |
|||
* ライブラリの履歴を越える古いブロック。 |
|||
まず、サーバーの Seafile プログラムをシャットダウンしてください。Professional Edition v.3.1.11 の場合、オンライン GC がサポートされています。 |
|||
実際に実行する前にガベージコレクションによって回収される領域を確認するには: |
|||
$ seafserv-gc -c /srv/seafile/example.org/ccnet -d /srv/seafile/example.org/seafile-data --dry-run |
|||
出力が問題ないようだったら {{ic|--dry-run}} を外して同じコマンドをもういちど実行してください。 |
|||
== 参照 == |
|||
* http://manual.seafile.com/deploy/ |
|||
* http://manual.seafile.com/deploy/deploy_with_nginx.html |
|||
* http://manual.seafile.com/deploy/https_with_nginx.html |
|||
* http://manual.seafile.com/maintain/seafile_gc.html |
|||
2024年9月8日 (日) 17:32時点における最新版
転送先: