AZURE CentOS

AzureのCentOSにNextcloud 警告対策

AZURE

◆警告が出る 煩わしいので対応してみる

セキュリティ&セットアップ警告

あなたのサーバーのセキュリティとパフォーマンスのためには、すべてが正確に設定されていることが重要です。あなたの力になるよう、Nextcloudでは一部の自動チェックを行っています。Tips & Tricksセクションや、詳細な情報はドキュメントを参照してください。

1.Some files have not passed the integrity check. Further information on how to resolve this issue can be found in our documentation. (List of invalid files… / Rescan…)

★対策:エラーメッセージの (List of invalid files… / Rescan…) のリンクをクリックしたら

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
– core
– EXTRA_FILE
– test.html

そこで、/var/www/nextcloud/test.html 削除してみた

なかなかエラー解消しなかったが、突然エラー解消された。良くわからない。

2.”Strict-Transport-Security” HTTPヘッダが、最低でも “15552000” 秒に設定されていません。セキュリティを強化するには、セキュリティTipsで解説しているHSTSを有効にすることを推奨します。

★対策:/etc/httpd/conf.d/nextcloud.conf に下記追加で対応

<IfModule mod_headers.c>
Header always set Strict-Transport-Security “max-age=15552000; includeSubDomains”
</IfModule>

 

3.メモリキャッシュが設定されていません。可能であれば、パフォーマンスを向上するため、memcacheを設定してください。より詳しい情報はドキュメントで参照できます。

★対策:https://yomon.hatenablog.com/entry/2016/02/16/195809 参照

そもそも、memcached がインストールされてない
# yum -y install memcached

/var/www/nextcloud/config/config.php に下記追加
‘memcache.local’ => ‘\OC\Memcache\APCu’,

4.PHP OPcacheが適切に設定されていません。よりパフォーマンスを向上させるには、php.iniで以下の設定を推奨します:

opcache.enable=1 opcache.enable_cli=1 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 opcache.revalidate_freq=1

★対策:https://qiita.com/ozy-san/items/d18a4960661686954add 参考

/etc/php.d/10-opcache.ini に下記設定(/etc/php.ini を編集しても駄目だった)

opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1

—————————————————————————

セキュリティ&セットアップ警告

すべてのチェックに合格しました。

はまったが、ようやく解決した。結構めんどう。


コメント