1

私はすでにhttp://codex.wordpress.org/Hardening_WordPressを読んだことがありますが、理解できません。どのようなパーミッションを設定し、誰が所有するのか? 現在、次のコマンドの結果として設定しています。

# reset to safe defaults
find /usr/share/wordpress -exec chown www-data:www-data {} \;
find /usr/share/wordpress -type d -exec chmod 755 {} \;
find /usr/share/wordpress -type f -exec chmod 644 {} \;

# allow wordpress to manage wp-config.php (but prevent world access)
chgrp www-data /usr/share/wordpress/wp-config.php
chmod 660 /usr/share/wordpress/wp-config.php

# allow wordpress to manage .htaccess
chgrp www-data /usr/share/wordpress/.htaccess
chmod 664 /usr/share/wordpress/.htaccess

# allow wordpress to manage wp-content
find /usr/share/wordpress/wp-content -exec chgrp www-data {} \;
find /usr/share/wordpress/wp-content -type d -exec chmod 775 {} \;
find /usr/share/wordpress/wp-content -type f -exec chmod 664 {} \;

この構成の後、インストールは使用できなくなります。任意のヒント?

4

1 に答える 1

1

サーバーでアクセス許可を管理する方法の簡単な要約を次に示します。

  • 誰でもファイルとディレクトリを読み取ることができます
  • /wp-content/uploads ディレクトリの外には何も書き込めません
  • /wp-content/uploads ディレクトリ内でPHP スクリプトを実行できない
  • /wp-include および /wp-content でPHP スクリプトを直接実行することはできません

したがって、apache ユーザーがそれらを読み取ることができる限り、誰が .php ファイルを所有しているかは問題ではありません。apache ユーザーがこれらのファイルを変更できるようにすることは、たとえ .htaccess であっても危険です。これらすべての欠点は、プラグインのインストールまたは削除、テーマまたはコアの更新などを行うために、WordPress に FTP 資格情報を提供する必要があることです。

于 2012-10-10T21:39:48.220 に答える