wordpressのwp-config.phpファイル脆弱

WordPressの「wp-config.php」というファイルは、データベースのアカウント情報などWordPressを利用する上で最も重要な情報が書かれているファイルのため、セキュリティレベルを高くしておく必要があります。

nginxを使っている場合は、

location ~* /wp-config.php {
	  deny all;
}

apacheを使っている場合は、.htaccessファイルを作成して、

<files wp-config.php>
order allow,deny
deny from all
</files>

この設定により、Webサーバからのアクセスが遮断され、セキュリティを確保することができます。また、ファイルのパーミッションは自動作成した場合は「666」などになっていますが、所有者のみがアクセスできる「400」に設定しておくようにしましょう。

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny